Netdev List
 help / color / mirror / Atom feed
* Free referrals at All Services Finders for users and free sign ups for service providers in San Diego County
From: Mike Benoit @ 2005-11-08 22:36 UTC (permalink / raw)
  To: netdev



The first service provider in each of our service categories who registers as a vendor at www.AllServicesFinders.com will receive a free six month ad.

If you are not a service provider please register as a user.  This too is totally free and we are having a five hundred dollar drawing for those who have registered at the end of the year.

To register just go to www.AllServicesFinders.com After you make it there then click on the login button at the right hand top side of the page.

This will take you to a login screen, immediately to the right of the login field you will find instruction on upgrading to a vendor account or opening a user account.  Just click on that arrow and carefully fill out the information asked to create your account.  

You will not be asked for money or credit card information.  Even if the page has a field for that information do not fill it in.  That is for those people who are paying for ads.


Thanks


Mike

^ permalink raw reply

* [PATCH] Fix fallout from CONFIG_IPV6_PRIVACY
From: Peter Chubb @ 2005-11-09  0:16 UTC (permalink / raw)
  To: netdev, linux-kernel


Trying to build today's 2.6.14+git snapshot gives undefined references
to use_tempaddr

Looks like an ifdef got left out.

Signed-off-by: Peter Chubb <peterc@gelato.unsw.edu.au>

 net/ipv6/addrconf.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6-import/net/ipv6/addrconf.c
===================================================================
--- linux-2.6-import.orig/net/ipv6/addrconf.c	2005-11-09 11:11:42.137993239 +1100
+++ linux-2.6-import/net/ipv6/addrconf.c	2005-11-09 11:12:39.857561898 +1100
@@ -1022,6 +1022,7 @@ int ipv6_dev_get_saddr(struct net_device
 					continue;
 			}
 
+#ifdef CONFIG_IPV6_PRIVACY
 			/* Rule 7: Prefer public address
 			 * Note: prefer temprary address if use_tempaddr >= 2
 			 */
@@ -1043,7 +1044,7 @@ int ipv6_dev_get_saddr(struct net_device
 				if (hiscore.attrs & IPV6_SADDR_SCORE_PRIVACY)
 					continue;
 			}
-
+#endif
 			/* Rule 8: Use longest matching prefix */
 			if (hiscore.rule < 8)
 				hiscore.matchlen = ipv6_addr_diff(&ifa_result->addr, daddr);

^ permalink raw reply

* TSO and 2.6.13.2
From: Ben Greear @ 2005-11-09  0:44 UTC (permalink / raw)
  To: 'netdev@oss.sgi.com'

It appears that I can (almost?) completedly deadlock a
TCP connection when using TSO on 2.6.13.2.  My test involves
trying to send 200Mbps between two interfaces.  With TSO enabled (ie, the default
for e1000 NICs), in less than 1 minute, there are no more packets transmitted,
though it does run nice and fast untill it completely breaks :P

I disabled TSO with ethtool, and now it seems to be working reliably.

I can attempt to grab network traces if this is worth pursuing.

Considering the ongoing troubles with TSO, it is my opinion that it
should be disabled by default...but maybe I'm just unlucky.

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

^ permalink raw reply

* Re: [PATCH] [IPV4] Fix secondary IP addresses after promotion
From: Thomas Graf @ 2005-11-09  0:56 UTC (permalink / raw)
  To: Patrick McHardy
  Cc: Brian Pomerantz, netdev, davem, kuznet, pekkas, jmorris, yoshfuji,
	kaber, linux-kernel
In-Reply-To: <4370B203.8070501@trash.net>

* Patrick McHardy <kaber@trash.net> 2005-11-08 15:11
> Yes, fixing it correctly looks very hard. Just changing the routes
> doesn't seem right to me, someone might have added it with exactly
> this prefsrc and doesn't want it to change, its also not clear how
> to notify on this.

Right, OTOH this someone might also just use the primary address
as prefsrc and would welcome a translation to the new address
instead of a silent deletion. Nevertheless, I agree with deleting
and readding the local routes (for now ;-) while I keep this in
mind for later improvement.

> I have a patch to do this, but it needs some debugging, for some
> unknown reason it crashes sometimes if I remove addresses without
> specifying the mask.

Interesting, do you use an iproute2 version with the wildcard
address deletion fix attached below?

diff -Nru a/ChangeLog b/ChangeLog
--- a/ChangeLog	2005-03-19 00:49:52 +01:00
+++ b/ChangeLog	2005-03-19 00:49:52 +01:00
@@ -1,3 +1,8 @@
+2005-03-19  Thomas Graf <tgraf@suug.ch>
+
+	* Warn about wildcard deletions and provide IFA_ADDRESS upon
+	  deletions to enforce prefix length validation for IPv4.
+
 2005-03-18  Stephen Hemminger  <shemminger@osdl.org>
 
 	* add -force option to batch mode
diff -Nru a/include/utils.h b/include/utils.h
--- a/include/utils.h	2005-03-19 00:49:52 +01:00
+++ b/include/utils.h	2005-03-19 00:49:52 +01:00
@@ -43,8 +43,11 @@
 	__u8 family;
 	__u8 bytelen;
 	__s16 bitlen;
+	__u32 flags;
 	__u32 data[4];
 } inet_prefix;
+
+#define PREFIXLEN_SPECIFIED 1
 
 #define DN_MAXADDL 20
 #ifndef AF_DECnet
diff -Nru a/ip/ipaddress.c b/ip/ipaddress.c
--- a/ip/ipaddress.c	2005-03-19 00:49:52 +01:00
+++ b/ip/ipaddress.c	2005-03-19 00:49:52 +01:00
@@ -744,6 +744,7 @@
 	} req;
 	char  *d = NULL;
 	char  *l = NULL;
+	char  *lcl_arg = NULL;
 	inet_prefix lcl;
 	inet_prefix peer;
 	int local_len = 0;
@@ -821,6 +822,7 @@
 				usage();
 			if (local_len)
 				duparg2("local", *argv);
+			lcl_arg = *argv;
 			get_prefix(&lcl, *argv, req.ifa.ifa_family);
 			if (req.ifa.ifa_family == AF_UNSPEC)
 				req.ifa.ifa_family = lcl.family;
@@ -838,9 +840,17 @@
 		exit(1);
 	}
 
-	if (peer_len == 0 && local_len && cmd != RTM_DELADDR) {
-		peer = lcl;
-		addattr_l(&req.n, sizeof(req), IFA_ADDRESS, &lcl.data, lcl.bytelen);
+	if (peer_len == 0 && local_len) {
+		if (cmd == RTM_DELADDR && lcl.family == AF_INET && !(lcl.flags & PREFIXLEN_SPECIFIED)) {
+			fprintf(stderr,
+			    "Warning: Executing wildcard deletion to stay compatible with old scripts.\n" \
+			    "         Explicitly specify the prefix length (%s/%d) to avoid this warning.\n" \
+			    "         This special behaviour is likely to disappear in further releases,\n" \
+			    "         fix your scripts!\n", lcl_arg, local_len*8);
+		} else {
+			peer = lcl;
+			addattr_l(&req.n, sizeof(req), IFA_ADDRESS, &lcl.data, lcl.bytelen);
+		}
 	}
 	if (req.ifa.ifa_prefixlen == 0)
 		req.ifa.ifa_prefixlen = lcl.bitlen;
diff -Nru a/lib/utils.c b/lib/utils.c
--- a/lib/utils.c	2005-03-19 00:49:52 +01:00
+++ b/lib/utils.c	2005-03-19 00:49:52 +01:00
@@ -241,6 +241,7 @@
 				err = -1;
 				goto done;
 			}
+			dst->flags |= PREFIXLEN_SPECIFIED;
 			dst->bitlen = plen;
 		}
 	}

^ permalink raw reply

* [git patches] 2.6.x net driver updates
From: Jeff Garzik @ 2005-11-09  6:53 UTC (permalink / raw)
  To: Andrew Morton, Linus Torvalds; +Cc: netdev, linux-kernel


Please pull from 'upstream-linus' branch of
master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git

to receive the following updates, including a big ipw wireless update:

 include/linux/eeprom.h                    |  136 
 Documentation/networking/README.ipw2100   |  119 
 Documentation/networking/README.ipw2200   |  194 
 MAINTAINERS                               |   18 
 arch/um/drivers/net_kern.c                |   36 
 arch/xtensa/platform-iss/network.c        |   33 
 drivers/net/Kconfig                       |    2 
 drivers/net/b44.c                         |  177 
 drivers/net/b44.h                         |   75 
 drivers/net/bonding/bond_main.c           |   32 
 drivers/net/bonding/bonding.h             |    7 
 drivers/net/cris/eth_v10.c                |  149 
 drivers/net/dgrs.c                        |   16 
 drivers/net/e100.c                        |    6 
 drivers/net/ns83820.c                     |   13 
 drivers/net/s2io.c                        |   43 
 drivers/net/skge.c                        |  267 -
 drivers/net/skge.h                        |    2 
 drivers/net/wireless/airo.c               |   36 
 drivers/net/wireless/airo_cs.c            |    6 
 drivers/net/wireless/atmel.c              |    2 
 drivers/net/wireless/atmel_cs.c           |    6 
 drivers/net/wireless/ipw2100.c            | 2862 ++++++------
 drivers/net/wireless/ipw2100.h            |  171 
 drivers/net/wireless/ipw2200.c            | 6861 +++++++++++++++++++++++-------
 drivers/net/wireless/ipw2200.h            |  592 +-
 drivers/net/wireless/prism54/isl_38xx.c   |   12 
 drivers/net/wireless/prism54/islpci_eth.c |   10 
 drivers/net/wireless/wavelan_cs.c         |    3 
 drivers/net/wireless/wl3501_cs.c          |    3 
 include/net/ieee80211.h                   |    2 
 include/net/ieee80211_crypt.h             |    1 
 net/ieee80211/ieee80211_crypt.c           |  156 
 net/ieee80211/ieee80211_rx.c              |    2 
 net/ieee80211/ieee80211_wx.c              |   14 
 35 files changed, 8273 insertions(+), 3791 deletions(-)

Adrian Bunk:
      fix NET_RADIO=n, IEEE80211=y compile
      kill include/linux/eeprom.h
      drivers/net/s2io.c: make functions static

Alexey Dobriyan:
      atmel: memset correct range

Ashutosh Naik:
      dgrs: fix warnings when CONFIG_ISA and CONFIG_PCI are not enabled

Ben Cahill:
      Fixes missed beacon logic in relation to on-network AP roaming.

Benoit Boissinot:
      Fix 'Driver using old /proc/net/wireless support, please fix driver !' message.

Christoph Hellwig:
      ieee80211: cleanup crypto list handling, other minor cleanups.
      cris v10 eth: use ethtool_ops
      xtensa platform-iss network: remove no-op ioctl handler
      uml_net: use ethtool_ops

Francois Romieu:
      b44: b44_start_xmit returns with a lock held when it fails allocating
      b44: miscellaneous cleanup
      b44: expose counters through ethtool
      b44: s/spin_lock_irqsave/spin_lock/ in b44_interrupt
      b44: late request_irq in b44_open
      b44: replace B44_FLAG_INIT_COMPLETE with netif_running()
      b44: race on device closing
      b44: increase version number

Hong Liu:
      Fixes the ad-hoc network WEP key list issue.
      [Bug 455] Fix frequent channel change generates firmware fatal error.
      Don't set hardware WEP if we are actually using TKIP/AES.
      Mixed PTK/GTK CCMP/TKIP support.
      Card with WEP enabled and using shared-key auth will have firmware
      Fixes problem with WEP not working (association succeeds, but no Tx/Rx)
      Fixes WEP firmware error condition.
      Fixed problem with not being able to send broadcast packets.

James Ketrenos:
      scripts/Lindent on ieee80211 subsystem.
      Update version ieee80211 stamp to 1.1.7
      Ran scripts/Lindent on drivers/net/wireless/ipw2{1,2}00.{c,h}
      Catch ipw2200 up to equivelancy with v1.0.1
      Catch ipw2200 up to equivelancy with v1.0.2
      Catch ipw2200 up to equivelancy with v1.0.3
      Catch ipw2200 up to equivelancy with v1.0.4
      Catch ipw2100 up to equivelancy with v1.1.1
      Catch ipw2200 up to equivelancy with v1.0.5
      Changed default # of missed beacons to miss before disassociation to 24
      Updated to support ieee80211 callback to is_queue_full for 802.11e
      Fixed some compiler issues if CONFIG_IPW2200_QOS is enabled.
      Added more useful geography encoding so people's experience with
      Modified ipw_config and STATUS_INIT setting to correct race condition
      Switched firmware error dumping so that it will capture a log available
      Changed all of the ipw_send_cmd() calls to return any ipw_send_cmd error
      Added cmdlog in non-debug systems.
      Updated ipw2200 to use the new ieee80211 callbacks
      Added wait_state wakeup on scan completion.
      Fixed problem with get_cmd_string not existing if CONFIG_IPW_DEBUG disabled.
      Removed PF_SYNCTHREAD legacy.
      Updated driver version stamps for ipw2100 (1.1.3) and ipw2200 (1.0.7)
      Pulled out a stray KERNEL_VERSION check around the suspend handler.
      Removed legacy WIRELESS_EXT checks from ipw2200.c
      Removed warning about TKIP not being configured if countermeasures are
      Added channel support for ipw2200 cards identified as 'ZZR'
      Fixed parameter reordering in firmware log routine.
      Updated firmware version stamp to 2.4 from 2.3 so it will use the latest firmware.
      Update version ipw2200 stamp to 1.0.8
      Updated READMEs and MAINTAINERS for the ipw2100 and ipw2200 drivers.

Jay Vosburgh:
      bonding: fix feature consolidation

Jeff Garzik:
      Merge branch 'master'
      Merge git://git.tuxdriver.com/git/netdev-jwl
      Merge rsync://bughost.org/repos/ieee80211-delta/
      Merge rsync://bughost.org/repos/ipw-delta/
      [wireless ipw2100] kill unused-var warnings for debug-disabled code

jketreno@io.(none):
      Fixed WEP on ipw2100 (priv->sec was being used instead of

Liu Hong:
      [Bug 339] Fix ipw2100 iwconfig set/get txpower.
      [Bug 637] Set tx power for A band.
      Migrated some of the channel verification code back into the driver to

Luiz Fernando Capitulino:
      Fix sparse warning in e100 driver.

Mike Kershaw:
      Adds radiotap support to ipw2200 in monitor mode..

Panagiotis Issaris:
      wireless net: Conversions of kmalloc/memset to kzalloc

Peter Jones:
      Make all the places the firmware fails to load showerrors (in decimal,
      Fixed is_network_packet() to include checking for broadcast packets.

Ralf Baechle:
      IOC: And don't mark the things as broken Cowboy.

Roger While:
      prism54 : Unused variable / extraneous udelay
      prism54 : Transmit stats updated in wrong place

Stephen Hemminger:
      skge: clear PCI PHY COMA mode on boot
      skge: use kzalloc
      skge: add mii ioctl support
      skge: goto low power mode on shutdown
      skge: use prefetch on receive
      skge: spelling fixes
      skge: increase version number

Volker Braun:
      Fix problem with WEP unicast key > index 0

Zhu Yi:
      IPW_DEBUG has already included DRV_NAME, remove double prefix print.
      Move code from ipw2100_wpa_enable to IPW2100_PARAM_DROP_UNENCRYPTED to
      Fix hardware encryption (both WEP and AES) doesn't work with fragmentation.
      Fix is_duplicate_packet() bug for fragmentation number setting.
      [bug 667] Fix the notorious "No space for Tx" bug.
      Workaround kernel BUG_ON panic caused by unexpected duplicate packets.
      Disable host fragmentation in open mode since IPW2200/2915 hardware
      [Bug 792] Fix WPA-PSK AES both for -Dipw and -Dwext.
      [Bug 701] Fix a misuse of ieee->mode with ieee->iw_mode.
      Fix ipw_wx_get_txpow shows wrong disabled value.
      Fix firmware error when setting tx_power.
      [Bug 760] Fix setting WEP key in monitor mode causes IV lost.
      [Fix bug# 771] Too many (8) bytes recieved when using AES/hwcrypto


[patch snipped due to size]

^ permalink raw reply

* [quagga-dev 3824] Re: Patch: RFC2863 #1 (incomplete)
From: Hasso Tepper @ 2005-11-09  9:00 UTC (permalink / raw)
  To: Thomas Graf; +Cc: netdev, quagga-dev, Stefan Rompf
In-Reply-To: <20051109001921.GK23537@postel.suug.ch>

Thomas Graf wrote:
> OK, my point might not be the best, still I think it is valid. The fact
> that certain routes have to be excluded from the routing calculation
> even if their link is up and running makes it obvious that the routing
> daemon can take care of DORMANT_L3DOWN itself and we don't need the
> kernel to hide them. Nothing more.

No. Routing daemon deals only with info from neighbours. While you can
say that "if link is down => neighbour is unreachable", you can't say
absolutely nothing about link if neighbour is down. Even with PtP media.
If neighbour is down, it just means that neighbour is down, but best
route to the neighbour is still via this link.
 
> We're talking about the auto routes in the main table, right? There
> is no reason for the addresses to be configured as a prefix, they
> can, and in my opinion should, be added as /~0 if the net is not
> guaranteed to be reachable at exactly this interface at all times.
> e.g. a user adding the address 1.1.1.1/24 on eth3 clearly says that
> 1.1.1.0/24 is always behind eth3, no matter what.

Really? How it can be behind eth3 if state of eth3 says that "no packets
to this link - it's DOWN"?
 
> If the route is supposed to be non-static then the address should be
> added as /32 to avoid the auto route in main table and the broadcast
> routes in the local table. Instead the routing daemon should be
> responsible of manging 1.1.1.0/24 at all times.
>
> Does this make sense?

No. This mandates usage of routing daemon even in my laptop which is
nonsense.
 
> Now even if this is not acceptable and you really need a way to
> favour routes added by userspace over auto/connected routes then
> we should fix this in the routing itself and not with a new
> opertional state interface state.

I'm not talking about new operational state of interface. I'm talking
about simple rule - if link is known to be unusable (!IFF_RUNNING), don't
use routes pointed to this link. Whether they are connected routes
created by kernel or static routes created by user.

Simple scenario with my personal laptop - wired ethernet
(192.168.1.10/24) and wireless (172.16.100.10/24). Two defaults, wireless
one is with higher metric. If I walk away from my table and disconnect
wired ethernet cable, I'd expect that it wouldn't use default pointed to
wired network _and_ 192.168.1.0/24 pointed to it any more. Default
pointed to the wireless is there, wireless link is known to be usable
(IFF_RUNNING) and 192.168.1.0/24 is reachable via wireless as well.


-- 
Hasso Tepper
Elion Enterprises Ltd.
WAN administrator

^ permalink raw reply

* [PATCH 1/2][MCAST] Fix for is_in(...)
From: Yan Zheng @ 2005-11-09 11:57 UTC (permalink / raw)
  To: netdev, David Stevens; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2141 bytes --]

Hi.


Include/exclude count of source filter also need check when type is MLD2_MODE_IS_INCLUDE or MLD2_MODE_IS_EXCLUDE.
If the check is ignored, MODE_IS_EXCLUDE report may include sources that have include count greater than zero.

You can check this bug by test.c and query.c in the attachments.

test.c create two socket and make both of them join multicast address M.
The first socket set it's filter mode to INCLUDE{X} and the second set it's filter mode to EXCLUDE{Y}.
Now the interface state for multicast address M should be EXCLUDE{Y}.


let's send a Multicast Address Specific Query by query.c. 
You will notice that both X and Y are included in the MODE_IS_EXCLUDE report's source address list.


I hope I provide enough information this time. :-)


Regards

Signed-off-by: Yan Zheng<yanzheng@21cn.com>

Index:net/ipv6/mcast.c
==============================================================
--- linux-2.6.14/net/ipv6/mcast.c	2005-11-09 16:00:48.000000000 +0800
+++ linux/net/ipv6/mcast.c	2005-11-09 18:44:37.000000000 +0800
@@ -1273,22 +1273,27 @@ static int is_in(struct ifmcaddr6 *pmc, 
 {
 	switch (type) {
 	case MLD2_MODE_IS_INCLUDE:
-	case MLD2_MODE_IS_EXCLUDE:
+	case MLD2_CHANGE_TO_INCLUDE: 
 		if (gdeleted || sdeleted)
 			return 0;
+		if (psf->sf_count[MCAST_INCLUDE] == 0)
+			return 0;    // maybe never happen
+		if (type == MLD2_CHANGE_TO_INCLUDE)
+			return 1;
 		return !((pmc->mca_flags & MAF_GSQUERY) && !psf->sf_gsresp);
-	case MLD2_CHANGE_TO_INCLUDE:
-		if (gdeleted || sdeleted)
-			return 0;
-		return psf->sf_count[MCAST_INCLUDE] != 0;
+	case MLD2_MODE_IS_EXCLUDE:
 	case MLD2_CHANGE_TO_EXCLUDE:
 		if (gdeleted || sdeleted)
 			return 0;
 		if (pmc->mca_sfcount[MCAST_EXCLUDE] == 0 ||
 		    psf->sf_count[MCAST_INCLUDE])
 			return 0;
-		return pmc->mca_sfcount[MCAST_EXCLUDE] ==
-			psf->sf_count[MCAST_EXCLUDE];
+		if (pmc->mca_sfcount[MCAST_EXCLUDE] !=
+			psf->sf_count[MCAST_EXCLUDE])
+			return 0;
+		if (type == MLD2_CHANGE_TO_EXCLUDE)
+			return 1;
+		return !((pmc->mca_flags & MAF_GSQUERY) && !psf->sf_gsresp);
 	case MLD2_ALLOW_NEW_SOURCES:
 		if (gdeleted || !psf->sf_crcount)
 			return 0;




[-- Attachment #2: test.c --]
[-- Type: text/x-csrc, Size: 1298 bytes --]

#include <stdio.h>
#include <unistd.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <sys/types.h>
#define IFINDEX 5  //Please adjust me first.

int main(int argc, char argv[])
{
	int sockfds[2];
	struct ipv6_mreq req;
	struct group_filter filter;
	struct sockaddr_in6 *psin6;
	req.ipv6mr_interface = IFINDEX;
	inet_pton(PF_INET6, "FF02::2000", &req.ipv6mr_multiaddr);

	sockfds[0] = socket(PF_INET6, SOCK_DGRAM, 0);
	sockfds[1] = socket(PF_INET6, SOCK_DGRAM, 0);

	filter.gf_interface = IFINDEX;
	filter.gf_fmode = MCAST_INCLUDE;
	filter.gf_numsrc = 1;
	psin6 = (struct sockaddr_in6 *)&filter.gf_group;
	psin6->sin6_family = AF_INET6;
	inet_pton(PF_INET6, "FF02::2000", &psin6->sin6_addr);
	psin6 = (struct sockaddr_in6 *)&filter.gf_slist[0];
	psin6->sin6_family = AF_INET6;
	inet_pton(PF_INET6, "2002:de12:1780::1", &psin6->sin6_addr);

	setsockopt(sockfds[0], SOL_IPV6, IPV6_ADD_MEMBERSHIP, &req, sizeof(req));
	setsockopt(sockfds[0], SOL_IPV6, MCAST_MSFILTER, &filter, sizeof(filter));

	filter.gf_fmode = MCAST_EXCLUDE;
	inet_pton(PF_INET6, "2002:de12:1780::2", &psin6->sin6_addr);
	setsockopt(sockfds[1], SOL_IPV6, IPV6_ADD_MEMBERSHIP, &req, sizeof(req));
	setsockopt(sockfds[1], SOL_IPV6, MCAST_MSFILTER, &filter, sizeof(filter));

	pause();
	return 0;
}



[-- Attachment #3: query.c --]
[-- Type: text/x-csrc, Size: 945 bytes --]

#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <sys/types.h>
#define IFINDEX 5 //Please adjust me first.

struct mld2_query {
	uint8_t   type;
	uint8_t   code;
	uint16_t  csum;
	uint16_t  mrc;
	uint16_t  resv1;
	struct in6_addr mca;
	uint8_t   qrv:3,
		  suppress:1,
		  resv2:4;
	uint8_t   qqic;
	uint16_t  nsrcs;
	struct in6_addr srcs[0];
};

int main(int argc ,char *argv[]) {
	
	int len, sockfd; 
	struct mld2_query query;
	struct sockaddr_in6 addr;

	memset(&addr, 0x00, sizeof(addr));
	addr.sin6_family = AF_INET6;
	addr.sin6_scope_id = IFINDEX;
	inet_pton(PF_INET6, "FF02::1", &addr.sin6_addr);
	memset(&query, 0x00, sizeof(query));
	query.type = 130;
	inet_pton(PF_INET6, "FF02::2000", &query.mca);

	sockfd = socket(PF_INET6, SOCK_RAW, IPPROTO_ICMPV6);
	sendto(sockfd, &query, sizeof(query), 0, 
			(struct sockaddr *)&addr, sizeof(addr));
}



^ permalink raw reply

* [PATCH 2/2][MCAST] Fix for add_grec(...)
From: Yan Zheng @ 2005-11-09 11:58 UTC (permalink / raw)
  To: netdev, David Stevens; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2457 bytes --]

Hi

When ifmcaddr6's mca_sources is not NULL, but none of the sources in the list can be included in report,
(For example: when filter mode is exclude and the only source in the list has include count greater than zero.)
add_grec(...) may returns without add any data to the sk_buff. So MLD2_CHANGE_TO_EXCLUDE or MLD2_MODE_IS_EXCLUDE
report may be eliminated.

You can check this bug by test1.c in attachments. You will notice that there is no MLD2_CHANGE_TO_EXCLUDE report.

Regards

Signed-off-by: Yan Zheng<yanzheng@21cn.com>

Index:net/ipv6/mcast.c
==============================================================
--- linux-2.6.14/net/ipv6/mcast.c	2005-11-09 16:00:48.000000000 +0800
+++ linux/net/ipv6/mcast.c	2005-11-09 19:47:50.000000000 +0800
@@ -1445,18 +1445,21 @@ static struct sk_buff *add_grec(struct s
 	struct mld2_report *pmr;
 	struct mld2_grec *pgr = NULL;
 	struct ip6_sf_list *psf, *psf_next, *psf_prev, **psf_list;
-	int scount, first, isquery, truncate;
+	int scount, first, isquery, ischange, truncate;
 
 	if (pmc->mca_flags & MAF_NOREPORT)
 		return skb;
 
 	isquery = type == MLD2_MODE_IS_INCLUDE ||
 		  type == MLD2_MODE_IS_EXCLUDE;
+	ischange = type == MLD2_CHANGE_TO_INCLUDE ||
+		   type == MLD2_CHANGE_TO_EXCLUDE; 
 	truncate = type == MLD2_MODE_IS_EXCLUDE ||
-		    type == MLD2_CHANGE_TO_EXCLUDE;
+		   type == MLD2_CHANGE_TO_EXCLUDE;
 
 	psf_list = sdeleted ? &pmc->mca_tomb : &pmc->mca_sources;
 
+#if 0
 	if (!*psf_list) {
 		if (type == MLD2_ALLOW_NEW_SOURCES ||
 		    type == MLD2_BLOCK_OLD_SOURCES)
@@ -1474,12 +1477,15 @@ static struct sk_buff *add_grec(struct s
 		}
 		return skb;
 	}
+#endif
 	pmr = skb ? (struct mld2_report *)skb->h.raw : NULL;
 
 	/* EX and TO_EX get a fresh packet, if needed */
-	if (truncate) {
-		if (pmr && pmr->ngrec &&
-		    AVAILABLE(skb) < grec_size(pmc, type, gdeleted, sdeleted)) {
+	if (truncate || ischange) {
+		int min_len;
+		min_len	= truncate ? grec_size(pmc, type, gdeleted, sdeleted) : 
+			  (sizeof(struct mld2_grec) + sizeof(struct in6_addr));
+		if (pmr && pmr->ngrec && AVAILABLE(skb) < min_len) {
 			if (skb)
 				mld_sendpack(skb);
 			skb = mld_newpack(dev, dev->mtu);
@@ -1488,6 +1494,10 @@ static struct sk_buff *add_grec(struct s
 	first = 1;
 	scount = 0;
 	psf_prev = NULL;
+	if (ischange || type == MLD2_MODE_IS_EXCLUDE) {
+		skb = add_grhead(skb, pmc, type, &pgr);
+		first = 0;
+	}
 	for (psf=*psf_list; psf; psf=psf_next) {
 		struct in6_addr *psrc;
 




[-- Attachment #2: test1.c --]
[-- Type: text/x-csrc, Size: 1203 bytes --]

#include <stdio.h>
#include <unistd.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <sys/types.h>
#define IFINDEX 5  //Please adjust me first.

int main(int argc, char argv[])
{
	int sockfds[2];
	struct ipv6_mreq req;
	struct group_filter filter;
	struct sockaddr_in6 *psin6;
	req.ipv6mr_interface = IFINDEX;
	inet_pton(PF_INET6, "FF02::2000", &req.ipv6mr_multiaddr);

	sockfds[0] = socket(PF_INET6, SOCK_DGRAM, 0);
	sockfds[1] = socket(PF_INET6, SOCK_DGRAM, 0);

	filter.gf_interface = IFINDEX;
	filter.gf_fmode = MCAST_INCLUDE;
	filter.gf_numsrc = 1;
	psin6 = (struct sockaddr_in6 *)&filter.gf_group;
	psin6->sin6_family = AF_INET6;
	inet_pton(PF_INET6, "FF02::2000", &psin6->sin6_addr);
	psin6 = (struct sockaddr_in6 *)&filter.gf_slist[0];
	psin6->sin6_family = AF_INET6;
	inet_pton(PF_INET6, "2002:de12:1780::1", &psin6->sin6_addr);

	setsockopt(sockfds[0], SOL_IPV6, IPV6_ADD_MEMBERSHIP, &req, sizeof(req));
	setsockopt(sockfds[0], SOL_IPV6, MCAST_MSFILTER, &filter, sizeof(filter));
	sleep(10); //wait state change reports
	printf("change mode to exclude\n");
	setsockopt(sockfds[1], SOL_IPV6, IPV6_ADD_MEMBERSHIP, &req, sizeof(req));

	pause();
	return 0;
}




^ permalink raw reply

* [PATCH][MCAST]Check packet size when process Multicast Address and Source Specific Query
From: Yan Zheng @ 2005-11-09 12:35 UTC (permalink / raw)
  To: netdev, David Stevens; +Cc: linux-kernel, davem



The patch changes the old one to equivalent code in IGMPv3 as David Stevens's suggestion
http://lkml.org/lkml/2005/10/31/221


Regards

Signed-off-by: Yan Zheng<yanzheng@21cn.com>

Index:net/ipv6/mcast.c
============================================================== 

--- linux-2.6.14/net/ipv6/mcast.c	2005-11-09 16:00:48.000000000 +0800
+++ linux/net/ipv6/mcast.c	2005-11-09 16:20:03.000000000 +0800
@@ -1149,6 +1149,14 @@ int igmp6_event_query(struct sk_buff *sk
 			return -EINVAL;
 		}
 		mlh2 = (struct mld2_query *) skb->h.raw;
+		if (mlh2->nsrcs != 0) {
+			if (!pskb_may_pull(skb, srcs_offset +
+				mlh2->nsrcs * sizeof(struct in6_addr))) {
+				in6_dev_put(idev);
+				return -EINVAL;
+			}
+			mlh2 = (struct mld2_query *) skb->h.raw;
+		}
 		max_delay = (MLDV2_MRC(ntohs(mlh2->mrc))*HZ)/1000;
 		if (!max_delay)
 			max_delay = 1;
@@ -1165,15 +1173,7 @@ int igmp6_event_query(struct sk_buff *sk
 			return 0;
 		}
 		/* mark sources to include, if group & source-specific */
-		if (mlh2->nsrcs != 0) {
-			if (!pskb_may_pull(skb, srcs_offset + 
-				mlh2->nsrcs * sizeof(struct in6_addr))) {
-				in6_dev_put(idev);
-				return -EINVAL;
-			}
-			mlh2 = (struct mld2_query *) skb->h.raw;
-			mark = 1;
-		}
+		mark = mlh2->nsrcs != 0;
 	} else {
 		in6_dev_put(idev);
 		return -EINVAL;

^ permalink raw reply

* [PATCH] gianfar mii needs to zero out the mii_bus structure
From: Kumar Gala @ 2005-11-09 18:13 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev, linuxppc-embedded

To ensure that phy_mask and any future elements of the mii_bus
structure are initialized use kzalloc() instead of kmalloc().

This fixes an issue in which phy_mask was not being initialized
and we would skip random phy addresses when scanning.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

---
commit 35003e02e33939b7359635f3cf7b424723ffd4b0
tree 386160e32c51e8f1e662811738e79571c7218fdb
parent d0876a2748ddc33ca9ed1ea26cf958726c50c7b9
author Kumar Gala <galak@kernel.crashing.org> Wed, 09 Nov 2005 12:11:40 -0600
committer Kumar Gala <galak@kernel.crashing.org> Wed, 09 Nov 2005 12:11:40 -0600

 drivers/net/gianfar_mii.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/gianfar_mii.c b/drivers/net/gianfar_mii.c
index 5a74d3d..ee1a77a 100644
--- a/drivers/net/gianfar_mii.c
+++ b/drivers/net/gianfar_mii.c
@@ -134,7 +134,7 @@ int gfar_mdio_probe(struct device *dev)
 	if (NULL == dev)
 		return -EINVAL;
 
-	new_bus = kmalloc(sizeof(struct mii_bus), GFP_KERNEL);
+	new_bus = kzalloc(sizeof(struct mii_bus), GFP_KERNEL);
 
 	if (NULL == new_bus)
 		return -ENOMEM;

^ permalink raw reply related

* [patch 05/11] tcp: BIC max increment too large
From: Greg KH @ 2005-11-09 18:36 UTC (permalink / raw)
  To: linux-kernel, stable, Arnaldo Carvalho de Melo, David S. Miller,
	netdev
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Chuck Wolber, torvalds, akpm, alan
In-Reply-To: <20051109183614.GA3670@kroah.com>

[-- Attachment #1: tcp-bic-max-increment-too-large.patch --]
[-- Type: text/plain, Size: 984 bytes --]

From: Stephen Hemminger <shemminger@osdl.org>

The max growth of BIC TCP is too large. Original code was based on
BIC 1.0 and the default there was 32. Later code (2.6.13) included
compensation for delayed acks, and should have reduced the default
value to 16; since normally TCP gets one ack for every two packets sent.

The current value of 32 makes BIC too aggressive and unfair to other
flows.

Submitted-by: Injong Rhee <rhee@eos.ncsu.edu>
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/ipv4/tcp_bic.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.14.1.orig/net/ipv4/tcp_bic.c
+++ linux-2.6.14.1/net/ipv4/tcp_bic.c
@@ -27,7 +27,7 @@
 					  */
 
 static int fast_convergence = 1;
-static int max_increment = 32;
+static int max_increment = 16;
 static int low_window = 14;
 static int beta = 819;		/* = 819/1024 (BICTCP_BETA_SCALE) */
 static int low_utilization_threshold = 153;

--

^ permalink raw reply

* [patch 06/11] airo.c/airo_cs.c: correct prototypes
From: Greg KH @ 2005-11-09 18:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Chuck Wolber, torvalds, akpm, alan, jgarzik, bunk, netdev,
	Benjamin Reed
In-Reply-To: <20051109183614.GA3670@kroah.com>

[-- Attachment #1: airo.c-airo_cs.c-correct-prototypes.patch --]
[-- Type: text/plain, Size: 2139 bytes --]

From: Adrian Bunk <bunk@stusta.de>

This patch creates a file airo.h containing prototypes of the global
functions in airo.c used by airo_cs.c .

If you got strange problems with either airo_cs devices or in any other
completely unrelated part of the kernel shortly or long after a airo_cs
device was detected by the kernel, this might have been caused by the
fact that caller and callee disagreed regarding the size of the first
argument to init_airo_card()...

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/net/wireless/airo.c    |    2 ++
 drivers/net/wireless/airo.h    |    9 +++++++++
 drivers/net/wireless/airo_cs.c |    6 ++----
 3 files changed, 13 insertions(+), 4 deletions(-)

--- /dev/null
+++ linux-2.6.14.1/drivers/net/wireless/airo.h
@@ -0,0 +1,9 @@
+#ifndef _AIRO_H_
+#define _AIRO_H_
+
+struct net_device *init_airo_card(unsigned short irq, int port, int is_pcmcia,
+				  struct device *dmdev);
+int reset_airo_card(struct net_device *dev);
+void stop_airo_card(struct net_device *dev, int freeres);
+
+#endif  /*  _AIRO_H_  */
--- linux-2.6.14.1.orig/drivers/net/wireless/airo.c
+++ linux-2.6.14.1/drivers/net/wireless/airo.c
@@ -46,6 +46,8 @@
 #include <linux/pci.h>
 #include <asm/uaccess.h>
 
+#include "airo.h"
+
 #ifdef CONFIG_PCI
 static struct pci_device_id card_ids[] = {
 	{ 0x14b9, 1, PCI_ANY_ID, PCI_ANY_ID, },
--- linux-2.6.14.1.orig/drivers/net/wireless/airo_cs.c
+++ linux-2.6.14.1/drivers/net/wireless/airo_cs.c
@@ -42,6 +42,8 @@
 #include <asm/io.h>
 #include <asm/system.h>
 
+#include "airo.h"
+
 /*
    All the PCMCIA modules use PCMCIA_DEBUG to control debugging.  If
    you do not define PCMCIA_DEBUG at all, all the debug code will be
@@ -78,10 +80,6 @@ MODULE_SUPPORTED_DEVICE("Aironet 4500, 4
    event handler. 
 */
 
-struct net_device *init_airo_card( int, int, int, struct device * );
-void stop_airo_card( struct net_device *, int );
-int reset_airo_card( struct net_device * );
-
 static void airo_config(dev_link_t *link);
 static void airo_release(dev_link_t *link);
 static int airo_event(event_t event, int priority,

--

^ permalink raw reply

* [patch 07/11] NET: Fix zero-size datagram reception
From: Greg KH @ 2005-11-09 18:37 UTC (permalink / raw)
  To: linux-kernel, stable, Arnaldo Carvalho de Melo, netdev
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Chuck Wolber, torvalds, akpm, alan, herbert, phillips
In-Reply-To: <20051109183614.GA3670@kroah.com>

[-- Attachment #1: fix-zero-size-datagram-reception.patch --]
[-- Type: text/plain, Size: 657 bytes --]

From: Herbert Xu <herbert@gondor.apana.org.au>

The recent rewrite of skb_copy_datagram_iovec broke the reception of
zero-size datagrams.  This patch fixes it.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/core/datagram.c |    4 ++++
 1 file changed, 4 insertions(+)

--- linux-2.6.14.1.orig/net/core/datagram.c
+++ linux-2.6.14.1/net/core/datagram.c
@@ -213,6 +213,10 @@ int skb_copy_datagram_iovec(const struct
 {
 	int i, err, fraglen, end = 0;
 	struct sk_buff *next = skb_shinfo(skb)->frag_list;
+
+	if (!len)
+		return 0;
+
 next_skb:
 	fraglen = skb_headlen(skb);
 	i = -1;

--

^ permalink raw reply

* Re: [PATCH] Fix fallout from CONFIG_IPV6_PRIVACY
From: David S. Miller @ 2005-11-09 21:05 UTC (permalink / raw)
  To: peterc; +Cc: netdev, linux-kernel
In-Reply-To: <17265.16378.77270.7493@berry.gelato.unsw.EDU.AU>

From: Peter Chubb <peterc@gelato.unsw.edu.au>
Date: Wed, 9 Nov 2005 11:16:58 +1100

> Trying to build today's 2.6.14+git snapshot gives undefined references
> to use_tempaddr
> 
> Looks like an ifdef got left out.
> 
> Signed-off-by: Peter Chubb <peterc@gelato.unsw.edu.au>

Applied, thanks Peter.

^ permalink raw reply

* Re: [patch 2.6.14 (take #2)] fec_8xx: make CONFIG_FEC_8XX depend on CONFIG_8xx
From: John W. Linville @ 2005-11-09 21:52 UTC (permalink / raw)
  To: Pantelis Antoniou, linuxppc-embedded, netdev, linux-kernel
In-Reply-To: <20051107182459.GD13797@tuxdriver.com>

On Mon, Nov 07, 2005 at 01:24:59PM -0500, John W. Linville wrote:
> Change CONFIG_FEC_8XX to depend on CONFIG_8xx instead of CONFIG_FEC.
> CONFIG_FEC depends on ColdFire CPUs, which does not apply for the
> PPC 8xx processors.

FWIW, I have this patch available on the linville-fec_8xx branch of
netdev-jwl as described below.

Thanks,

John

---

The following changes since commit 330d57fb98a916fa8e1363846540dd420e99499a:
  Al Viro:
        Fix sysctl unregistration oops (CVE-2005-2709)

are found in the git repository at:

  git://git.tuxdriver.com/git/netdev-jwl.git linville-fec_8xx

John W. Linville:
      fec_8xx: make CONFIG_FEC_8XX depend on CONFIG_8xx

 drivers/net/fec_8xx/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/fec_8xx/Kconfig b/drivers/net/fec_8xx/Kconfig
index 94e7a9a..a84c232 100644
--- a/drivers/net/fec_8xx/Kconfig
+++ b/drivers/net/fec_8xx/Kconfig
@@ -1,6 +1,6 @@
 config FEC_8XX
 	tristate "Motorola 8xx FEC driver"
-	depends on NET_ETHERNET && FEC
+	depends on NET_ETHERNET && 8xx
 	select MII
 
 config FEC_8XX_GENERIC_PHY
-- 
John W. Linville
linville@tuxdriver.com

^ permalink raw reply related

* Re: [PATCH 2/2][MCAST] Fix for add_grec(...)
From: David Stevens @ 2005-11-09 22:06 UTC (permalink / raw)
  To: Yan Zheng; +Cc: linux-kernel, netdev
In-Reply-To: <4371E45C.3020500@21cn.com>

Yan,
        I think your patch has some problems.

Yan Zheng <yanzheng@21cn.com> wrote on 11/09/2005 03:58:20 AM:

> +#if 0
>     if (!*psf_list) {
>        if (type == MLD2_ALLOW_NEW_SOURCES ||
>            type == MLD2_BLOCK_OLD_SOURCES)
> @@ -1474,12 +1477,15 @@ static struct sk_buff *add_grec(struct s
>        }
>        return skb;
>     }
> +#endif


        This code is the only place in the current code where you
can generate a group header with an empty source list (what it is
checking for). Your patch has added an add_grhead() for change
and EXCLUDE records, but it isn't checking mca_crcount or isquery.
I need to check, but I'm concerned this will create a group header
in a report for cases where it should not.


>     pmr = skb ? (struct mld2_report *)skb->h.raw : NULL;
> 
>     /* EX and TO_EX get a fresh packet, if needed */
> -   if (truncate) {
> -      if (pmr && pmr->ngrec &&
> -          AVAILABLE(skb) < grec_size(pmc, type, gdeleted, sdeleted)) {
> +   if (truncate || ischange) {
> +      int min_len;
> +      min_len   = truncate ? grec_size(pmc, type, gdeleted, sdeleted) : 

> +           (sizeof(struct mld2_grec) + sizeof(struct in6_addr));
> +      if (pmr && pmr->ngrec && AVAILABLE(skb) < min_len) {
>           if (skb)
>              mld_sendpack(skb);
>           skb = mld_newpack(dev, dev->mtu);

        This "truncate" code is to handle exclude records that may be
truncated. It gets a new packet when adding this record and the whole
thing won't fit in a single packet. This is not appropriate for anything
but IS_EX and TO_EX, but "ischange" in your patch will be true for
TO_IN. So, I think this will waste space in a report that could hold
some of these TO_IN sources.

        I haven't run your test code, or tested with your patch yet,
just observing the differences from the original code path and your
patch (and they appear to be more than you intended).

                                                        +-DLS

^ permalink raw reply

* RED qdisc not working...
From: Daniel J Blueman @ 2005-11-09 23:32 UTC (permalink / raw)
  To: netdev, netfilter-devel, netfilter, kaber; +Cc: davem, laforge, coreteam
In-Reply-To: <6278d2220511071626j3646afa7n5ac33228e8b3fc82@mail.gmail.com>

Has anyone been able to get the RED (random early detection) qdisc
working lately?

I can't get anything going through it to be dropped or marked; the
'marked', 'early', 'pdrop' and 'other' fields remain at 0 [1]. In my
example script [2], I get the 3072Kbits/s transfer into eth0, which
you'd only expect if the RED qdisc wasn't there.

I have tried with a recent 2.6.12 debian kernel and stock 2.6.14 on
x86_64 debian. I rebuilt new iproute and iptables packages from latest
clean upstream sources, but to no avail.

Any ideas? Please CC me on replies, as I am not subscribed.

Thanks,
  Dan

--- [1]

# tc -s qdisc show dev eth0
qdisc htb 1: r2q 10 default 10 direct_packets_stat 0
 Sent 53985530 bytes 36757 pkts (dropped 0, overlimits 45125)
qdisc red 10: parent 1:10 limit 512Kb min 64Kb max 128Kb
 Sent 53985530 bytes 36757 pkts (dropped 0, overlimits 0)
  marked 0 early 0 pdrop 0 other 0

--- [2]

tc qdisc del dev eth0 root

tc qdisc add dev eth0 root handle 1: htb default 10
tc class add dev eth0 parent 1: classid 1:1 htb rate 4096kbit ceil 4096kbit
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 3072kbit ceil 3072kbit
tc qdisc add dev eth0 parent 1:10 handle 10: red \
  limit 4096kbit min 512kbit max 1024kbit avpkt 1000 \
  burst 100 probability 0.02 bandwidth 1024kbit
___
Daniel J Blueman

^ permalink raw reply

* Re: RED qdisc not working...
From: Jamal Hadi Salim @ 2005-11-10  0:03 UTC (permalink / raw)
  To: Daniel J Blueman
  Cc: netdev, netfilter-devel, netfilter, kaber, davem, laforge,
	coreteam
In-Reply-To: <6278d2220511091532k7b732b9bv2957763ba6f4c10f@mail.gmail.com>

howdy,
When you say it is "broken" - what is this relative to?
Did you have another kernel where you precise config worked?

The only changes that have made it in for RED are in post 2.6.14; other
than that all should work great as ever before.

suggestions:

could you try the latest iproute2 posted last few days by Stephen and
see if your problem persists?

Also try using something simpler than HTB like prio qdisc to help in
debugging things for you?
Can you look at examples directory and use some of the tricks used
there?

cheers,
jamal

On Wed, 2005-09-11 at 23:32 +0000, Daniel J Blueman wrote:
> Has anyone been able to get the RED (random early detection) qdisc
> working lately?
> 
> I can't get anything going through it to be dropped or marked; the
> 'marked', 'early', 'pdrop' and 'other' fields remain at 0 [1]. In my
> example script [2], I get the 3072Kbits/s transfer into eth0, which
> you'd only expect if the RED qdisc wasn't there.
> 
> I have tried with a recent 2.6.12 debian kernel and stock 2.6.14 on
> x86_64 debian. I rebuilt new iproute and iptables packages from latest
> clean upstream sources, but to no avail.
> 
> Any ideas? Please CC me on replies, as I am not subscribed.
> 
> Thanks,
>   Dan
> 
> --- [1]
> 
> # tc -s qdisc show dev eth0
> qdisc htb 1: r2q 10 default 10 direct_packets_stat 0
>  Sent 53985530 bytes 36757 pkts (dropped 0, overlimits 45125)
> qdisc red 10: parent 1:10 limit 512Kb min 64Kb max 128Kb
>  Sent 53985530 bytes 36757 pkts (dropped 0, overlimits 0)
>   marked 0 early 0 pdrop 0 other 0
> 
> --- [2]
> 
> tc qdisc del dev eth0 root
> 
> tc qdisc add dev eth0 root handle 1: htb default 10
> tc class add dev eth0 parent 1: classid 1:1 htb rate 4096kbit ceil 4096kbit
> tc class add dev eth0 parent 1:1 classid 1:10 htb rate 3072kbit ceil 3072kbit
> tc qdisc add dev eth0 parent 1:10 handle 10: red \
>   limit 4096kbit min 512kbit max 1024kbit avpkt 1000 \
>   burst 100 probability 0.02 bandwidth 1024kbit
> ___
> Daniel J Blueman
> 
> 
> 

^ permalink raw reply

* Re: [PATCH 2/2][MCAST] Fix for add_grec(...)
From: Yan Zheng @ 2005-11-10  1:20 UTC (permalink / raw)
  To: David Stevens; +Cc: linux-kernel, netdev
In-Reply-To: <OFD5769042.0E81A890-ON882570B4.0075A92B-882570B4.00796FDC@us.ibm.com>

David Stevens wrote:
> Yan,
>         I think your patch has some problems.
> 
> Yan Zheng <yanzheng@21cn.com> wrote on 11/09/2005 03:58:20 AM:
> 
> 
>>+#if 0
>>    if (!*psf_list) {
>>       if (type == MLD2_ALLOW_NEW_SOURCES ||
>>           type == MLD2_BLOCK_OLD_SOURCES)
>>@@ -1474,12 +1477,15 @@ static struct sk_buff *add_grec(struct s
>>       }
>>       return skb;
>>    }
>>+#endif
> 
> 
> 
>         This code is the only place in the current code where you
> can generate a group header with an empty source list (what it is
> checking for). Your patch has added an add_grhead() for change
> and EXCLUDE records, but it isn't checking mca_crcount or isquery.
> I need to check, but I'm concerned this will create a group header
> in a report for cases where it should not.
> 
ischange implicits mca_crcount has already been ckecked in mld_send_cr(...)
Actually, check mca_crcount directly will get mode change report sent one times less 
than you intend, because mca_crcount has decreased by one before call add_grec(...).


Now We only have MLD2_MODE_IS_INCLUDE left. but "mode is include and source list is empty"
is an impossible event.
> 
> 
>>    pmr = skb ? (struct mld2_report *)skb->h.raw : NULL;
>>
>>    /* EX and TO_EX get a fresh packet, if needed */
>>-   if (truncate) {
>>-      if (pmr && pmr->ngrec &&
>>-          AVAILABLE(skb) < grec_size(pmc, type, gdeleted, sdeleted)) {
>>+   if (truncate || ischange) {
>>+      int min_len;
>>+      min_len   = truncate ? grec_size(pmc, type, gdeleted, sdeleted) : 
> 
> 
>>+           (sizeof(struct mld2_grec) + sizeof(struct in6_addr));
>>+      if (pmr && pmr->ngrec && AVAILABLE(skb) < min_len) {
>>          if (skb)
>>             mld_sendpack(skb);
>>          skb = mld_newpack(dev, dev->mtu);
> 
> 
>         This "truncate" code is to handle exclude records that may be
> truncated. It gets a new packet when adding this record and the whole
> thing won't fit in a single packet. This is not appropriate for anything
> but IS_EX and TO_EX, but "ischange" in your patch will be true for
> TO_IN. So, I think this will waste space in a report that could hold
> some of these TO_IN sources.

When type is MLD2_MODE_IS_INCLUDE, min_len is equal to "sizeof(struct mld2_grec) + 
sizeof(struct in6_addr)". it satisfies the comment above. (make sure we have room 
for group header and at least one source.)

^ permalink raw reply

* does routing performance degrade from 2.4.20 to 2.4.31 ?
From: Mayuresh Chitale @ 2005-11-10 10:12 UTC (permalink / raw)
  To: netdev, netfilter

Hi All,

We are working on kernel version 2.4.20 and are trying to migrate to
version 2.4.31. We are doing some performance related tests to see the
impact of migration. The routing throughput seems to degrade from
2.4.20 to 2.4.31.
We have a Malta board with mips 4kc processor and are using iperf tool
to do the testing. Two test PCs are connected to the malta and iperf
server is run on PC and the client on another PC. With netfilter
compiled into the kernel, version 2.4.20 shows better result than
2.4.31. No rules except the default (all accept) have been applied.
Without netfilter, both perform almost identical. Is this expected ??
The dump below shows the measurements. If anyone has done similar
tests before, please share with me their results.

Have a nice day.
Mayuresh.

2.4.31
=====
[mayuresh@localhost ~]$ ./iperf -c 100.0.0.1 -P 2
------------------------------------------------------------
Client connecting to 100.0.0.1, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  4] local 10.1.1.99 port 33702 connected with 100.0.0.1 port 5001
[  3] local 10.1.1.99 port 33701 connected with 100.0.0.1 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  16.9 MBytes  14.2 Mbits/sec
[  4]  0.0-10.0 sec  17.0 MBytes  14.2 Mbits/sec
[SUM]  0.0-10.0 sec  33.9 MBytes  28.3 Mbits/sec

2.4.20
=====
[mayuresh@localhost ~]$ ./iperf -c 100.0.0.1 -P 2
------------------------------------------------------------
Client connecting to 100.0.0.1, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  4] local 10.1.1.99 port 33705 connected with 100.0.0.1 port 5001
[  3] local 10.1.1.99 port 33704 connected with 100.0.0.1 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  20.2 MBytes  16.9 Mbits/sec
[  4]  0.0-10.0 sec  20.2 MBytes  16.9 Mbits/sec
[SUM]  0.0-10.0 sec  40.4 MBytes  33.8 Mbits/sec

^ permalink raw reply

* [patch 1/7] s390: synthax checking for VIPA addresses fixed
From: Frank Pavlic @ 2005-11-10 12:49 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev, linux-kernel

[patch 1/7] s390: synthax checking for VIPA addresses fixed

From: Peter Tiedemann <ptiedem@de.ibm.com>
	- synthax checking for VIPA addresses fixed

Signed-off-by: Frank Pavlic <fpavlic@de.ibm.com>

diffstat:
 qeth.h     |   65 ++++++++++++++++++++++++++++++++++++++++++++++++-------------
 qeth_sys.c |    6 ++---
 2 files changed, 55 insertions(+), 16 deletions(-)


diff -Naupr orig/drivers/s390/net/qeth.h patched-linux/drivers/s390/net/qeth.h
--- orig/drivers/s390/net/qeth.h	2005-11-09 20:06:57.000000000 +0100
+++ patched-linux/drivers/s390/net/qeth.h	2005-11-09 20:11:20.000000000 +0100
@@ -8,6 +8,7 @@
 #include <linux/trdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/if_vlan.h>
+#include <linux/ctype.h>
 
 #include <net/ipv6.h>
 #include <linux/in6.h>
@@ -24,7 +25,7 @@
 
 #include "qeth_mpc.h"
 
-#define VERSION_QETH_H 		"$Revision: 1.142 $"
+#define VERSION_QETH_H 		"$Revision: 1.151 $"
 
 #ifdef CONFIG_QETH_IPV6
 #define QETH_VERSION_IPV6 	":IPv6"
@@ -1074,6 +1075,26 @@ qeth_get_qdio_q_format(struct qeth_card 
 	}
 }
 
+static inline int
+qeth_isdigit(char * buf)
+{
+	while (*buf) {
+		if (!isdigit(*buf++))
+			return 0;
+	}
+	return 1;
+}
+
+static inline int
+qeth_isxdigit(char * buf)
+{
+	while (*buf) {
+		if (!isxdigit(*buf++))
+			return 0;
+	}
+	return 1;
+}
+
 static inline void
 qeth_ipaddr4_to_string(const __u8 *addr, char *buf)
 {
@@ -1090,18 +1111,27 @@ qeth_string_to_ipaddr4(const char *buf, 
 	int i;
 
 	start = buf;
-	for (i = 0; i < 3; i++) {
-		if (!(end = strchr(start, '.')))
+	for (i = 0; i < 4; i++) {
+		if (i == 3) {
+			end = strchr(start,0xa);
+			if (end)
+				len = end - start;
+			else		
+				len = strlen(start);
+		}
+		else {
+			end = strchr(start, '.');
+			len = end - start;
+		}
+		if ((len <= 0) || (len > 3))
 			return -EINVAL;
-		len = end - start;
 		memset(abuf, 0, 4);
 		strncpy(abuf, start, len);
+		if (!qeth_isdigit(abuf))
+			return -EINVAL;
 		addr[i] = simple_strtoul(abuf, &tmp, 10);
 		start = end + 1;
 	}
-	memset(abuf, 0, 4);
-	strcpy(abuf, start);
-	addr[3] = simple_strtoul(abuf, &tmp, 10);
 	return 0;
 }
 
@@ -1128,18 +1158,27 @@ qeth_string_to_ipaddr6(const char *buf, 
 
 	tmp_addr = (u16 *)addr;
 	start = buf;
-	for (i = 0; i < 7; i++) {
-		if (!(end = strchr(start, ':')))
+	for (i = 0; i < 8; i++) {
+		if (i == 7) {
+			end = strchr(start,0xa);
+			if (end)
+				len = end - start;
+			else
+				len = strlen(start);
+		}
+		else {
+			end = strchr(start, ':');
+			len = end - start;
+		}
+		if ((len <= 0) || (len > 4))
 			return -EINVAL;
-		len = end - start;
 		memset(abuf, 0, 5);
 		strncpy(abuf, start, len);
+		if (!qeth_isxdigit(abuf))
+			return -EINVAL;
 		tmp_addr[i] = simple_strtoul(abuf, &tmp, 16);
 		start = end + 1;
 	}
-	memset(abuf, 0, 5);
-	strcpy(abuf, start);
-	tmp_addr[7] = simple_strtoul(abuf, &tmp, 16);
 	return 0;
 }
 
diff -Naupr orig/drivers/s390/net/qeth_sys.c patched-linux/drivers/s390/net/qeth_sys.c
--- orig/drivers/s390/net/qeth_sys.c	2005-11-09 20:06:57.000000000 +0100
+++ patched-linux/drivers/s390/net/qeth_sys.c	2005-11-09 20:11:59.000000000 +0100
@@ -1,6 +1,6 @@
 /*
  *
- * linux/drivers/s390/net/qeth_sys.c ($Revision: 1.55 $)
+ * linux/drivers/s390/net/qeth_sys.c ($Revision: 1.58 $)
  *
  * Linux on zSeries OSA Express and HiperSockets support
  * This file contains code related to sysfs.
@@ -20,7 +20,7 @@
 #include "qeth_mpc.h"
 #include "qeth_fs.h"
 
-const char *VERSION_QETH_SYS_C = "$Revision: 1.55 $";
+const char *VERSION_QETH_SYS_C = "$Revision: 1.58 $";
 
 /*****************************************************************************/
 /*                                                                           */
@@ -1117,7 +1117,7 @@ qeth_parse_ipatoe(const char* buf, enum 
 	start = buf;
 	/* get address string */
 	end = strchr(start, '/');
-	if (!end){
+	if (!end || (end-start >= 49)){
 		PRINT_WARN("Invalid format for ipato_addx/delx. "
 			   "Use <ip addr>/<mask bits>\n");
 		return -EINVAL;

^ permalink raw reply

* [patch 2/7] s390: minor modification in qeth layer2 code
From: Frank Pavlic @ 2005-11-10 12:49 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev, linux-kernel

[patch 2/7] s390: minor modification in qeth layer2 code

From: Frank Pavlic <fpavlic@de.ibm.com>
	- use qeth_layer2_send_setdelvlan_cb to check
	  return code of a SET/DELVLAN IP Assist command.
	  It fits better in qeth's design and mechanism of IP Assist
	  command handling.
	  
Signed-off-by: Frank Pavlic <fpavlic@de.ibm.com>

diffstat:
 qeth_main.c |   40 ++++++++++++++++++++++++++--------------
 1 files changed, 26 insertions(+), 14 deletions(-)

diff -Naupr orig/drivers/s390/net/qeth_main.c patched-linux/drivers/s390/net/qeth_main.c
--- orig/drivers/s390/net/qeth_main.c	2005-11-09 20:06:57.000000000 +0100
+++ patched-linux/drivers/s390/net/qeth_main.c	2005-11-09 20:20:06.000000000 +0100
@@ -1,6 +1,6 @@
 /*
  *
- * linux/drivers/s390/net/qeth_main.c ($Revision: 1.224 $)
+ * linux/drivers/s390/net/qeth_main.c ($Revision: 1.235 $)
  *
  * Linux on zSeries OSA Express and HiperSockets support
  *
@@ -12,7 +12,7 @@
  *			  Frank Pavlic (pavlic@de.ibm.com) and
  *		 	  Thomas Spatzier <tspat@de.ibm.com>
  *
- *    $Revision: 1.224 $	 $Date: 2005/05/04 20:19:18 $
+ *    $Revision: 1.235 $	 $Date: 2005/05/04 20:19:18 $
  *
  * 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
@@ -72,7 +72,7 @@
 #include "qeth_eddp.h"
 #include "qeth_tso.h"
 
-#define VERSION_QETH_C "$Revision: 1.224 $"
+#define VERSION_QETH_C "$Revision: 1.235 $"
 static const char *version = "qeth S/390 OSA-Express driver";
 
 /**
@@ -5350,11 +5350,30 @@ qeth_free_vlan_addresses6(struct qeth_ca
 #endif /* CONFIG_QETH_IPV6 */
 }
 
-static void
+static int
+qeth_layer2_send_setdelvlan_cb(struct qeth_card *card,
+                               struct qeth_reply *reply,
+                               unsigned long data)
+{
+        struct qeth_ipa_cmd *cmd;
+
+        QETH_DBF_TEXT(trace, 2, "L2sdvcb");
+        cmd = (struct qeth_ipa_cmd *) data;
+        if (cmd->hdr.return_code) {
+		PRINT_ERR("Error in processing VLAN %i on %s: 0x%x. "
+			  "Continuing\n",cmd->data.setdelvlan.vlan_id, 
+			  QETH_CARD_IFNAME(card), cmd->hdr.return_code);
+		QETH_DBF_TEXT_(trace, 2, "L2VL%4x", cmd->hdr.command);
+		QETH_DBF_TEXT_(trace, 2, "L2%s", CARD_BUS_ID(card));
+		QETH_DBF_TEXT_(trace, 2, "err%d", cmd->hdr.return_code);
+	}
+        return 0;
+}
+
+static int
 qeth_layer2_send_setdelvlan(struct qeth_card *card, __u16 i,
 			    enum qeth_ipa_cmds ipacmd)
 {
- 	int rc;
 	struct qeth_ipa_cmd *cmd;
 	struct qeth_cmd_buffer *iob;
 
@@ -5362,15 +5381,8 @@ qeth_layer2_send_setdelvlan(struct qeth_
 	iob = qeth_get_ipacmd_buffer(card, ipacmd, QETH_PROT_IPV4);
 	cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
         cmd->data.setdelvlan.vlan_id = i;
-
-	rc = qeth_send_ipa_cmd(card, iob, NULL, NULL);
-        if (rc) {
-                PRINT_ERR("Error in processing VLAN %i on %s: 0x%x. "
-			  "Continuing\n",i, QETH_CARD_IFNAME(card), rc);
-		QETH_DBF_TEXT_(trace, 2, "L2VL%4x", ipacmd);
-		QETH_DBF_TEXT_(trace, 2, "L2%s", CARD_BUS_ID(card));
-		QETH_DBF_TEXT_(trace, 2, "err%d", rc);
-        }
+	return qeth_send_ipa_cmd(card, iob, 
+				 qeth_layer2_send_setdelvlan_cb, NULL);
 }
 
 static void

^ permalink raw reply

* [patch 3/7] s390: qeth multicast address registration fixed
From: Frank Pavlic @ 2005-11-10 12:49 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev, linux-kernel

[patch 3/7] s390: qeth multicast address registration fixed  

From: Klaus Dieter Wacker <kdwacker@de.ibm.com>
	- when running in Layer2 mode we don't have to register
	  the multicast IP address but only group mac address.
	  Therefore for Layer 2 devices it is enough to go
	  through dev->mc_list list and register these entries.
	
Signed-off-by: Frank Pavlic <fpavlic@de.ibm.com>

diffstat:
 qeth_main.c |  106 +++++++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 80 insertions(+), 26 deletions(-)

diff -Naupr orig/drivers/s390/net/qeth_main.c patched-linux/drivers/s390/net/qeth_main.c
--- orig/drivers/s390/net/qeth_main.c	2005-11-09 20:27:37.000000000 +0100
+++ patched-linux/drivers/s390/net/qeth_main.c	2005-11-09 20:30:44.000000000 +0100
@@ -1,6 +1,6 @@
 /*
  *
- * linux/drivers/s390/net/qeth_main.c ($Revision: 1.235 $)
+ * linux/drivers/s390/net/qeth_main.c ($Revision: 1.236 $)
  *
  * Linux on zSeries OSA Express and HiperSockets support
  *
@@ -12,7 +12,7 @@
  *			  Frank Pavlic (pavlic@de.ibm.com) and
  *		 	  Thomas Spatzier <tspat@de.ibm.com>
  *
- *    $Revision: 1.235 $	 $Date: 2005/05/04 20:19:18 $
+ *    $Revision: 1.236 $	 $Date: 2005/05/04 20:19:18 $
  *
  * 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
@@ -72,7 +72,7 @@
 #include "qeth_eddp.h"
 #include "qeth_tso.h"
 
-#define VERSION_QETH_C "$Revision: 1.235 $"
+#define VERSION_QETH_C "$Revision: 1.236 $"
 static const char *version = "qeth S/390 OSA-Express driver";
 
 /**
@@ -602,11 +602,20 @@ __qeth_ref_ip_on_card(struct qeth_card *
 	int found = 0;
 
 	list_for_each_entry(addr, &card->ip_list, entry) {
+		if (card->options.layer2) {
+			if ((addr->type == todo->type) &&
+			    (memcmp(&addr->mac, &todo->mac, 
+				    OSA_ADDR_LEN) == 0)) {
+				found = 1;
+				break;
+			}
+			continue;
+		} 
 		if ((addr->proto     == QETH_PROT_IPV4)  &&
 		    (todo->proto     == QETH_PROT_IPV4)  &&
 		    (addr->type      == todo->type)      &&
 		    (addr->u.a4.addr == todo->u.a4.addr) &&
-		    (addr->u.a4.mask == todo->u.a4.mask)   ){
+		    (addr->u.a4.mask == todo->u.a4.mask)) {
 			found = 1;
 			break;
 		}
@@ -615,12 +624,12 @@ __qeth_ref_ip_on_card(struct qeth_card *
 		    (addr->type        == todo->type)         &&
 		    (addr->u.a6.pfxlen == todo->u.a6.pfxlen)  &&
 		    (memcmp(&addr->u.a6.addr, &todo->u.a6.addr,
-			    sizeof(struct in6_addr)) == 0))     {
+			    sizeof(struct in6_addr)) == 0)) {
 			found = 1;
 			break;
 		}
 	}
-	if (found){
+	if (found) {
 		addr->users += todo->users;
 		if (addr->users <= 0){
 			*__addr = addr;
@@ -632,7 +641,7 @@ __qeth_ref_ip_on_card(struct qeth_card *
 			return 0;
 		}
 	}
-	if (todo->users > 0){
+	if (todo->users > 0) {
 		/* for VIPA and RXIP limit refcount to 1 */
 		if (todo->type != QETH_IP_TYPE_NORMAL)
 			todo->users = 1;
@@ -682,12 +691,22 @@ __qeth_insert_ip_todo(struct qeth_card *
 		if ((addr->type == QETH_IP_TYPE_DEL_ALL_MC) &&
 		    (tmp->type == QETH_IP_TYPE_DEL_ALL_MC))
 			return 0;
+		if (card->options.layer2) {
+			if ((tmp->type	== addr->type)	&&
+			    (tmp->is_multicast == addr->is_multicast) &&
+			    (memcmp(&tmp->mac, &addr->mac, 
+				    OSA_ADDR_LEN) == 0)) {
+				found = 1;
+				break;
+			}
+			continue;
+		} 	 
 		if ((tmp->proto        == QETH_PROT_IPV4)     &&
 		    (addr->proto       == QETH_PROT_IPV4)     &&
 		    (tmp->type         == addr->type)         &&
 		    (tmp->is_multicast == addr->is_multicast) &&
 		    (tmp->u.a4.addr    == addr->u.a4.addr)    &&
-		    (tmp->u.a4.mask    == addr->u.a4.mask)      ){
+		    (tmp->u.a4.mask    == addr->u.a4.mask)) {
 			found = 1;
 			break;
 		}
@@ -697,7 +716,7 @@ __qeth_insert_ip_todo(struct qeth_card *
 		    (tmp->is_multicast == addr->is_multicast)  &&
 		    (tmp->u.a6.pfxlen  == addr->u.a6.pfxlen)   &&
 		    (memcmp(&tmp->u.a6.addr, &addr->u.a6.addr,
-			    sizeof(struct in6_addr)) == 0)        ){
+			    sizeof(struct in6_addr)) == 0)) {
 			found = 1;
 			break;
 		}
@@ -707,7 +726,7 @@ __qeth_insert_ip_todo(struct qeth_card *
 			tmp->users += addr->users;
 		else
 			tmp->users += add? 1:-1;
-		if (tmp->users == 0){
+		if (tmp->users == 0) {
 			list_del(&tmp->entry);
 			kfree(tmp);
 		}
@@ -738,12 +757,15 @@ qeth_delete_ip(struct qeth_card *card, s
 	unsigned long flags;
 	int rc = 0;
 
-	QETH_DBF_TEXT(trace,4,"delip");
-	if (addr->proto == QETH_PROT_IPV4)
-		QETH_DBF_HEX(trace,4,&addr->u.a4.addr,4);
+	QETH_DBF_TEXT(trace, 4, "delip");
+
+	if (card->options.layer2)
+		QETH_DBF_HEX(trace, 4, &addr->mac, 6);
+	else if (addr->proto == QETH_PROT_IPV4)
+		QETH_DBF_HEX(trace, 4, &addr->u.a4.addr, 4);
 	else {
-		QETH_DBF_HEX(trace,4,&addr->u.a6.addr,8);
-		QETH_DBF_HEX(trace,4,((char *)&addr->u.a6.addr)+8,8);
+		QETH_DBF_HEX(trace, 4, &addr->u.a6.addr, 8);
+		QETH_DBF_HEX(trace, 4, ((char *)&addr->u.a6.addr) + 8, 8);
 	}
 	spin_lock_irqsave(&card->ip_lock, flags);
 	rc = __qeth_insert_ip_todo(card, addr, 0);
@@ -757,12 +779,14 @@ qeth_add_ip(struct qeth_card *card, stru
 	unsigned long flags;
 	int rc = 0;
 
-	QETH_DBF_TEXT(trace,4,"addip");
-	if (addr->proto == QETH_PROT_IPV4)
-		QETH_DBF_HEX(trace,4,&addr->u.a4.addr,4);
+	QETH_DBF_TEXT(trace, 4, "addip");
+	if (card->options.layer2)
+		QETH_DBF_HEX(trace, 4, &addr->mac, 6);
+	else if (addr->proto == QETH_PROT_IPV4)
+		QETH_DBF_HEX(trace, 4, &addr->u.a4.addr, 4);
 	else {
-		QETH_DBF_HEX(trace,4,&addr->u.a6.addr,8);
-		QETH_DBF_HEX(trace,4,((char *)&addr->u.a6.addr)+8,8);
+		QETH_DBF_HEX(trace, 4, &addr->u.a6.addr, 8);
+		QETH_DBF_HEX(trace, 4, ((char *)&addr->u.a6.addr) + 8, 8);
 	}
 	spin_lock_irqsave(&card->ip_lock, flags);
 	rc = __qeth_insert_ip_todo(card, addr, 1);
@@ -851,6 +875,7 @@ qeth_set_ip_addr_list(struct qeth_card *
 
 static void qeth_delete_mc_addresses(struct qeth_card *);
 static void qeth_add_multicast_ipv4(struct qeth_card *);
+static void qeth_layer2_add_multicast(struct qeth_card *);
 #ifdef CONFIG_QETH_IPV6
 static void qeth_add_multicast_ipv6(struct qeth_card *);
 #endif
@@ -5301,8 +5326,7 @@ qeth_free_vlan_addresses4(struct qeth_ca
 	struct qeth_ipaddr *addr;
 
 	QETH_DBF_TEXT(trace, 4, "frvaddr4");
-	if (!card->vlangrp)
-		return;
+
 	rcu_read_lock();
 	in_dev = __in_dev_get_rcu(card->vlangrp->vlan_devices[vid]);
 	if (!in_dev)
@@ -5330,8 +5354,7 @@ qeth_free_vlan_addresses6(struct qeth_ca
 	struct qeth_ipaddr *addr;
 
 	QETH_DBF_TEXT(trace, 4, "frvaddr6");
-	if (!card->vlangrp)
-		return;
+
 	in6_dev = in6_dev_get(card->vlangrp->vlan_devices[vid]);
 	if (!in6_dev)
 		return;
@@ -5350,6 +5373,15 @@ qeth_free_vlan_addresses6(struct qeth_ca
 #endif /* CONFIG_QETH_IPV6 */
 }
 
+static void
+qeth_free_vlan_addresses(struct qeth_card *card, unsigned short vid)
+{
+	if (card->options.layer2 || !card->vlangrp)
+		return;
+	qeth_free_vlan_addresses4(card, vid);
+	qeth_free_vlan_addresses6(card, vid);
+}
+
 static int
 qeth_layer2_send_setdelvlan_cb(struct qeth_card *card,
                                struct qeth_reply *reply,
@@ -5432,8 +5464,7 @@ qeth_vlan_rx_kill_vid(struct net_device 
 	qeth_free_vlan_skbs(card, vid);
 	spin_lock_irqsave(&card->vlanlock, flags);
 	/* unregister IP addresses of vlan device */
-	qeth_free_vlan_addresses4(card, vid);
-	qeth_free_vlan_addresses6(card, vid);
+	qeth_free_vlan_addresses(card, vid);
 	if (card->vlangrp)
 		card->vlangrp->vlan_devices[vid] = NULL;
 	spin_unlock_irqrestore(&card->vlanlock, flags);
@@ -5456,10 +5487,15 @@ qeth_set_multicast_list(struct net_devic
 	 
 	QETH_DBF_TEXT(trace,3,"setmulti");
 	qeth_delete_mc_addresses(card);
+	if (card->options.layer2) {
+		qeth_layer2_add_multicast(card);
+		goto out;
+	}
 	qeth_add_multicast_ipv4(card);
 #ifdef CONFIG_QETH_IPV6
 	qeth_add_multicast_ipv6(card);
 #endif
+out:
  	if (qeth_set_thread_start_bit(card, QETH_SET_IP_THREAD) == 0)
 		schedule_work(&card->kernel_thread_starter);
 }
@@ -5669,6 +5705,24 @@ qeth_add_multicast_ipv4(struct qeth_card
 	in_dev_put(in4_dev);
 }
 
+static void
+qeth_layer2_add_multicast(struct qeth_card *card)
+{
+	struct qeth_ipaddr *ipm;
+	struct dev_mc_list *dm;
+
+	QETH_DBF_TEXT(trace,4,"L2addmc");
+	for (dm = card->dev->mc_list; dm; dm = dm->next) {
+		ipm = qeth_get_addr_buffer(QETH_PROT_IPV4);
+		if (!ipm)
+			continue;
+		memcpy(ipm->mac,dm->dmi_addr,MAX_ADDR_LEN);
+		ipm->is_multicast = 1;
+		if (!qeth_add_ip(card, ipm))
+			kfree(ipm);
+	}
+}
+
 #ifdef CONFIG_QETH_IPV6
 static inline void
 qeth_add_mc6(struct qeth_card *card, struct inet6_dev *in6_dev)

^ permalink raw reply

* [patch 4/7] s390: some more qeth fixes
From: Frank Pavlic @ 2005-11-10 12:50 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev, linux-kernel

[patch 4/7] s390: some more qeth fixes  

From: Frank Pavlic <fpavlic@de.ibm.com>
From: Peter Tiedemann <ptiedem@de.ibm.com>
	- possible race on list fixed by reset 
	  list processing after every operation
	- traffic hang fixed 

Signed-off-by: Frank Pavlic <fpavlic@de.ibm.com>

diffstat:
 qeth_main.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff -Naupr orig/drivers/s390/net/qeth_main.c patched-linux/drivers/s390/net/qeth_main.c
--- orig/drivers/s390/net/qeth_main.c	2005-11-09 20:37:03.000000000 +0100
+++ patched-linux/drivers/s390/net/qeth_main.c	2005-11-09 20:38:23.000000000 +0100
@@ -1,6 +1,6 @@
 /*
  *
- * linux/drivers/s390/net/qeth_main.c ($Revision: 1.236 $)
+ * linux/drivers/s390/net/qeth_main.c ($Revision: 1.238 $)
  *
  * Linux on zSeries OSA Express and HiperSockets support
  *
@@ -12,7 +12,7 @@
  *			  Frank Pavlic (pavlic@de.ibm.com) and
  *		 	  Thomas Spatzier <tspat@de.ibm.com>
  *
- *    $Revision: 1.236 $	 $Date: 2005/05/04 20:19:18 $
+ *    $Revision: 1.238 $	 $Date: 2005/05/04 20:19:18 $
  *
  * 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
@@ -72,7 +72,7 @@
 #include "qeth_eddp.h"
 #include "qeth_tso.h"
 
-#define VERSION_QETH_C "$Revision: 1.236 $"
+#define VERSION_QETH_C "$Revision: 1.238 $"
 static const char *version = "qeth S/390 OSA-Express driver";
 
 /**
@@ -799,7 +799,7 @@ __qeth_delete_all_mc(struct qeth_card *c
 {
 	struct qeth_ipaddr *addr, *tmp;
 	int rc;
-
+again:
 	list_for_each_entry_safe(addr, tmp, &card->ip_list, entry) {
 		if (addr->is_multicast) {
 			spin_unlock_irqrestore(&card->ip_lock, *flags);
@@ -808,6 +808,7 @@ __qeth_delete_all_mc(struct qeth_card *c
 			if (!rc) {
 				list_del(&addr->entry);
 				kfree(addr);
+				goto again;
 			}
 		}
 	}
@@ -4336,6 +4337,8 @@ qeth_do_send_packet(struct qeth_card *ca
 out:
 	if (flush_count)
 		qeth_flush_buffers(queue, 0, start_index, flush_count);
+	else if (!atomic_read(&queue->set_pci_flags_count))
+		atomic_swap(&queue->state, QETH_OUT_Q_LOCKED_FLUSH);
 	/*
 	 * queue->state will go from LOCKED -> UNLOCKED or from
 	 * LOCKED_FLUSH -> LOCKED if output_handler wanted to 'notify' us

^ permalink raw reply

* [patch 5/7] s390: fix recovery failure of non-guestLAN devices
From: Frank Pavlic @ 2005-11-10 12:51 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev, linux-kernel

[patch 5/7] s390: fix recovery failure of non-guestLAN devices 

From: Frank Pavlic <fpavlic@de.ibm.com>
	- Recovery of non-guestLAN Layer 2 device failed due to
	  trying to register the real MAC address we got from
	  the READ_MAC adapter parameters command.
	  We have to keep the "old" MAC address when we process
	  the reply of a READ_MAC.
	
Signed-off-by: Frank Pavlic <fpavlic@de.ibm.com>

diffstat:
 qeth.h      |   12 ++++++------
 qeth_main.c |   27 ++++++++++++++++-----------
 2 files changed, 22 insertions(+), 17 deletions(-)

diff -Naupr orig/drivers/s390/net/qeth.h patched-linux/drivers/s390/net/qeth.h
--- orig/drivers/s390/net/qeth.h	2005-11-09 20:16:39.000000000 +0100
+++ patched-linux/drivers/s390/net/qeth.h	2005-11-09 20:43:33.000000000 +0100
@@ -25,7 +25,7 @@
 
 #include "qeth_mpc.h"
 
-#define VERSION_QETH_H 		"$Revision: 1.151 $"
+#define VERSION_QETH_H 		"$Revision: 1.152 $"
 
 #ifdef CONFIG_QETH_IPV6
 #define QETH_VERSION_IPV6 	":IPv6"
@@ -719,8 +719,6 @@ struct qeth_reply {
 	atomic_t refcnt;
 };
 
-#define QETH_BROADCAST_WITH_ECHO    1
-#define QETH_BROADCAST_WITHOUT_ECHO 2
 
 struct qeth_card_blkt {
 	int time_total;
@@ -728,8 +726,10 @@ struct qeth_card_blkt {
 	int inter_packet_jumbo;
 };
 
-
-
+#define QETH_BROADCAST_WITH_ECHO    0x01
+#define QETH_BROADCAST_WITHOUT_ECHO 0x02
+#define QETH_LAYER2_MAC_READ	    0x01
+#define QETH_LAYER2_MAC_REGISTERED  0x02
 struct qeth_card_info {
 	unsigned short unit_addr2;
 	unsigned short cula;
@@ -737,7 +737,7 @@ struct qeth_card_info {
 	__u16 func_level;
 	char mcl_level[QETH_MCL_LENGTH + 1];
 	int guestlan;
-	int layer2_mac_registered;
+	int mac_bits;
 	int portname_required;
 	int portno;
 	char portname[9];
diff -Naupr orig/drivers/s390/net/qeth_main.c patched-linux/drivers/s390/net/qeth_main.c
--- orig/drivers/s390/net/qeth_main.c	2005-11-09 20:42:41.000000000 +0100
+++ patched-linux/drivers/s390/net/qeth_main.c	2005-11-09 20:45:34.000000000 +0100
@@ -1,6 +1,6 @@
 /*
  *
- * linux/drivers/s390/net/qeth_main.c ($Revision: 1.238 $)
+ * linux/drivers/s390/net/qeth_main.c ($Revision: 1.242 $)
  *
  * Linux on zSeries OSA Express and HiperSockets support
  *
@@ -12,7 +12,7 @@
  *			  Frank Pavlic (pavlic@de.ibm.com) and
  *		 	  Thomas Spatzier <tspat@de.ibm.com>
  *
- *    $Revision: 1.238 $	 $Date: 2005/05/04 20:19:18 $
+ *    $Revision: 1.242 $	 $Date: 2005/05/04 20:19:18 $
  *
  * 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
@@ -72,7 +72,7 @@
 #include "qeth_eddp.h"
 #include "qeth_tso.h"
 
-#define VERSION_QETH_C "$Revision: 1.238 $"
+#define VERSION_QETH_C "$Revision: 1.242 $"
 static const char *version = "qeth S/390 OSA-Express driver";
 
 /**
@@ -3775,7 +3775,7 @@ qeth_open(struct net_device *dev)
 
 	if ( (card->info.type != QETH_CARD_TYPE_OSN) &&
 	     (card->options.layer2) &&
-	     (!card->info.layer2_mac_registered)) {
+	     (!(card->info.mac_bits & QETH_LAYER2_MAC_REGISTERED))) {
 		QETH_DBF_TEXT(trace,4,"nomacadr");
 		return -EPERM;
 	}
@@ -5894,10 +5894,10 @@ qeth_layer2_send_setmac_cb(struct qeth_c
 		PRINT_WARN("Error in registering MAC address on " \
 			   "device %s: x%x\n", CARD_BUS_ID(card),
 			   cmd->hdr.return_code);
-		card->info.layer2_mac_registered = 0;
+		card->info.mac_bits &= ~QETH_LAYER2_MAC_REGISTERED;
 		cmd->hdr.return_code = -EIO;
 	} else {
-		card->info.layer2_mac_registered = 1;
+		card->info.mac_bits |= QETH_LAYER2_MAC_REGISTERED;
 		memcpy(card->dev->dev_addr,cmd->data.setdelmac.mac,
 		       OSA_ADDR_LEN);
 		PRINT_INFO("MAC address %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x "
@@ -5935,7 +5935,7 @@ qeth_layer2_send_delmac_cb(struct qeth_c
 		cmd->hdr.return_code = -EIO;
 		return 0;
 	}
-	card->info.layer2_mac_registered = 0;
+	card->info.mac_bits &= ~QETH_LAYER2_MAC_REGISTERED;
 
 	return 0;
 }
@@ -5943,7 +5943,7 @@ static int
 qeth_layer2_send_delmac(struct qeth_card *card, __u8 *mac)
 {
 	QETH_DBF_TEXT(trace, 2, "L2Delmac");
-	if (!card->info.layer2_mac_registered)
+	if (!(card->info.mac_bits & QETH_LAYER2_MAC_REGISTERED))
 		return 0;
 	return qeth_layer2_send_setdelmac(card, mac, IPA_CMD_DELVMAC,
 					  qeth_layer2_send_delmac_cb);
@@ -5965,7 +5965,7 @@ qeth_layer2_set_mac_address(struct net_d
 	card = (struct qeth_card *) dev->priv;
 
 	if (!card->options.layer2) {
-		PRINT_WARN("Setting MAC address on %s is not supported"
+		PRINT_WARN("Setting MAC address on %s is not supported "
 			   "in Layer 3 mode.\n", dev->name);
 		QETH_DBF_TEXT(trace, 3, "setmcLY3");
 		return -EOPNOTSUPP;
@@ -6550,8 +6550,13 @@ qeth_setadpparms_change_macaddr_cb(struc
 	QETH_DBF_TEXT(trace,4,"chgmaccb");
 
 	cmd = (struct qeth_ipa_cmd *) data;
-	memcpy(card->dev->dev_addr,
-	       &cmd->data.setadapterparms.data.change_addr.addr,OSA_ADDR_LEN);
+	if (!card->options.layer2 || card->info.guestlan ||
+	    !(card->info.mac_bits & QETH_LAYER2_MAC_READ)) {	
+		memcpy(card->dev->dev_addr,
+		       &cmd->data.setadapterparms.data.change_addr.addr,
+		       OSA_ADDR_LEN);
+		card->info.mac_bits |= QETH_LAYER2_MAC_READ;
+	}
 	qeth_default_setadapterparms_cb(card, reply, (unsigned long) cmd);
 	return 0;
 }

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox