Re: [PATCH 44/44] [XFRM] IPV6: Support Mobile IPv6 extension headers sorting.
In article [EMAIL PROTECTED] (at Wed, 23 Aug 2006 22:57:06 -0700 (PDT)), David Miller [EMAIL PROTECTED] says: Are there any other Mobile-IPV6 patches necessary for the kernel? The patches cover most of MIPv6 and CN should work. However, for HA/MN, there are small number of patches to send. We will send them, of course. Nakamura-san, please describe the details. --yoshfuji - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] ethtool v4: add autoneg advertise feature
[EMAIL PROTECTED] wrote: @@ -598,25 +608,7 @@ static void parse_cmdline(int argc, char } } - if (autoneg_wanted == AUTONEG_ENABLE){ - if (speed_wanted == SPEED_10 duplex_wanted == DUPLEX_HALF) - advertising_wanted = ADVERTISED_10baseT_Half; - else if (speed_wanted == SPEED_10 -duplex_wanted == DUPLEX_FULL) - advertising_wanted = ADVERTISED_10baseT_Full; - else if (speed_wanted == SPEED_100 -duplex_wanted == DUPLEX_HALF) - advertising_wanted = ADVERTISED_100baseT_Half; - else if (speed_wanted == SPEED_100 -duplex_wanted == DUPLEX_FULL) - advertising_wanted = ADVERTISED_100baseT_Full; - else if (speed_wanted == SPEED_1000 -duplex_wanted == DUPLEX_HALF) - advertising_wanted = ADVERTISED_1000baseT_Half; - else if (speed_wanted == SPEED_1000 -duplex_wanted == DUPLEX_FULL) - advertising_wanted = ADVERTISED_1000baseT_Full; - else + if ((autoneg_wanted == AUTONEG_ENABLE) (advertising_wanted 0)) { This will change existing behavior of the tool, AFAICS. Jeff - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [ETHTOOL] GSO Support for ethtool
applied - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 36/44] [XFRM]: Introduce XFRM_MSG_REPORT.
David Miller wrote: From: YOSHIFUJI Hideaki [EMAIL PROTECTED] Date: Thu, 24 Aug 2006 00:02:37 +0900 XFRM_MSG_REPORT is a message as notification of state protocol and selector from kernel to user-space. Mobile IPv6 will use it when inbound reject is occurred at route optimization to make user-space know a binding error requirement. Based on MIPL2 kernel patch. Signed-off-by: Masahide NAKAMURA [EMAIL PROTECTED] Signed-off-by: YOSHIFUJI Hideaki [EMAIL PROTECTED] Applied to net-2.6.19, but... Please check whether this XFRM_MSG_REPORT functionality can be provided via XFRM_MSG_*AE. It seems to me that AEVENTS can be used to report these rejection situations too. But you might have a good reason why not do merge the functionality. Just let me know. Thank you for pointing it. Now I've checked AEVENT briefly and I feel it is a smarter design to implement this rejection on AEVENT. However it would make us have more lines than XFRM_MSG_REPORT. AEVENT is designed to manage for each existing XFRM state. OTOH XFRM_MSG_REPORT's requirement is to manage unexpected packet then no matching state is there. We would need to add such code as XFRM state generated by kernel for REPORT like ACQUIRE to use AEVENT. It might make us define one more status XFRM_STATE_XXX (or adding xfrm_state.km.XXX used with XFRM_STATE_ACQ), too. It is good that AEVENT has a reducing mechanism for message passing between kernel and user-space in receiving packet. For REPORT purpose, we would need to modify to specify thresh e.g. dividing sysctl per XFRM protocol (i.e. ESP, AH, IPComp and DSTOPTS) to specify REPORT state. Should I start to design it? -- Masahide NAKAMURA - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 36/44] [XFRM]: Introduce XFRM_MSG_REPORT.
From: Masahide NAKAMURA [EMAIL PROTECTED] Date: Thu, 24 Aug 2006 15:48:10 +0900 Should I start to design it? Thank you for the analysis. Let's not jump so quickly towards implementation just yet. What I plan to do right now is port my XFRM hashing patches into the current net-2.6.19 tree. I am hoping that, in the mean time, maybe someone such as Jamal, Thomas Graf, or Herbert Xu might have some opinion in the area of AEVENT and XFRM_MSG_REPORT. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 44/44] [XFRM] IPV6: Support Mobile IPv6 extension headers sorting.
From: YOSHIFUJI Hideaki [EMAIL PROTECTED] Date: Thu, 24 Aug 2006 15:04:42 +0900 (JST) In article [EMAIL PROTECTED] (at Wed, 23 Aug 2006 22:57:06 -0700 (PDT)), David Miller [EMAIL PROTECTED] says: Are there any other Mobile-IPV6 patches necessary for the kernel? The patches cover most of MIPv6 and CN should work. However, for HA/MN, there are small number of patches to send. We will send them, of course. Nakamura-san, please describe the details. Ok, thank you. In the mean time, I will work on porting my XFRM hashing changes for the current net-2.6.19 tree. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] ethtool: skge register dump
applied - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2.6.17.1 1/2] dllink driver: porting v1.19 to linux 2.6.17
Can you resend this against 2.6.18-rc1 and/or netdev-2.6.git#upstream ? Jeff - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 01/18] d80211: LED triggers
On Wed, 2006-08-23 at 20:16 +0200, Jiri Benc wrote: CC [M] net/d80211/ieee80211_led.o In file included from net/d80211/ieee80211_led.h:9, from net/d80211/ieee80211_led.c:11: include/linux/leds.h:39: error: field 'node' has incomplete type include/linux/leds.h:44: error: syntax error before 'rwlock_t' Oh right, forgot about that. Please queue, the fix for this is in -mm, include/linux/leds.h isn't including all files it requires. johannes - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 44/44] [XFRM] IPV6: Support Mobile IPv6 extension headers sorting.
David Miller wrote: From: YOSHIFUJI Hideaki [EMAIL PROTECTED] Date: Thu, 24 Aug 2006 15:04:42 +0900 (JST) In article [EMAIL PROTECTED] (at Wed, 23 Aug 2006 22:57:06 -0700 (PDT)), David Miller [EMAIL PROTECTED] says: Are there any other Mobile-IPV6 patches necessary for the kernel? The patches cover most of MIPv6 and CN should work. However, for HA/MN, there are small number of patches to send. We will send them, of course. Nakamura-san, please describe the details. I'll send them later, but anyway, Ok, thank you. In the mean time, I will work on porting my XFRM hashing changes for the current net-2.6.19 tree. FYI, your work will not have any conflict with the left of MIPv6 patches which I will describe later since they are almost out of XFRM. Regards, -- Masahide NAKAMURA - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/21] d80211: pull request
On Wed, 2006-08-23 at 21:30 +0200, Jiri Benc wrote: Johannes Berg: d80211: LED triggers Yep, as noted, the fix for this is to include some more things in include/linux/leds.h, which is in -mm: http://kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.18-rc4/2.6.18-rc4-mm2/broken-out/make-ledsh-include-relevant-headers.patch add nl80211 Yeah, I need to repost a fixed version. make d80211 use nl80211 Ditto, but would appreciate feedback on both of these. d80211: rework rate control registration d80211: move out rate control registration code Thought you wanted to drop them? johannes - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/4] IP100A: Fix TX Pause bug (reset_tx, intr_handler) 2006-08-24
From: Jesse Huang [EMAIL PROTECTED] Change Logs: - Fix TX Pause bug (reset_tx, intr_handler) Signed-off-by: Jesse Huang [EMAIL PROTECTED] --- drivers/net/sundance.c | 53 +++- 1 files changed, 30 insertions(+), 23 deletions(-) fb301c44641884efd60918054080f1ebc1d4f307 diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index ac17377..0b6028b 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -21,8 +21,8 @@ */ #define DRV_NAME sundance -#define DRV_VERSION1.1 -#define DRV_RELDATE27-Jun-2006 +#define DRV_VERSION1.2 +#define DRV_RELDATE03-Aug-2006 /* The user-configurable values. @@ -262,8 +262,6 @@ enum alta_offsets { ASICCtrl = 0x30, EEData = 0x34, EECtrl = 0x36, - TxStartThresh = 0x3c, - RxEarlyThresh = 0x3e, FlashAddr = 0x40, FlashData = 0x44, TxStatus = 0x46, @@ -1084,6 +1082,8 @@ reset_tx (struct net_device *dev) } /* free all tx skbuff */ for (i = 0; i TX_RING_SIZE; i++) { + np-tx_ring[i].next_desc = 0; + skb = np-tx_skbuff[i]; if (skb) { pci_unmap_single(np-pci_dev, @@ -1099,6 +1099,10 @@ reset_tx (struct net_device *dev) } np-cur_tx = np-dirty_tx = 0; np-cur_task = 0; + + np-last_tx = 0; + iowrite8(127, ioaddr + TxDMAPollPeriod); + iowrite16 (StatsEnable | RxEnable | TxEnable, ioaddr + MACCtrl1); return 0; } @@ -1156,29 +1160,29 @@ static irqreturn_t intr_handler(int irq, np-stats.tx_fifo_errors++; if (tx_status 0x02) np-stats.tx_window_errors++; - /* - ** This reset has been verified on - ** DFE-580TX boards ! [EMAIL PROTECTED] - */ - if (tx_status 0x10) { /* TxUnderrun */ - unsigned short txthreshold; - - txthreshold = ioread16 (ioaddr + TxStartThresh); - /* Restart Tx FIFO and transmitter */ - sundance_reset(dev, (NetworkReset|FIFOReset|TxReset) 16); - iowrite16 (txthreshold, ioaddr + TxStartThresh); - /* No need to reset the Tx pointer here */ + + /* FIFO ERROR need to be reset tx */ + if (tx_status 0x10) { /* Reset the Tx. */ + spin_lock(np-lock); + reset_tx(dev); + spin_unlock(np-lock); + } + if (tx_status 0x1e) { + /* need to make sure tx enabled */ + int i = 10; + do { + iowrite16(ioread16(ioaddr + MACCtrl1) | TxEnable, ioaddr + MACCtrl1); + if (ioread16(ioaddr + MACCtrl1) TxEnabled) + break; + mdelay(1); + } while (--i); } - /* Restart the Tx. */ - iowrite16 (TxEnable, ioaddr + MACCtrl1); } - /* Yup, this is a documentation bug. It cost me *hours*. */ + iowrite16 (0, ioaddr + TxStatus); - if (tx_cnt 0) { - iowrite32(5000, ioaddr + DownCounter); - break; - } tx_status = ioread16 (ioaddr + TxStatus); + if (tx_cnt 0) + break; } hw_frame_id = (tx_status 8) 0xff; } else { @@ -1244,6 +1248,9 @@ static irqreturn_t intr_handler(int irq, if (netif_msg_intr(np)) printk(KERN_DEBUG %s: exiting interrupt, status=%#4.4x.\n, dev-name, ioread16(ioaddr + IntrStatus)); + + iowrite32(5000, ioaddr + DownCounter); + return IRQ_RETVAL(handled);
[PATCH 4/4] IP100A: Solve host error problem in low performance embedded system when continune down and up. 2006-08-24
From: Jesse Huang [EMAIL PROTECTED] Change Logs: - Solve host error problem in low performance embedded system when continune down and up. Signed-off-by: Jesse Huang [EMAIL PROTECTED] --- drivers/net/sundance.c | 28 1 files changed, 24 insertions(+), 4 deletions(-) b7c2fba3fb7179d18c8b1c4af316c8a14d8ec1b8 diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index 04ad4d8..a253924 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -1076,7 +1076,7 @@ reset_tx (struct net_device *dev) struct sk_buff *skb; int i; int irq = in_interrupt(); - + /* Reset tx logic, TxListPtr will be cleaned */ iowrite16 (TxDisable, ioaddr + MACCtrl1); iowrite16 (TxReset | DMAReset | FIFOReset | NetworkReset, @@ -1647,6 +1647,14 @@ static int netdev_close(struct net_devic struct sk_buff *skb; int i; + /* Wait and kill tasklet */ + tasklet_kill(np-rx_tasklet); + tasklet_kill(np-tx_tasklet); + np-cur_tx = 0; + np-dirty_tx = 0; + np-cur_task = 0; + np-last_tx = 0; + netif_stop_queue(dev); if (netif_msg_ifdown(np)) { @@ -1667,9 +1675,20 @@ static int netdev_close(struct net_devic /* Stop the chip's Tx and Rx processes. */ iowrite16(TxDisable | RxDisable | StatsDisable, ioaddr + MACCtrl1); - /* Wait and kill tasklet */ - tasklet_kill(np-rx_tasklet); - tasklet_kill(np-tx_tasklet); + for (i = 2000; i 0; i--) { + if ((ioread32(ioaddr + DMACtrl) 0xC000) == 0) + break; + mdelay(1); + } + + iowrite16(GlobalReset | DMAReset | FIFOReset | NetworkReset, ioaddr +ASICCtrl + 2); + + for (i = 2000; i 0; i--) + { + if ((ioread16(ioaddr + ASICCtrl +2) ResetBusy) == 0) + break; + mdelay(1); + } #ifdef __i386__ if (netif_msg_hw(np)) { @@ -1707,6 +1726,7 @@ #endif /* __i386__ debugging only */ } } for (i = 0; i TX_RING_SIZE; i++) { + np-tx_ring[i].next_desc = 0; skb = np-tx_skbuff[i]; if (skb) { pci_unmap_single(np-pci_dev, -- 1.3.GIT - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/4] IP100A: Correct initial and close hardware step. 2006-08-24
From: Jesse Huang [EMAIL PROTECTED] Change Logs: - Correct initial and close hardware step. Signed-off-by: Jesse Huang [EMAIL PROTECTED] --- drivers/net/sundance.c |8 1 files changed, 8 insertions(+), 0 deletions(-) 419599b10f1253ccd7224bbd369924307e1e5bb6 diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index dd41ee2..04ad4d8 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -787,6 +787,7 @@ static int netdev_open(struct net_device { struct netdev_private *np = netdev_priv(dev); void __iomem *ioaddr = np-base; + unsigned long flags; int i; /* Do we need to reset the chip??? */ @@ -831,6 +832,10 @@ #endif iowrite8(0x01, ioaddr + DebugCtrl1); netif_start_queue(dev); + spin_lock_irqsave(np-lock, flags); + reset_tx(dev); + spin_unlock_irqrestore(np-lock, flags); + iowrite16 (StatsEnable | RxEnable | TxEnable, ioaddr + MACCtrl1); if (netif_msg_ifup(np)) @@ -1656,6 +1661,9 @@ static int netdev_close(struct net_devic /* Disable interrupts by clearing the interrupt mask. */ iowrite16(0x, ioaddr + IntrEnable); + /* Disable Rx and Tx DMA for safely release resource */ + iowrite32(0x500, ioaddr + DMACtrl); + /* Stop the chip's Tx and Rx processes. */ iowrite16(TxDisable | RxDisable | StatsDisable, ioaddr + MACCtrl1); -- 1.3.GIT - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: ProxyARP and IPSec
* David Miller [EMAIL PROTECTED] 2006-08-23 15:14 From: Thomas Graf [EMAIL PROTECTED] Date: Wed, 23 Aug 2006 21:14:25 +0200 * H. Peter Anvin [EMAIL PROTECTED] 2006-08-22 17:31 Specifically, Linux will not ProxyARP for an address unless it has a route for it, *and* that route either has a DNAT marking or points to a different interface than the input interface: I can think of a very ugly way: Use netfilter to match on the arp packet prerouting, set nfmark to some value, create a routing rule matching the fwmark again, have it look up a separate table with a dummy route pointing to a dummy device. Make sure to have a proxy neighbour entry as using the device proxy_arp sysctl would fail again. This shows we have a usability problem if that's the only way to do this :-) What about adding blackhole device to be used for such routes. I believe it would be good architecture to always use devices to state directions packets are being received from and sent to. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] locking bug in fib_semantics.c
On 23-08-2006 20:31, Stephen Hemminger wrote: On Tue, 22 Aug 2006 12:35:56 +0200 Jarek Poplawski [EMAIL PROTECTED] wrote: ... I've found it at last but on that occasion I've got some doubt according to rcu_read_lock and rcu_call treatment: isn't it illegal to block while in an RCU read-side section? And I think it takes place in: No, it is perfectly okay for a cpu to acquire a lock while in an RCU section, it just can't acquire a mutex/semaphore that will put it to sleep. That is caught by the might_sleep() check. Then I've wrongly understood it can't sleep while in RCU and that enabled bh can make it sleep. fib_lookup(): from tb_insert (fn_hash_insert() or fn_trie_insert()), fib_create_info(), fib_check_nh() fn_trie_lookup(): like above, inet_addr_type(), tb_lookup() fib_rule_put(): like #1 above or #2 after tb_lookup(), fib_res_put() Shouldn't there be _bh also? fib_rule_put only does something if refcount == 1 in which case it is safe. It's like above. I've thought (wrongly): fib_rule_put() calls call_rcu() and is made to sleep. Thanks for explaining: now I can peacefully go... to sleep! Jarek P. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: SMSC LAN911x and LAN921x vendor driver
Hi Jeff, What are the arguments for adding a duplicate driver, again? The current driver is completely arm specific (does not even compile on !arm). While arm is certainly a popular arch for us, we also have many customers on sh, x86 and others. Currently there is no in-kernel support for these people. Our smsc911x driver is tested and supported on arm, sh, i386. smsc911x is a shorter, simpler driver, and I believe the coding style to be cleaner and easier to follow. smsc911x contains support for the new LAN921x family, as well as LAN911x. smsc911x contains important workarounds for currently known hardware issues. Anyone using the current in-kernel driver with multicast will have problems. Many of our customers use our proprietary drivers (GPL, but the coding style would make you scream), and we would like to migrate them over to a standard in-kernel driver - it would make support easier and everyone can benefit from ongoing driver improvements. Regards, -- Steve Glendinning SMSC GmbH m: +44 777 933 9124 e: [EMAIL PROTECTED] - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH wireless-dev 4/6] d80211: Send Layer 2 Update frames in kernel
On Wed, 23 Aug 2006 23:50:41 +0200, Stefan Rompf wrote: Imagine an ESS consisting of several APs in a switched wired network. Client roams from one AP to another. In order to update the FDB of the switches, a packet with the client MAC address needs to be originated from the ethernet interface of the AP the client has associated to, even if the client does not create traffic at the moment. Thanks for the explanation! I didn't thought about ESS when looking at that patch. If I understand it right, it's not necessary to send the XID Update frame for each added STA. Shouldn't there be a flag indicating if the frame needs to be send? Userspace knows that information. Thanks, Jiri -- Jiri Benc SUSE Labs - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH wireless-dev 4/6] d80211: Send Layer 2 Update frames in kernel
On Wed, 23 Aug 2006 22:39:30 -0700, Jouni Malinen wrote: Which part do you think is hackish here? Sending the layer 2 update frame or moving it to kernel? The latter. Is it really needed to send it unconditionally for each added STA? And cannot it be generated in userspace? Thanks, Jiri -- Jiri Benc SUSE Labs - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 44/44] [XFRM] IPV6: Support Mobile IPv6 extension headers sorting.
From: Masahide NAKAMURA [EMAIL PROTECTED] Date: Thu, 24 Aug 2006 16:05:39 +0900 David Miller wrote: In the mean time, I will work on porting my XFRM hashing changes for the current net-2.6.19 tree. FYI, your work will not have any conflict with the left of MIPv6 patches which I will describe later since they are almost out of XFRM. Great. I just finished the port and pushed all of that work to net-2.6.19, can folks please take a look? I tested IPSEC as best as I could with XFRM_SUB_POLICY enabled, but I have no way currently to test sub-policies or MIPV6 cases. Thank you. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/4] Try 2: Add wireless statistics to d80211
On Wed, 23 Aug 2006 22:02:03 -0500, Larry Finger wrote: This patch modifies d80211 to add wireless statistics. Signed-Off-By: Larry [EMAIL PROTECTED] Please fix the Signed-off-by line. == diff --git a/include/net/d80211.h b/include/net/d80211.h index 42fdbf7..70655dc 100644 --- a/include/net/d80211.h +++ b/include/net/d80211.h @@ -205,6 +205,8 @@ struct ieee80211_rx_status { int channel; int phymode; int ssi; + int signal; + int noise; int antenna; int rate; int flag; @@ -499,6 +501,9 @@ struct ieee80211_hw { /* This is the time in us to change channels */ int channel_change_time; + /* This is maximum value of rssi reported by this interface + */ + int maxssi; Device, not interface. And please do not put */ to a new line. [...] --- a/net/d80211/ieee80211_ioctl.c +++ b/net/d80211/ieee80211_ioctl.c [...] @@ -3019,7 +3062,6 @@ static int ieee80211_ioctl_giwauth(struc return ret; } - static int ieee80211_ioctl_siwencodeext(struct net_device *dev, struct iw_request_info *info, struct iw_point *erq, char *extra) Please do not touch parts outside of the code you are fixing/improving/etc. We'll need a code style patch later, but not now - there are still too many patches floating around and I don't want to break them more than is necessary. Other then that, it looks good. Thanks, Jiri -- Jiri Benc SUSE Labs - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/7] [DCCP]: Fixes and enhancements
From: Ian McDonald [EMAIL PROTECTED] Date: Thu, 24 Aug 2006 15:16:33 +1200 My opinion is that 1 and 2 can go straight into 2.6.18 as documentation changes only - Dave - are you able to do as Arnaldo is very busy at present. I spent all of today on USAGI's IPSEC/MIPV6 patches and related issues, so I'll look into this tomorrow. Thanks Ian. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: ProxyARP and IPSec
Hello! I'm thinking that David definitely has a point about having a usability problem, though. All other kind of tunnels have endpoint devices associated with them, and that would make all these kinds of problems go away, Yes, when you deal with sane practical setups, this approach is the only reasonable one. Unfortunately, IPsec is not something totally sane and practical :-), security gateway case is small part of it and routing viewpoint clashes fatally with another requirements. Pure result is that we use approach where it is possible to do everything with some efforts, rather than approach which is simple and intuitive, but does not allow to do many things. It is possible to simulate simple life, creating ipsecX devices with disabled xfrm and route all the tunnels there. That would be handy. I would just advice to rename one of dummy devices to ipsec0 and route all the IPsec tunnels there. It is also simple. What's about iptables, I am sorry, it is too flexible to control IPsec. :-) One day, someone with enough of energy and stamina will make flow cache to unify all the kinds of policy rules. Until that day, you have to tune all three policy sets (routing, ipsec and iptables) separately and take care of the cases, when one set has to cheat another. :-) Alexey - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC] add nl80211
On Tue, 22 Aug 2006 15:52:47 +0200, Johannes Berg wrote: [...] + int (*add_virtual_intf)(void *priv, char *name); What about initial interface type? (Hm, maybe it can be fixed to a STA mode, but it should be documented somewhere at least.) + int (*del_virtual_intf)(void *priv, int ifindex); + + /* more things to be added... + * + * for a (*configure)(...) call I'd probably guess that the + * best bet would be to have one call that returns all + * possible options, one that sets them based on the + * struct genl_info *info, and one for that optimised + * set-at-once thing. + */ +}; + +/* + * register a given method structure with the nl80211 system + * and associate the 'priv' pointer with it. + * NOTE: for proper operation, this priv pointer MUST also be + * assigned to each struct net_device's @ieee80211_ptr member! + */ +extern int nl80211_register(struct nl80211_ops *ops, void *priv); Could this function return the allocated wiphy index? [...] +struct nl80211_registered_driver { + struct nl80211_ops *ops; + int wiphy; + void *priv; + struct list_head list; + /* we hold this mutex during any call so that + * we cannot do multiple calls at once, and also + * to avoid the deregister call to proceed while + * any call is in progress */ + struct mutex mtx; +}; Hm, most of drivers will need to take rtnl to stay compatible with WE. (Not a reason to take rtnl in nl80211, just a remark.) [...] +static struct nl80211_registered_driver *nl80211_drv_by_priv_locked(void *priv) Please use __ prefix instead of _locked suffix (e.g. __nl80211_drv_by_priv). That's more common convention in the kernel. [...] +/* requires nl80211_drv_mutex to be held! */ +static struct nl80211_registered_driver * +nl80211_drv_from_info_locked(struct genl_info *info) +{ + int ifindex; + struct nl80211_registered_driver *result = NULL; + struct net_device *dev; + int err = -EINVAL; + + if (info-attrs[NL80211_ATTR_WIPHY]) { + result = nl80211_drv_by_wiphy_locked( + nla_get_u32(info-attrs[NL80211_ATTR_WIPHY])); + if (result) + return result; + err = -ENODEV; + } + + if (info-attrs[NL80211_ATTR_IFINDEX]) { + ifindex = nla_get_u32(info-attrs[NL80211_ATTR_IFINDEX]); + dev = dev_get_by_index(ifindex); + result = nl80211_drv_by_priv_locked(dev-ieee80211_ptr); + dev_put(dev); + if (result) + return result; + err = -ENODEV; + } If both ifindex and wiphy index are set and they disagree with each other, this should return an error. + + return ERR_PTR(err); +} + [...] +static struct nl80211_registered_driver * +nl80211_drv_from_info_with_locking(struct genl_info *info) nl80211_get_drv_from_info would be better. Also, introduce a nl80211_put_drv function to ease tracking of locks. [...] +static int nl80211_dump_wiphys(struct sk_buff *skb, struct netlink_callback *cb) +{ + /* I think need professional netlink help with dumpit calls */ I'm not able to help you here :-( Looks really good now, I think. Thanks, Jiri -- Jiri Benc SUSE Labs - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC] make d80211 use nl80211
On Tue, 22 Aug 2006 15:53:33 +0200, Johannes Berg wrote: This patch makes d80211 partially configurable using the infrastructure that nl80211 provides. So far, it allows packet injection and adding/removing virtual interfaces. Just minor things: [...] --- wireless-dev.orig/net/d80211/ieee80211.c 2006-08-22 15:47:46.0 +0200 +++ wireless-dev/net/d80211/ieee80211.c 2006-08-22 15:47:48.0 +0200 [...] @@ -4323,6 +4363,7 @@ struct net_device *ieee80211_alloc_hw(si priv_size = ((sizeof(struct ieee80211_sub_if_data) + NETDEV_ALIGN_CONST) ~NETDEV_ALIGN_CONST) + priv_data_len; + mdev = alloc_netdev(priv_size, wmaster%d, ether_setup); if (!mdev) { ieee80211_dev_free(local); Remove this hunk, please. [...] +static int d80211_interfaces(void *priv, void *data, + int (*one)(void *data, int ifindex)) Please use ieee80211_ prefix, not d80211_. [...] +static int d80211_inject(void *priv, void *frame, int framelen, u32 flags, + int queue) +{ + struct ieee80211_local *local = priv; + struct ieee80211_tx_packet_data *pkt_data; + struct sk_buff *pkt; + void *pktdata; + + pkt = alloc_skb(framelen, GFP_KERNEL); + pktdata = skb_put(pkt, framelen); + memcpy(pktdata, frame, framelen); + + pkt_data = (struct ieee80211_tx_packet_data *) pkt-cb; + memset(pkt_data, 0, sizeof(struct ieee80211_tx_packet_data)); This is not necessary, cb is zeroed in alloc_skb. Thanks, Jiri -- Jiri Benc SUSE Labs - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC] add nl80211
On Thu, 2006-08-24 at 15:32 +0200, Jiri Benc wrote: + int (*add_virtual_intf)(void *priv, char *name); What about initial interface type? (Hm, maybe it can be fixed to a STA mode, but it should be documented somewhere at least.) Actually, I already changed that. + int (*del_virtual_intf)(void *priv, int ifindex); + + /* more things to be added... +* +* for a (*configure)(...) call I'd probably guess that the +* best bet would be to have one call that returns all +* possible options, one that sets them based on the +* struct genl_info *info, and one for that optimised +* set-at-once thing. +*/ +}; + +/* + * register a given method structure with the nl80211 system + * and associate the 'priv' pointer with it. + * NOTE: for proper operation, this priv pointer MUST also be + * assigned to each struct net_device's @ieee80211_ptr member! + */ +extern int nl80211_register(struct nl80211_ops *ops, void *priv); Could this function return the allocated wiphy index? Ah, yes, I wanted to do that all along. And a negative error code? Hm, most of drivers will need to take rtnl to stay compatible with WE. (Not a reason to take rtnl in nl80211, just a remark.) Not for packet injection or such though, dev_get is enough for that, I think. Please use __ prefix instead of _locked suffix (e.g. __nl80211_drv_by_priv). That's more common convention in the kernel. I used to have a locking version too, which was without the suffix :) If both ifindex and wiphy index are set and they disagree with each other, this should return an error. Ok, I can do that. johannes - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] locking bug in fib_semantics.c
Jarek Poplawski wrote: On 23-08-2006 20:31, Stephen Hemminger wrote: On Tue, 22 Aug 2006 12:35:56 +0200 Jarek Poplawski [EMAIL PROTECTED] wrote: ... I've found it at last but on that occasion I've got some doubt according to rcu_read_lock and rcu_call treatment: isn't it illegal to block while in an RCU read-side section? And I think it takes place in: No, it is perfectly okay for a cpu to acquire a lock while in an RCU section, it just can't acquire a mutex/semaphore that will put it to sleep. That is caught by the might_sleep() check. Then I've wrongly understood it can't sleep while in RCU and that enabled bh can make it sleep. fib_lookup(): from tb_insert (fn_hash_insert() or fn_trie_insert()), fib_create_info(), fib_check_nh() fn_trie_lookup(): like above, inet_addr_type(), tb_lookup() fib_rule_put(): like #1 above or #2 after tb_lookup(), fib_res_put() Shouldn't there be _bh also? fib_rule_put only does something if refcount == 1 in which case it is safe. It's like above. I've thought (wrongly): fib_rule_put() calls call_rcu() and is made to sleep. call_rcu() doesn't sleep, it schedules work in a later context. In that way call_rcu() is like other deferred work mechanism (tasklets, timers, workqueues). - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/4] Try 2: Add wireless statistics to d80211
This patch modifies d80211 to add wireless statistics. Signed-Off-By: Larry Finger [EMAIL PROTECTED] == diff --git a/include/net/d80211.h b/include/net/d80211.h index 42fdbf7..70655dc 100644 --- a/include/net/d80211.h +++ b/include/net/d80211.h @@ -205,6 +205,8 @@ struct ieee80211_rx_status { int channel; int phymode; int ssi; + int signal; + int noise; int antenna; int rate; int flag; @@ -499,6 +501,9 @@ struct ieee80211_hw { /* This is the time in us to change channels */ int channel_change_time; + /* This is maximum value of rssi reported by this interface +*/ + int maxssi; int num_modes; struct ieee80211_hw_modes *modes; diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c index e72721f..2549484 100644 --- a/net/d80211/ieee80211.c +++ b/net/d80211/ieee80211.c @@ -3175,6 +3175,8 @@ ieee80211_rx_h_sta_process(struct ieee80 sta-rx_fragments++; sta-rx_bytes += rx-skb-len; sta-last_rssi = rx-u.rx.status-ssi; + sta-last_signal = rx-u.rx.status-signal; + sta-last_noise = rx-u.rx.status-noise; if (!(rx-fc IEEE80211_FCTL_MOREFRAGS)) { /* Change STA power saving mode only in the end of a frame diff --git a/net/d80211/ieee80211_i.h b/net/d80211/ieee80211_i.h index 0d2d79d..1271513 100644 --- a/net/d80211/ieee80211_i.h +++ b/net/d80211/ieee80211_i.h @@ -336,6 +336,7 @@ struct ieee80211_local { struct net_device *apdev; /* wlan#ap - management frames (hostapd) */ int open_count; int monitors; + struct iw_statistics wstats; struct ieee80211_conf conf; int dev_index; diff --git a/net/d80211/ieee80211_ioctl.c b/net/d80211/ieee80211_ioctl.c index 89a58e3..b121302 100644 --- a/net/d80211/ieee80211_ioctl.c +++ b/net/d80211/ieee80211_ioctl.c @@ -1581,6 +1581,16 @@ static int ieee80211_ioctl_giwrange(stru range-min_frag = 256; range-max_frag = 2346; + range-max_qual.qual = 100; + range-max_qual.level = 146; /* set floor at -110 dBm (146 - 256) */ + range-max_qual.noise = 146; + range-max_qual.updated = IW_QUAL_ALL_UPDATED; + + range-avg_qual.qual = 50; + range-avg_qual.level = 0; + range-avg_qual.noise = 0; + range-avg_qual.updated = IW_QUAL_ALL_UPDATED; + return 0; } @@ -2996,6 +3006,39 @@ static int ieee80211_ioctl_siwauth(struc return ret; } +/* Get wireless statistics. Called by /proc/net/wireless and by SIOCGIWSTATS */ +static struct iw_statistics *ieee80211_get_wireless_stats(struct net_device *net_dev) +{ + struct ieee80211_local *local = net_dev-ieee80211_ptr; + struct iw_statistics * wstats = local-wstats; + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(net_dev); + struct sta_info *sta; + static int tmp_level = 0; + static int tmp_qual = 0; + + sta = sta_info_get(local, sdata-u.sta.bssid); + if (!sta) { + wstats-discard.fragment = 0; + wstats-discard.misc = 0; + wstats-qual.qual = 0; + wstats-qual.level = 0; + wstats-qual.noise = 0; + wstats-qual.updated = IW_QUAL_ALL_INVALID; + } else { + if (!tmp_level) { /* get initial values */ + tmp_level = sta-last_signal; + tmp_qual = sta-last_rssi; + } else {/* smooth results */ + tmp_level = (15 * tmp_level + sta-last_signal)/16; + tmp_qual = (15 * tmp_qual + sta-last_rssi)/16; + } + wstats-qual.level = tmp_level; + wstats-qual.qual = 100*tmp_qual/local-hw-maxssi; + wstats-qual.noise = sta-last_noise; + wstats-qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM; + } + return wstats; +} static int ieee80211_ioctl_giwauth(struct net_device *dev, struct iw_request_info *info, @@ -3019,7 +3062,6 @@ static int ieee80211_ioctl_giwauth(struc return ret; } - static int ieee80211_ioctl_siwencodeext(struct net_device *dev, struct iw_request_info *info, struct iw_point *erq, char *extra) @@ -3184,6 +3226,7 @@ const struct iw_handler_def ieee80211_iw .standard = (iw_handler *) ieee80211_handler, .private= (iw_handler *) ieee80211_private_handler, .private_args = (struct iw_priv_args *) ieee80211_ioctl_priv, + .get_wireless_stats = ieee80211_get_wireless_stats, }; /* Wireless handlers for master interface */ diff --git a/net/d80211/ieee80211_sysfs_sta.c b/net/d80211/ieee80211_sysfs_sta.c index 94c6dd8..dd92b02 100644 --- a/net/d80211/ieee80211_sysfs_sta.c +++
Re: [RFC] add nl80211
* Johannes Berg [EMAIL PROTECTED] 2006-08-22 15:52 +static struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] __read_mostly = { + [NL80211_ATTR_IFINDEX] = { .type = NLA_U32 }, + [NL80211_ATTR_WIPHY] = { .type = NLA_U32 }, + [NL80211_ATTR_FLAGS] = { .type = NLA_U32 }, + [NL80211_ATTR_QUEUE] = { .type = NLA_U32 }, + [NL80211_ATTR_FRAME] = { .type = NLA_STRING, .len = 2500 }, Might want to put this in a header so userspace can see the limit. + [NL80211_ATTR_IFNAME] = { .type = NLA_NUL_STRING, .len = IFNAMSIZ-1 }, +}; + +static int nl80211_get_commands(struct sk_buff *skb, struct genl_info *info) +{ + struct nl80211_registered_driver *drv; + struct sk_buff *msg; + void *hdr; + int err; + struct nlattr *start; + u8 *data; + + drv = nl80211_drv_from_info_with_locking(info); + if (IS_ERR(drv)) + return PTR_ERR(drv); + + hdr = nl80211msg_new(msg, info-snd_pid, info-snd_seq, 0, + NL80211_CMD_GET_COMMANDS); This isn't wrong in particular but usually we reverse the meaning of the command when sending back answers, i.e. in your case you'd define CMD_GET_COMMAND and CMD_NEW_COMMAND with the following behaviour: CMD_GET_COMMAND Search for command specified by the attributes and send back a CMD_NEW_COMMAND message. CMD_GET_COMMAND with NLM_F_DUMP Iterate over all commands and send back a CMD_NEW_COMMAND message for each command. In your case I'd call it GET_CMDLIST and NEW_CMDLIST which means you request a command list with GET_CMDLIST and receive the answer with a CMD_NEWLIST message. + start = nla_nest_start(msg, NL80211_ATTR_CMDS); + if (!start) + goto nla_nest_failure; + data = nla_data(start); + + /* unconditionally allow some common commands we handle centrally */ + skb_put(msg, 1); + *data++ = NL80211_CMD_GET_COMMANDS; + skb_put(msg, 1); + *data++ = NL80211_CMD_GET_WIPHYS; + skb_put(msg, 1); + *data++ = NL80211_CMD_GET_INTERFACES; + + CHECK_CMD(inject_packet, INJECT); + CHECK_CMD(add_virtual_intf, ADD_VIRTUAL_INTERFACE); + CHECK_CMD(del_virtual_intf, DEL_VIRTUAL_INTERFACE); + + nla_nest_end(msg, start); I'd just use the command id as attribute type: NLA_PUT_FLAG(msg, NL80211_CMD_GET_COMMANDS); NLA_PUT_FLAG(msg, NL80211_CMD_GET_WIPHYS); This makes checking avaibility of a command as easy as accessing an array for userspace. + err = genlmsg_end(msg, hdr); + if (err) + goto msg_free; genlmsg_end() can't fail, it just returns skb-len which is only of importance while dumping to see if there is still more to dump or not. +void *nl80211msg_new(struct sk_buff **skb, u32 pid, u32 seq, int flags, u8 cmd) +{ + void *hdr; + + *skb = nlmsg_new(NLMSG_GOODSIZE); + if (!*skb) + return ERR_PTR(-ENOBUFS); + + hdr = nl80211hdr_put(*skb, pid, seq, flags, cmd); + if (!hdr) { + nlmsg_free(*skb); + /* what would be a good error here? */ + return ERR_PTR(-EINVAL); + } ENOBUFS You might want to send out notifications for various events such as the additiona and deletion of virtual interfaces etc. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/4] Try 2: Add wireless statistics to d80211
Jiri Benc wrote: On Wed, 23 Aug 2006 22:02:03 -0500, Larry Finger wrote: This patch modifies d80211 to add wireless statistics. + /* This is maximum value of rssi reported by this interface +*/ + int maxssi; Device, not interface. And please do not put */ to a new line. Noted on the first part, but I would like a clarification regarding style. I put the */ on the second line to match the rest of that section. Should a patch try to keep the local style in that part of the code, or change it to a some other standard? Larry - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH][REPOST] WAN: fix C101 card carrier handling
Jeff Garzik [EMAIL PROTECTED] writes: One of my recent changes broke C101 carrier handling, this patch fixes it. Also fixes an old TX underrun checking bug. 2.6.18 material. Please apply. it's already in netdev-2.6.git#upstream-fixes, destined for 2.6.18. Great, I somehow missed it. Thank you. -- Krzysztof Halasa - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC][PATCH 4/4] deadlock prevention for NBD
Hi! Limit each request to 1 page, so that the request throttling also limits the number of in-flight pages and force the IO scheduler to NOOP as anything else doesn't make sense anyway. I'd like to understand why it breaks with other schedulers before merging this. Maybe the failure in NOOP is just harder to trigger? Pavel -- Thanks for all the (sleeping) penguins. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/4] Try 3: Add wireless statistics to d80211
This patch modifies d80211 to add wireless statistics. Signed-Off-By: Larry Finger [EMAIL PROTECTED] == diff --git a/include/net/d80211.h b/include/net/d80211.h index 42fdbf7..f696cd1 100644 --- a/include/net/d80211.h +++ b/include/net/d80211.h @@ -205,6 +205,8 @@ struct ieee80211_rx_status { int channel; int phymode; int ssi; + int signal; + int noise; int antenna; int rate; int flag; @@ -499,6 +501,8 @@ struct ieee80211_hw { /* This is the time in us to change channels */ int channel_change_time; + /* This is maximum value of rssi reported by this device */ + int maxssi; int num_modes; struct ieee80211_hw_modes *modes; diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c index e72721f..2549484 100644 --- a/net/d80211/ieee80211.c +++ b/net/d80211/ieee80211.c @@ -3175,6 +3175,8 @@ ieee80211_rx_h_sta_process(struct ieee80 sta-rx_fragments++; sta-rx_bytes += rx-skb-len; sta-last_rssi = rx-u.rx.status-ssi; + sta-last_signal = rx-u.rx.status-signal; + sta-last_noise = rx-u.rx.status-noise; if (!(rx-fc IEEE80211_FCTL_MOREFRAGS)) { /* Change STA power saving mode only in the end of a frame diff --git a/net/d80211/ieee80211_i.h b/net/d80211/ieee80211_i.h index 0d2d79d..1271513 100644 --- a/net/d80211/ieee80211_i.h +++ b/net/d80211/ieee80211_i.h @@ -336,6 +336,7 @@ struct ieee80211_local { struct net_device *apdev; /* wlan#ap - management frames (hostapd) */ int open_count; int monitors; + struct iw_statistics wstats; struct ieee80211_conf conf; int dev_index; diff --git a/net/d80211/ieee80211_ioctl.c b/net/d80211/ieee80211_ioctl.c index 89a58e3..e5bd5bf 100644 --- a/net/d80211/ieee80211_ioctl.c +++ b/net/d80211/ieee80211_ioctl.c @@ -1581,6 +1581,16 @@ static int ieee80211_ioctl_giwrange(stru range-min_frag = 256; range-max_frag = 2346; + range-max_qual.qual = 100; + range-max_qual.level = 146; /* set floor at -110 dBm (146 - 256) */ + range-max_qual.noise = 146; + range-max_qual.updated = IW_QUAL_ALL_UPDATED; + + range-avg_qual.qual = 50; + range-avg_qual.level = 0; + range-avg_qual.noise = 0; + range-avg_qual.updated = IW_QUAL_ALL_UPDATED; + return 0; } @@ -2996,6 +3006,39 @@ static int ieee80211_ioctl_siwauth(struc return ret; } +/* Get wireless statistics. Called by /proc/net/wireless and by SIOCGIWSTATS */ +static struct iw_statistics *ieee80211_get_wireless_stats(struct net_device *net_dev) +{ + struct ieee80211_local *local = net_dev-ieee80211_ptr; + struct iw_statistics * wstats = local-wstats; + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(net_dev); + struct sta_info *sta; + static int tmp_level = 0; + static int tmp_qual = 0; + + sta = sta_info_get(local, sdata-u.sta.bssid); + if (!sta) { + wstats-discard.fragment = 0; + wstats-discard.misc = 0; + wstats-qual.qual = 0; + wstats-qual.level = 0; + wstats-qual.noise = 0; + wstats-qual.updated = IW_QUAL_ALL_INVALID; + } else { + if (!tmp_level) { /* get initial values */ + tmp_level = sta-last_signal; + tmp_qual = sta-last_rssi; + } else {/* smooth results */ + tmp_level = (15 * tmp_level + sta-last_signal)/16; + tmp_qual = (15 * tmp_qual + sta-last_rssi)/16; + } + wstats-qual.level = tmp_level; + wstats-qual.qual = 100*tmp_qual/local-hw-maxssi; + wstats-qual.noise = sta-last_noise; + wstats-qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM; + } + return wstats; +} static int ieee80211_ioctl_giwauth(struct net_device *dev, struct iw_request_info *info, @@ -3184,6 +3227,7 @@ const struct iw_handler_def ieee80211_iw .standard = (iw_handler *) ieee80211_handler, .private= (iw_handler *) ieee80211_private_handler, .private_args = (struct iw_priv_args *) ieee80211_ioctl_priv, + .get_wireless_stats = ieee80211_get_wireless_stats, }; /* Wireless handlers for master interface */ diff --git a/net/d80211/ieee80211_sysfs_sta.c b/net/d80211/ieee80211_sysfs_sta.c index 94c6dd8..dd92b02 100644 --- a/net/d80211/ieee80211_sysfs_sta.c +++ b/net/d80211/ieee80211_sysfs_sta.c @@ -72,6 +72,8 @@ STA_ATTR(last_txrate, last_txrate, RATE) STA_ATTR(tx_retry_failed, tx_retry_failed, LU); STA_ATTR(tx_retry_count, tx_retry_count, LU); STA_ATTR(last_rssi, last_rssi, D); +STA_ATTR(last_signal, last_signal, D); +STA_ATTR(last_noise, last_noise, D);
TCP ACK
Hi, I had a fundamental question regarding stack. When does TCP ack a segment? Is it immediately receiving a segment or after copying the data from kernel to user i.e after read() system call returns? Any input is highly appreciated. Thanks Rajib == Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html == - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/4] Try 2: Add wireless statistics to d80211
On Thu, 24 Aug 2006 09:39:52 -0500, Larry Finger wrote: Noted on the first part, but I would like a clarification regarding style. I put the */ on the second line to match the rest of that section. Should a patch try to keep the local style in that part of the code, or change it to a some other standard? Patches should convert the code they are touching to coding style common in the kernel. This way we will gradually convert at least part of d80211 to the kernel coding style; the rest will be addressed by one big patch just before merging into the vanilla (or -mm). Thanks, Jiri -- Jiri Benc SUSE Labs - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC] add nl80211
On Thu, 2006-08-24 at 16:36 +0200, Thomas Graf wrote: Might want to put this in a header so userspace can see the limit. Good point, thanks. In your case I'd call it GET_CMDLIST and NEW_CMDLIST which means you request a command list with GET_CMDLIST and receive the answer with a CMD_NEWLIST message. Yeah, ok, I think I understood this now :) I'd just use the command id as attribute type: NLA_PUT_FLAG(msg, NL80211_CMD_GET_COMMANDS); NLA_PUT_FLAG(msg, NL80211_CMD_GET_WIPHYS); This makes checking avaibility of a command as easy as accessing an array for userspace. Good point. However, userspace will need to be aware to parse this with the max_cmd instead of max_attr :) + err = genlmsg_end(msg, hdr); + if (err) + goto msg_free; genlmsg_end() can't fail, it just returns skb-len which is only of importance while dumping to see if there is still more to dump or not. Whoops :) You might want to send out notifications for various events such as the additiona and deletion of virtual interfaces etc. Yeah, I'm not sure how to do that yet, maybe have exported functions. Currently, d80211 can also create virtual interfaces via sysfs so... johannes - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] ethtool v4: add autoneg advertise feature
On 8/23/06, Jeff Garzik [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: @@ -598,25 +608,7 @@ static void parse_cmdline(int argc, char } } - if (autoneg_wanted == AUTONEG_ENABLE){ - if (speed_wanted == SPEED_10 duplex_wanted == DUPLEX_HALF) - advertising_wanted = ADVERTISED_10baseT_Half; - else if (speed_wanted == SPEED_10 - duplex_wanted == DUPLEX_FULL) - advertising_wanted = ADVERTISED_10baseT_Full; - else if (speed_wanted == SPEED_100 - duplex_wanted == DUPLEX_HALF) - advertising_wanted = ADVERTISED_100baseT_Half; - else if (speed_wanted == SPEED_100 - duplex_wanted == DUPLEX_FULL) - advertising_wanted = ADVERTISED_100baseT_Full; - else if (speed_wanted == SPEED_1000 - duplex_wanted == DUPLEX_HALF) - advertising_wanted = ADVERTISED_1000baseT_Half; - else if (speed_wanted == SPEED_1000 - duplex_wanted == DUPLEX_FULL) - advertising_wanted = ADVERTISED_1000baseT_Full; - else + if ((autoneg_wanted == AUTONEG_ENABLE) (advertising_wanted 0)) { This will change existing behavior of the tool, AFAICS. That is kinda the point. The current beahvior only allows the user to set the autonegotiation advertisement to one setting (i.e 100 Half or 100 Full or 10 Half or 10 Full). With this patch the user is now able to determine exactly speed's and duplex's will be advertised for example, if a user is connected to a hub, they can tell the nic to only advertise 100 half and 10 half. The old way of setting autonegotiation was using the following command: ethtool -s ethx speed 100 duplex full auto on now the command would be ethtool -s ethx auto on advertise 0x08 both commands would result in only advertising 100 FULL. There still needs to be a change made to the man file to reflect the change in the behavior of ethtool, which I have not done. But this patch will allow for greater flexibility in setting autonegotiation speeds. -- Cheers, Jeff - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] ethtool v4: add autoneg advertise feature
Jeff Kirsher wrote: The old way of setting autonegotiation was using the following command: ethtool -s ethx speed 100 duplex full auto on now the command would be ethtool -s ethx auto on advertise 0x08 both commands would result in only advertising 100 FULL. There still needs to be a change made to the man file to reflect the change in the behavior of ethtool, which I have not done. But this patch will allow for greater flexibility in setting autonegotiation speeds. It is more flexible, but less intuitive. The user now has to remember hex values instead of the more intuitive speed and duplex. Perhaps we can keep the old method of using speed and duplex, while adding the new method of specifying hex values? - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH wireless-dev 4/6] d80211: Send Layer 2 Update frames in kernel
On Thu, Aug 24, 2006 at 01:43:16PM +0200, Jiri Benc wrote: On Wed, 23 Aug 2006 22:39:30 -0700, Jouni Malinen wrote: Which part do you think is hackish here? Sending the layer 2 update frame or moving it to kernel? The latter. Is it really needed to send it unconditionally for each added STA? And cannot it be generated in userspace? Yes, it must be sent out whenever a STA associates with the AP, i.e., for every STA and for every association.. This is needed to update both the internal bridge tables in the AP and the external bridge tables in switches etc. connected to the same physical net in order to make sure that future frames to the STA's MAC address are delivered to the correct AP--and within that AP, to the correct port. This was originally done in hostapd in userspace, but this showed a bug in which the local bridge tables did not get updated correctly in some specific configurations. In addition, doing this in hostapd would require that hostapd knows (or can learn) how the bridge configuration is done on the device and this information is not really needed for anything else, so there would not really be much point in keeping that functionality in hostapd. The simplest solution for this seems to be to allow the layer 2 update frame to be sent through the exact same path as any data frame from the STA would be coming. This makes sure that it goes through the local bridge in the same way as other frames from the STA would go and it will also be sent out to correct external (wired/WDS) ports automatically based on bridge configuration. -- Jouni MalinenPGP id EFC895FA - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] ethtool v4: add autoneg advertise feature
On 8/24/06, Michael Chan [EMAIL PROTECTED] wrote: It is more flexible, but less intuitive. The user now has to remember hex values instead of the more intuitive speed and duplex. Perhaps we can keep the old method of using speed and duplex, while adding the new method of specifying hex values? That sounds fine to me. I can send a modified patch, keeping the old method available to users. -- Cheers, Jeff - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] ethtool v4: add autoneg advertise feature
Michael Chan wrote: Jeff Kirsher wrote: The old way of setting autonegotiation was using the following command: ethtool -s ethx speed 100 duplex full auto on now the command would be ethtool -s ethx auto on advertise 0x08 both commands would result in only advertising 100 FULL. There still needs to be a change made to the man file to reflect the change in the behavior of ethtool, which I have not done. But this patch will allow for greater flexibility in setting autonegotiation speeds. It is more flexible, but less intuitive. The user now has to remember hex values instead of the more intuitive speed and duplex. Perhaps we can keep the old method of using speed and duplex, while adding the new method of specifying hex values? the patch doesn't remove the old method, it merely adds a second path to the speed/duplex setting. Using the old syntax will still work. Cheers, Auke - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC] make d80211 use nl80211
new version of this one too... -- Subject: d80211: use nl80211 This patch makes d80211 partially configurable using the infrastructure that nl80211 provides. So far, it allows packet injection and adding/removing virtual interfaces. Signed-off-by: Johannes Berg [EMAIL PROTECTED] --- wireless-dev.orig/net/d80211/Kconfig2006-08-24 18:04:28.0 +0200 +++ wireless-dev/net/d80211/Kconfig 2006-08-24 18:04:39.0 +0200 @@ -3,6 +3,7 @@ config D80211 select CRYPTO select CRYPTO_ARC4 select CRYPTO_AES + select NETLINK_80211 ---help--- This option enables the hardware independent IEEE 802.11 networking stack. --- wireless-dev.orig/net/d80211/Makefile 2006-08-24 18:04:28.0 +0200 +++ wireless-dev/net/d80211/Makefile2006-08-24 18:04:39.0 +0200 @@ -8,6 +8,7 @@ obj-$(CONFIG_D80211) += 80211.o rate_con sta_info.o \ wep.o \ wpa.o \ + ieee80211_cfg.o \ ieee80211_scan.o \ ieee80211_sta.o \ ieee80211_dev.o \ --- wireless-dev.orig/net/d80211/ieee80211.c2006-08-24 18:04:28.0 +0200 +++ wireless-dev/net/d80211/ieee80211.c 2006-08-24 18:04:39.0 +0200 @@ -20,6 +20,7 @@ #include net/iw_handler.h #include linux/compiler.h #include linux/bitmap.h +#include linux/nl80211.h #include net/d80211.h #include net/d80211_common.h @@ -32,6 +33,7 @@ #include wme.h #include aes_ccm.h #include ieee80211_led.h +#include ieee80211_cfg.h /* See IEEE 802.1H for LLC/SNAP encapsulation/decapsulation */ /* Ethernet-II snap header (RFC1042 for most EtherTypes) */ @@ -348,6 +350,16 @@ ieee80211_tx_h_rate_ctrl(struct ieee8021 { struct rate_control_extra extra; + /* FIXME + if (tx-dev == tx-local-mdev + (inject rate set)) { + a + tx-u.tx.rate = ... + etc etc + return TXRX_CONTINUE; + } + */ + memset(extra, 0, sizeof(extra)); extra.mgmt_data = tx-sdata tx-sdata-type == IEEE80211_IF_TYPE_MGMT; @@ -753,6 +765,13 @@ ieee80211_tx_h_misc(struct ieee80211_txr u16 dur; struct ieee80211_tx_control *control = tx-u.tx.control; + /* FIXME + if (tx-dev == tx-local-mdev) { + set up retry limit, ... + based on injection parameters + } + */ + if (!is_multicast_ether_addr(hdr-addr1)) { if (tx-skb-len + FCS_LEN tx-local-rts_threshold tx-local-rts_threshold IEEE80211_MAX_RTS_THRESHOLD) { @@ -878,6 +897,9 @@ ieee80211_tx_h_check_assoc(struct ieee80 #endif /* CONFIG_D80211_VERBOSE_DEBUG */ u32 sta_flags; + if (unlikely(tx-dev == tx-local-mdev)) + return TXRX_CONTINUE; + if (unlikely(tx-local-sta_scanning != 0) ((tx-fc IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_MGMT || (tx-fc IEEE80211_FCTL_STYPE) != IEEE80211_STYPE_PROBE_REQ)) @@ -981,6 +1003,12 @@ static void purge_old_ps_buffers(struct static inline ieee80211_txrx_result ieee80211_tx_h_multicast_ps_buf(struct ieee80211_txrx_data *tx) { + /* FIXME + if (unlikely(tx-dev == tx-local-mdev + (inject flags) NL80211_FLAG_NOBUFFER)) + return TXRX_CONTINUE; + */ + /* broadcast/multicast frame */ /* If any of the associated stations is in power save mode, * the frame is buffered to be sent after DTIM beacon frame */ @@ -1408,11 +1436,12 @@ static int ieee80211_master_start_xmit(s control.ifindex = odev-ifindex; control.type = osdata-type; - control.req_tx_status = pkt_data-req_tx_status; - control.do_not_encrypt = pkt_data-do_not_encrypt; + control.req_tx_status = !!(pkt_data-flags NL80211_FLAG_TXSTATUS); + control.do_not_encrypt = !(pkt_data-flags NL80211_FLAG_ENCRYPT); control.pkt_type = - pkt_data-pkt_probe_resp ? PKT_PROBE_RESP : PKT_NORMAL; - control.requeue = pkt_data-requeue; + (pkt_data-internal_flags TX_FLAG_PROBERESP) ? + PKT_PROBE_RESP : PKT_NORMAL; + control.requeue = !!(pkt_data-internal_flags TX_FLAG_REQUEUE); control.queue = pkt_data-queue; ret = ieee80211_tx(odev, skb, control, @@ -1588,8 +1617,10 @@ static int ieee80211_subif_start_xmit(st pkt_data = (struct ieee80211_tx_packet_data *)skb-cb; memset(pkt_data, 0, sizeof(struct ieee80211_tx_packet_data)); pkt_data-ifindex = sdata-dev-ifindex; - pkt_data-mgmt_iface = (sdata-type == IEEE80211_IF_TYPE_MGMT); - pkt_data-do_not_encrypt = no_encrypt; + if (sdata-type == IEEE80211_IF_TYPE_MGMT) + pkt_data-internal_flags |= TX_FLAG_INJECTED; + if (!no_encrypt) + pkt_data-flags |= NL80211_FLAG_ENCRYPT; skb-dev = sdata-master; sdata-stats.tx_packets++; @@ -1640,11 +1671,12 @@
Re: [RFC] add nl80211
This patch adds nl80211, a netlink based configuration system for wireless hardware. It currently features a few helper commands and commands to add and remove virtual interfaces and to inject packets. Support for nl80211 in d80211 is in a follow-up patch. It requires the patches in http://marc.theaimsgroup.com/?l=linux-netdevm=115625436628696w=2 and http://marc.theaimsgroup.com/?l=linux-netdevm=115625168405439w=2 (the latter doesn't apply cleanly against wireless-dev, but you can safely ignore the pieces that don't, at least for wireless testing :) ) Signed-off-by: Johannes Berg [EMAIL PROTECTED] --- /dev/null 1970-01-01 00:00:00.0 + +++ wireless-dev/include/net/nl80211.h 2006-08-24 17:02:01.0 +0200 @@ -0,0 +1,83 @@ +#ifndef __NET_NL80211_H +#define __NET_NL80211_H + +#include linux/netlink.h +#include linux/nl80211.h +#include linux/skbuff.h +#include linux/netdevice.h +#include net/genetlink.h + +/* + * 802.11 netlink in-kernel interface + * + * Copyright 2006 Johannes Berg [EMAIL PROTECTED] + */ + +/** + * struct nl80211_ops - backend description for wireless configuration + * + * This struct is registered by fullmac card drivers and/or wireless stacks + * in order to handle configuration requests on their interfaces. + * + * The priv pointer passed to each call is the pointer that was + * registered in nl80211_register_driver(). + * + * All callbacks except where otherwise noted should return 0 + * on success or a negative error code. + * + * @list_interfaces: for each interfaces belonging to the wiphy identified + * by the priv pointer, call the one() function with the + * given data and the ifindex. This callback is required. + * + * @inject_packet: inject the given frame with the NL80211_FLAG_* + *flags onto the given queue. + * + * @add_virtual_intf: create a new virtual interface with the given name + * + * @del_virtual_intf: remove the virtual interface determined by ifindex. + */ +struct nl80211_ops { + int (*list_interfaces)(void *priv, void *data, + int (*one)(void *data, int ifindex)); + int (*inject_packet)(void *priv, void *frame, int framelen, +u32 flags, int queue); + + int (*add_virtual_intf)(void *priv, char *name, + unsigned int type); + int (*del_virtual_intf)(void *priv, int ifindex); + + /* more things to be added... +* +* for a (*configure)(...) call I'd probably guess that the +* best bet would be to have one call that returns all +* possible options, one that sets them based on the +* struct genl_info *info, and one for that optimised +* set-at-once thing. +*/ +}; + +/* + * register a given method structure with the nl80211 system + * and associate the 'priv' pointer with it. + * + * Returns a positive wiphy index or a negative error code. + * + * NOTE: for proper operation, this priv pointer MUST also be + * assigned to each struct net_device's @ieee80211_ptr member! + */ +extern int nl80211_register(struct nl80211_ops *ops, void *priv); +/* + * unregister a device with the given priv pointer. + * After this call, no more requests can be made with this priv + * pointer, but the call may sleep to wait for an outstanding + * request that is being handled. + */ +extern void nl80211_unregister(void *priv); + +/* helper functions */ +extern void *nl80211hdr_put(struct sk_buff *skb, u32 pid, + u32 seq, int flags, u8 cmd); +extern void *nl80211msg_new(struct sk_buff **skb, u32 pid, + u32 seq, int flags, u8 cmd); + +#endif /* __NET_NL80211_H */ --- wireless-dev.orig/net/Kconfig 2006-08-24 17:02:00.0 +0200 +++ wireless-dev/net/Kconfig2006-08-24 17:02:01.0 +0200 @@ -250,6 +250,9 @@ source net/ieee80211/Kconfig config WIRELESS_EXT bool +config NETLINK_80211 + tristate + endif # if NET endmenu # Networking --- wireless-dev.orig/net/Makefile 2006-08-24 17:02:00.0 +0200 +++ wireless-dev/net/Makefile 2006-08-24 17:02:01.0 +0200 @@ -44,6 +44,7 @@ obj-$(CONFIG_ECONET) += econet/ obj-$(CONFIG_VLAN_8021Q) += 8021q/ obj-$(CONFIG_IP_DCCP) += dccp/ obj-$(CONFIG_IP_SCTP) += sctp/ +obj-$(CONFIG_NETLINK_80211)+= wireless/ obj-$(CONFIG_D80211) += d80211/ obj-$(CONFIG_IEEE80211)+= ieee80211/ obj-$(CONFIG_TIPC) += tipc/ --- /dev/null 1970-01-01 00:00:00.0 + +++ wireless-dev/net/wireless/Makefile 2006-08-24 17:02:01.0 +0200 @@ -0,0 +1,4 @@ +obj-$(CONFIG_NETLINK_80211) += cfg80211.o + +cfg80211-objs := \ + nl80211.o --- /dev/null 1970-01-01 00:00:00.0 + +++ wireless-dev/net/wireless/nl80211.c 2006-08-24 18:03:58.0 +0200 @@ -0,0 +1,583 @@ +/* + * This is the new netlink-based
Re: [PATCH] ethtool v4: add autoneg advertise feature
Auke Kok wrote: Michael Chan wrote: Jeff Kirsher wrote: The old way of setting autonegotiation was using the following command: ethtool -s ethx speed 100 duplex full auto on now the command would be ethtool -s ethx auto on advertise 0x08 both commands would result in only advertising 100 FULL. There still needs to be a change made to the man file to reflect the change in the behavior of ethtool, which I have not done. But this patch will allow for greater flexibility in setting autonegotiation speeds. It is more flexible, but less intuitive. The user now has to remember hex values instead of the more intuitive speed and duplex. Perhaps we can keep the old method of using speed and duplex, while adding the new method of specifying hex values? the patch doesn't remove the old method, it merely adds a second path to the speed/duplex setting. Using the old syntax will still work. hmm, I'm not saying I was wrong there and that if the patch did remove the old method there will certainly be a new patch that keeps the old functionality. okay okay, I am ;) Auke - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] ethtool v4: add autoneg advertise feature
On 8/24/06, Auke Kok [EMAIL PROTECTED] wrote: the patch doesn't remove the old method, it merely adds a second path to the speed/duplex setting. Using the old syntax will still work. Cheers, Auke Actually, I did remove the functionality of the old method. The attached patch revises that. I will also send this revised patch inline and not as an attachment. -- Cheers, Jeff ethtool v4: add autoneg advertise feature From: Jeff Kirsher [EMAIL PROTECTED] adds the ability to change the advertised speed and duplex for a network interface. Previously, a network interface was only able to advertise all supported speed's and duplex's, or one individual speed and duplex. The feature allows the user to choose which supported speed's and duplex's to advertise by using the hex value. --- ethtool.c | 12 +++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/ethtool.c b/ethtool.c index 87e22ab..b7f189a 100644 --- a/ethtool.c +++ b/ethtool.c @@ -99,6 +99,7 @@ static struct option { [ duplex half|full ]\n [ port tp|aui|bnc|mii|fibre ]\n [ autoneg on|off ]\n +[ advertise %%x ]\n [ phyad %%d ]\n [ xcvr internal|external ]\n [ wol p|u|m|b|a|g|s|d... ]\n @@ -549,6 +550,15 @@ static void parse_cmdline(int argc, char show_usage(1); } break; + } else if (!strcmp(argp[i], advertise)) { +gset_changed = 1; +i += 1; +if (i = argc) + show_usage(1); +advertising_wanted = strtol(argp[i], NULL, 16); +if (advertising_wanted 0) + show_usage(1); +break; } else if (!strcmp(argp[i], phyad)) { gset_changed = 1; i += 1; @@ -601,7 +611,7 @@ static void parse_cmdline(int argc, char } } - if (autoneg_wanted == AUTONEG_ENABLE){ + if ((autoneg_wanted == AUTONEG_ENABLE) (advertising_wanted 0)) { if (speed_wanted == SPEED_10 duplex_wanted == DUPLEX_HALF) advertising_wanted = ADVERTISED_10baseT_Half; else if (speed_wanted == SPEED_10
[REVISED] [PATCH] ethtool v4: add autoneg advertise feature
adds the ability to change the advertised speed and duplex for a network interface. Previously, a network interface was only able to advertise all supported speed's and duplex's, or one individual speed and duplex. The feature allows the user to choose which supported speed's and duplex's to advertise by using the hex value. Signed-off-by: Jeff Kirsher [EMAIL PROTECTED] Signed-off-by: Auke Kok [EMAIL PROTECTED] --- ethtool.c | 12 +++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/ethtool.c b/ethtool.c index 87e22ab..b7f189a 100644 --- a/ethtool.c +++ b/ethtool.c @@ -99,6 +99,7 @@ static struct option { [ duplex half|full ]\n [ port tp|aui|bnc|mii|fibre ]\n [ autoneg on|off ]\n + [ advertise %%x ]\n [ phyad %%d ]\n [ xcvr internal|external ]\n [ wol p|u|m|b|a|g|s|d... ]\n @@ -549,6 +550,15 @@ static void parse_cmdline(int argc, char show_usage(1); } break; + } else if (!strcmp(argp[i], advertise)) { + gset_changed = 1; + i += 1; + if (i = argc) + show_usage(1); + advertising_wanted = strtol(argp[i], NULL, 16); + if (advertising_wanted 0) + show_usage(1); + break; } else if (!strcmp(argp[i], phyad)) { gset_changed = 1; i += 1; @@ -601,7 +611,7 @@ static void parse_cmdline(int argc, char } } - if (autoneg_wanted == AUTONEG_ENABLE){ + if ((autoneg_wanted == AUTONEG_ENABLE) (advertising_wanted 0)) { if (speed_wanted == SPEED_10 duplex_wanted == DUPLEX_HALF) advertising_wanted = ADVERTISED_10baseT_Half; else if (speed_wanted == SPEED_10 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC] make d80211 use nl80211
On Thursday 24 August 2006 18:07, Johannes Berg wrote: new version of this one too... -- Subject: d80211: use nl80211 This patch makes d80211 partially configurable using the infrastructure that nl80211 provides. So far, it allows packet injection and adding/removing virtual interfaces. Signed-off-by: Johannes Berg [EMAIL PROTECTED] +static int ieee80211_inject(void *priv, void *frame, int framelen, u32 flags, + int queue) +{ + struct ieee80211_local *local = priv; + struct ieee80211_tx_packet_data *pkt_data; + struct sk_buff *pkt; + void *pktdata; + + pkt = alloc_skb(framelen, GFP_KERNEL); if (!pkt) return -ENOMEM; + pktdata = skb_put(pkt, framelen); + memcpy(pktdata, frame, framelen); having two variables with almost the same name seems confusing to me. What about removing void *pktdata; and doing the following instead of the two lines above? memcpy(skb_put(pkt, framelen), frame, framelen); That is also how it's done in lots of other networking code. + pkt_data = (struct ieee80211_tx_packet_data *) pkt-cb; + pkt_data-ifindex = local-mdev-ifindex; + pkt_data-internal_flags = TX_FLAG_INJECTED; + pkt_data-flags = flags; + /* FIXME: never used, I think? Or could be invalid? */ + pkt_data-queue = queue; + + /* FIXME */ + pkt-priority = 20; /* use hardcoded priority for mgmt TX queue */ + + pkt-dev = local-mdev; + dev_queue_xmit(pkt); + + return 0; +} The other code looks fine to me (the add nl80211 patch, too). -- Greetings Michael. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: TCP ACK
On Thu, 24 Aug 2006 23:03:22 +0800 Majumder, Rajib [EMAIL PROTECTED] wrote: Hi, I had a fundamental question regarding stack. When does TCP ack a segment? Is it immediately receiving a segment or after copying the data from kernel to user i.e after read() system call returns? Any input is highly appreciated. Thanks Rajib TCP ack's when segment is received and placed in the socket buffer. For questions like this, you are better off looking at traditional unix network programming books http://www.thefreecountry.com/documentation/unixbooks.shtml -- Stephen Hemminger [EMAIL PROTECTED] All non-trivial abstractions, to some degree, are leaky. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC] add nl80211
* Johannes Berg [EMAIL PROTECTED] 2006-08-24 18:07 +static int nl80211_get_cmdlist(struct sk_buff *skb, struct genl_info *info) +{ + struct nl80211_registered_driver *drv; + struct sk_buff *msg; + void *hdr; + int err; + struct nlattr *start; + u8 *data; + + drv = nl80211_get_drv_from_info(info); + if (IS_ERR(drv)) + return PTR_ERR(drv); + + hdr = nl80211msg_new(msg, info-snd_pid, info-snd_seq, 0, + NL80211_CMD_NEW_CMDLIST); + if (IS_ERR(hdr)) { + err = PTR_ERR(hdr); + goto put_drv; + } + + NLA_PUT_U32(msg, NL80211_ATTR_WIPHY, drv-wiphy); + + start = nla_nest_start(msg, NL80211_ATTR_CMDS); + if (!start) + goto nla_put_failure; + data = nla_data(start); This data variable is now unused. +static int nl80211_get_wiphys(struct sk_buff *skb, struct genl_info *info) +{ + struct sk_buff *msg; + void *hdr; + struct nlattr *start; + u32 *data; + struct nl80211_registered_driver *drv; + + hdr = nl80211msg_new(msg, info-snd_pid, info-snd_seq, 0, + NL80211_CMD_NEW_WIPHYS); + if (IS_ERR(hdr)) + return PTR_ERR(hdr); + + start = nla_nest_start(msg, NL80211_ATTR_WIPHY); + if (!start) + goto nla_put_failure; + data = nla_data(start); + + mutex_lock(nl80211_drv_mutex); + list_for_each_entry(drv, nl80211_drv_list, list) { + skb_put(msg, sizeof(*data)); + *data++ = drv-wiphy; + } I'd use normal u32 attributes here as well and simply enumerate their type 1..n. int idx = 1 list_for_each_entry(drv, nl80211_drv_list, list) NLA_PUT_U32(msg, idx++, drv-wiphy); The additional header seems waste but this way you stay flexible and can extend the protocol later on. Attribute lengths are checked with an open end in mind, i.e. you can put more stuff behind that u32 in the future and your old applications will still work. You also might want to consider returning ifindex and the associated name. +static int addifidx(void *data, int ifidx) +{ + struct sk_buff *msg = data; + u32 *p; + + if (unlikely(skb_tailroom(msg) 4)) + return -ENOSPC; + + p = (u32*)skb_put(msg, 4); + *p = ifidx; + + return 0; +} Same here, just use nla_put_u32() +static int nl80211_get_intfs(struct sk_buff *skb, struct genl_info *info) +{ + struct nl80211_registered_driver *drv; + struct sk_buff *msg; + void *hdr; + int err; + struct nlattr *start; + u8 *data; + + drv = nl80211_get_drv_from_info(info); + if (IS_ERR(drv)) + return PTR_ERR(drv); + + hdr = nl80211msg_new(msg, info-snd_pid, info-snd_seq, 0, + NL80211_CMD_GET_INTERFACES); + if (IS_ERR(hdr)) { + err = PTR_ERR(hdr); + goto put_drv; + } + + NLA_PUT_U32(msg, NL80211_ATTR_WIPHY, drv-wiphy); + + start = nla_nest_start(msg, NL80211_ATTR_IFINDEX); Try not to reuse the same attribute type for different purposes, it will force you to duplicate the validation policy for every single command and things become very error prone. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC] make d80211 use nl80211
* Michael Buesch [EMAIL PROTECTED] 2006-08-24 19:09 On Thursday 24 August 2006 18:07, Johannes Berg wrote: + pkt = alloc_skb(framelen, GFP_KERNEL); if (!pkt) return -ENOMEM; + pktdata = skb_put(pkt, framelen); + memcpy(pktdata, frame, framelen); having two variables with almost the same name seems confusing to me. What about removing void *pktdata; and doing the following instead of the two lines above? memcpy(skb_put(pkt, framelen), frame, framelen); That is also how it's done in lots of other networking code. You might want to use 'skb' instead of 'pkt', everyone has got used to it. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 1/4] Try 2: Add wireless statistics to d80211
Why have both signal and rssi measures? Simon -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Larry Finger Sent: Wednesday, August 23, 2006 8:02 PM To: Jiri Benc Cc: John Linville; netdev@vger.kernel.org Subject: [PATCH 1/4] Try 2: Add wireless statistics to d80211 This patch modifies d80211 to add wireless statistics. Signed-Off-By: Larry [EMAIL PROTECTED] == diff --git a/include/net/d80211.h b/include/net/d80211.h index 42fdbf7..70655dc 100644 --- a/include/net/d80211.h +++ b/include/net/d80211.h @@ -205,6 +205,8 @@ struct ieee80211_rx_status { int channel; int phymode; int ssi; + int signal; + int noise; int antenna; int rate; int flag; @@ -499,6 +501,9 @@ struct ieee80211_hw { /* This is the time in us to change channels */ int channel_change_time; + /* This is maximum value of rssi reported by this interface +*/ + int maxssi; int num_modes; struct ieee80211_hw_modes *modes; diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c index e72721f..2549484 100644 --- a/net/d80211/ieee80211.c +++ b/net/d80211/ieee80211.c @@ -3175,6 +3175,8 @@ ieee80211_rx_h_sta_process(struct ieee80 sta-rx_fragments++; sta-rx_bytes += rx-skb-len; sta-last_rssi = rx-u.rx.status-ssi; + sta-last_signal = rx-u.rx.status-signal; + sta-last_noise = rx-u.rx.status-noise; if (!(rx-fc IEEE80211_FCTL_MOREFRAGS)) { /* Change STA power saving mode only in the end of a frame diff --git a/net/d80211/ieee80211_i.h b/net/d80211/ieee80211_i.h index 0d2d79d..1271513 100644 --- a/net/d80211/ieee80211_i.h +++ b/net/d80211/ieee80211_i.h @@ -336,6 +336,7 @@ struct ieee80211_local { struct net_device *apdev; /* wlan#ap - management frames (hostapd) */ int open_count; int monitors; + struct iw_statistics wstats; struct ieee80211_conf conf; int dev_index; diff --git a/net/d80211/ieee80211_ioctl.c b/net/d80211/ieee80211_ioctl.c index 89a58e3..b121302 100644 --- a/net/d80211/ieee80211_ioctl.c +++ b/net/d80211/ieee80211_ioctl.c @@ -1581,6 +1581,16 @@ static int ieee80211_ioctl_giwrange(stru range-min_frag = 256; range-max_frag = 2346; + range-max_qual.qual = 100; + range-max_qual.level = 146; /* set floor at -110 dBm (146 - 256) */ + range-max_qual.noise = 146; + range-max_qual.updated = IW_QUAL_ALL_UPDATED; + + range-avg_qual.qual = 50; + range-avg_qual.level = 0; + range-avg_qual.noise = 0; + range-avg_qual.updated = IW_QUAL_ALL_UPDATED; + return 0; } @@ -2996,6 +3006,39 @@ static int ieee80211_ioctl_siwauth(struc return ret; } +/* Get wireless statistics. Called by /proc/net/wireless and by +SIOCGIWSTATS */ static struct iw_statistics +*ieee80211_get_wireless_stats(struct net_device *net_dev) { + struct ieee80211_local *local = net_dev-ieee80211_ptr; + struct iw_statistics * wstats = local-wstats; + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(net_dev); + struct sta_info *sta; + static int tmp_level = 0; + static int tmp_qual = 0; + + sta = sta_info_get(local, sdata-u.sta.bssid); + if (!sta) { + wstats-discard.fragment = 0; + wstats-discard.misc = 0; + wstats-qual.qual = 0; + wstats-qual.level = 0; + wstats-qual.noise = 0; + wstats-qual.updated = IW_QUAL_ALL_INVALID; + } else { + if (!tmp_level) { /* get initial values */ + tmp_level = sta-last_signal; + tmp_qual = sta-last_rssi; + } else {/* smooth results */ + tmp_level = (15 * tmp_level + sta-last_signal)/16; + tmp_qual = (15 * tmp_qual + sta-last_rssi)/16; + } + wstats-qual.level = tmp_level; + wstats-qual.qual = 100*tmp_qual/local-hw-maxssi; + wstats-qual.noise = sta-last_noise; + wstats-qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM; + } + return wstats; +} static int ieee80211_ioctl_giwauth(struct net_device *dev, struct iw_request_info *info, @@ -3019,7 +3062,6 @@ static int ieee80211_ioctl_giwauth(struc return ret; } - static int ieee80211_ioctl_siwencodeext(struct net_device *dev, struct iw_request_info *info, struct iw_point *erq, char *extra) @@ -3184,6 +3226,7 @@ const struct iw_handler_def ieee80211_iw .standard = (iw_handler *) ieee80211_handler, .private= (iw_handler *) ieee80211_private_handler, .private_args =
[PATCH 0/3] secid reconciliation-v01: Repost patchset with updates
The following are the changes included in this patchset since the previous post: - Use SELinux transition rules instead of precedence when reconciling the secid's making it flexible/policy-driven; xfrm secid would prevail by default. - Change the naming of access vector perms to flow_in and flow_out. - Make selinux_xfrm_sock_rcv_skb checks conditional on compat_net. - Switch selinux_inet_conn_request to use secmark; cipso is still allowed to override secmark currently in this regard (will rely on Paul Moore at HP to bring cipso into the reconciliation path). This patchset is relative to David Miller's net-2.6.19.git. Please consider for inclusion in 2.6.19. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/3] secid reconciliation-v01: add LSM hooks
Add skb_policy_check hook to LSM to enable reconciliation of the various security identifiers as well as enforce flow control on inbound (INPUT/FORWARD) traffic. Also defines reconciliation for SELinux. Signed-off-by: Venkat Yekkirala [EMAIL PROTECTED] --- include/linux/security.h | 16 security/dummy.c |7 +++ security/selinux/hooks.c | 60 +-- security/selinux/ss/mls.c |2 + security/selinux/ss/services.c |2 + 5 files changed, 76 insertions(+), 11 deletions(-) --- net-2.6.19.sid1/include/linux/security.h2006-08-24 09:19:12.0 -0500 +++ net-2.6.19.sid2/include/linux/security.h2006-08-24 09:55:39.0 -0500 @@ -828,6 +828,9 @@ struct request_sock; * Sets the new child socket's sid to the openreq sid. * @req_classify_flow: * Sets the flow's sid to the openreq sid. + * @skb_policy_check: + * Checks to see if security policy would allow skb into the system. + * Returns 1 if skb allowed into system, 0 otherwise. * * Security hooks for XFRM operations. * @@ -1372,6 +1375,7 @@ struct security_operations { struct request_sock *req); void (*inet_csk_clone)(struct sock *newsk, const struct request_sock *req); void (*req_classify_flow)(const struct request_sock *req, struct flowi *fl); + int (*skb_policy_check)(struct sk_buff *skb, unsigned short family); #endif /* CONFIG_SECURITY_NETWORK */ #ifdef CONFIG_SECURITY_NETWORK_XFRM @@ -2946,6 +2950,12 @@ static inline void security_req_classify security_ops-req_classify_flow(req, fl); } +static inline int security_skb_policy_check(struct sk_buff *skb, + unsigned short family) +{ + return security_ops-skb_policy_check(skb, family); +} + static inline void security_sock_graft(struct sock* sk, struct socket *parent) { security_ops-sock_graft(sk, parent); @@ -3097,6 +3107,12 @@ static inline void security_req_classify { } +static inline int security_skb_policy_check(struct sk_buff *skb, + unsigned short family) +{ + return 1; +} + static inline void security_sock_graft(struct sock* sk, struct socket *parent) { } --- net-2.6.19.sid1/security/dummy.c2006-08-24 09:19:13.0 -0500 +++ net-2.6.19.sid2/security/dummy.c2006-08-24 09:55:39.0 -0500 @@ -832,6 +832,12 @@ static inline void dummy_req_classify_fl struct flowi *fl) { } + +static inline int dummy_skb_policy_check(struct sk_buff *skb, + unsigned short family) +{ + return 1; +} #endif /* CONFIG_SECURITY_NETWORK */ #ifdef CONFIG_SECURITY_NETWORK_XFRM @@ -1108,6 +1114,7 @@ void security_fixup_ops (struct security set_to_dummy_if_null(ops, inet_conn_request); set_to_dummy_if_null(ops, inet_csk_clone); set_to_dummy_if_null(ops, req_classify_flow); + set_to_dummy_if_null(ops, skb_policy_check); #endif /* CONFIG_SECURITY_NETWORK */ #ifdef CONFIG_SECURITY_NETWORK_XFRM set_to_dummy_if_null(ops, xfrm_policy_alloc_security); --- net-2.6.19.sid1/security/selinux/hooks.c2006-08-24 09:19:13.0 -0500 +++ net-2.6.19.sid2/security/selinux/hooks.c2006-08-24 10:00:12.0 -0500 @@ -3447,8 +3447,12 @@ static int selinux_sock_rcv_skb_compat(s err = avc_has_perm(sock_sid, port_sid, sock_class, recv_perm, ad); + if (err) + goto out; } + err = selinux_xfrm_sock_rcv_skb(sock_sid, skb, ad); + out: return err; } @@ -3487,10 +3491,6 @@ static int selinux_socket_sock_rcv_skb(s goto out; err = selinux_netlbl_sock_rcv_skb(sksec, skb, ad); - if (err) - goto out; - - err = selinux_xfrm_sock_rcv_skb(sksec-sid, skb, ad); out: return err; } @@ -3622,13 +3622,16 @@ static int selinux_inet_conn_request(str return 0; } - err = selinux_xfrm_decode_session(skb, peersid, 0); - BUG_ON(err); - - if (peersid == SECSID_NULL) { - req-secid = sksec-sid; - return 0; - } + if (selinux_compat_net) { + err = selinux_xfrm_decode_session(skb, peersid, 0); + BUG_ON(err); + + if (peersid == SECSID_NULL) { + req-secid = sksec-sid; + return 0; + } + } else + peersid = skb-secmark; err = security_sid_mls_copy(sksec-sid, peersid, newsid); if (err) @@ -3656,6 +3659,40 @@ static void selinux_req_classify_flow(co fl-secid = req-secid; } +static int selinux_skb_policy_check(struct sk_buff *skb, unsigned short family) +{ + u32 xfrm_sid, trans_sid; + int err; + + if (selinux_compat_net) + return 1; + + err =
[PATCH 1/3] secid reconciliation-v01
Currently a packet accumulates multiple security identifiers, each of a different class, as it enters the system. This patch set reconciles these identifiers into a single identifier while also allowing LSM (SELinux is addressed in this patch set) to impose flow control checks based on the identifiers. The reconciliation steps for SELinux are explained in the Labeled Networking document at: http://marc.theaimsgroup.com/?l=linux-netdevm=115136637800361w=2 with the change that SELinux transition rules are used when available to arrive at the new secid. The following are the identifiers handled here: 1. secmark on the skb 2. xfrm security identifier associated with the skb if it used any xfrms, a zero secid otherwise. This patch: Add new flask definitions to SELinux Adds a new avperm come_thru to arbitrate among the identifiers on the inbound (input/forward). Also adds a new avperm go_thru to enable flow control checks on the outbound (output/forward), addressed in a later patch. Signed-off-by: Venkat Yekkirala [EMAIL PROTECTED] --- security/selinux/include/av_perm_to_string.h |2 ++ security/selinux/include/av_permissions.h|2 ++ 2 files changed, 4 insertions(+) --- net-2.6.19.orig/security/selinux/include/av_permissions.h 2006-08-24 09:19:13.0 -0500 +++ net-2.6.19.sid1/security/selinux/include/av_permissions.h 2006-08-24 09:43:09.0 -0500 @@ -962,6 +962,8 @@ #define PACKET__SEND 0x0001UL #define PACKET__RECV 0x0002UL #define PACKET__RELABELTO 0x0004UL +#define PACKET__FLOW_IN 0x0008UL +#define PACKET__FLOW_OUT 0x0010UL #define KEY__VIEW 0x0001UL #define KEY__READ 0x0002UL --- net-2.6.19.orig/security/selinux/include/av_perm_to_string.h 2006-08-24 09:19:13.0 -0500 +++ net-2.6.19.sid1/security/selinux/include/av_perm_to_string.h 2006-08-24 09:43:09.0 -0500 @@ -245,6 +245,8 @@ S_(SECCLASS_PACKET, PACKET__SEND, send) S_(SECCLASS_PACKET, PACKET__RECV, recv) S_(SECCLASS_PACKET, PACKET__RELABELTO, relabelto) + S_(SECCLASS_PACKET, PACKET__FLOW_IN, flow_in) + S_(SECCLASS_PACKET, PACKET__FLOW_OUT, flow_out) S_(SECCLASS_KEY, KEY__VIEW, view) S_(SECCLASS_KEY, KEY__READ, read) S_(SECCLASS_KEY, KEY__WRITE, write) - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/3] secid reconciliation-v01: core networking changes
Invoke the skb_policy_check LSM hook from within networking code. This is being done at the same time and as a part of checking xfrm policy. This is hopefully adequate (not anticipating IP protos that don't use xfrm). Signed-off-by: Venkat Yekkirala [EMAIL PROTECTED] --- include/net/xfrm.h | 50 +++ 1 file changed, 27 insertions(+), 23 deletions(-) --- net-2.6.19.sid2/include/net/xfrm.h 2006-08-24 09:19:13.0 -0500 +++ net-2.6.19.sid3/include/net/xfrm.h 2006-08-24 11:00:27.0 -0500 @@ -663,22 +663,20 @@ extern int __xfrm_policy_check(struct so static inline int xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb, unsigned short family) { - if (sk sk-sk_policy[XFRM_POLICY_IN]) - return __xfrm_policy_check(sk, dir, skb, family); - - return (!xfrm_policy_count[dir] !skb-sp) || - (skb-dst-flags DST_NOPOLICY) || - __xfrm_policy_check(sk, dir, skb, family); -} - -static inline int xfrm4_policy_check(struct sock *sk, int dir, struct sk_buff *skb) -{ - return xfrm_policy_check(sk, dir, skb, AF_INET); -} + int ret; -static inline int xfrm6_policy_check(struct sock *sk, int dir, struct sk_buff *skb) -{ - return xfrm_policy_check(sk, dir, skb, AF_INET6); + if (sk sk-sk_policy[XFRM_POLICY_IN]) + ret = __xfrm_policy_check(sk, dir, skb, family); + else + ret = (!xfrm_policy_count[dir] !skb-sp) || + (skb-dst-flags DST_NOPOLICY) || + __xfrm_policy_check(sk, dir, skb, family); + +#ifdef CONFIG_SECURITY_NETWORK + if (ret) + ret = security_skb_policy_check(skb, family); +#endif /* CONFIG_SECURITY_NETWORK */ + return ret; } extern int xfrm_decode_session(struct sk_buff *skb, struct flowi *fl, unsigned short family); @@ -730,20 +728,26 @@ static inline void xfrm_sk_free_policy(s static inline int xfrm_sk_clone_policy(struct sock *sk) { return 0; } static inline int xfrm6_route_forward(struct sk_buff *skb) { return 1; } static inline int xfrm4_route_forward(struct sk_buff *skb) { return 1; } -static inline int xfrm6_policy_check(struct sock *sk, int dir, struct sk_buff *skb) -{ - return 1; -} -static inline int xfrm4_policy_check(struct sock *sk, int dir, struct sk_buff *skb) -{ - return 1; -} static inline int xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb, unsigned short family) { +#ifdef CONFIG_SECURITY_NETWORK + return security_skb_policy_check(skb, family); +#else return 1; +#endif /* CONFIG_SECURITY_NETWORK */ } #endif +static inline int xfrm4_policy_check(struct sock *sk, int dir, struct sk_buff *skb) +{ + return xfrm_policy_check(sk, dir, skb, AF_INET); +} + +static inline int xfrm6_policy_check(struct sock *sk, int dir, struct sk_buff *skb) +{ + return xfrm_policy_check(sk, dir, skb, AF_INET6); +} + static __inline__ xfrm_address_t *xfrm_flowi_daddr(struct flowi *fl, unsigned short family) { - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/4] Try 2: Add wireless statistics to d80211
Simon Barber wrote: Why have both signal and rssi measures? In the bcm43xx driver, the values are different. There is a routine that converts from rssi as a positive number into signal in a negative number that looks like dBm. Because of the reverse engineering, we have no idea what the logic behind this is, but I thought that we should keep it. Larry - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/3] secid reconciliation-v01: Repost patchset with updates
On Thu, 24 Aug 2006, Venkat Yekkirala wrote: The following are the changes included in this patchset since the previous post: - Use SELinux transition rules instead of precedence when reconciling the secid's making it flexible/policy-driven; xfrm secid would prevail by default. - Change the naming of access vector perms to flow_in and flow_out. - Make selinux_xfrm_sock_rcv_skb checks conditional on compat_net. - Switch selinux_inet_conn_request to use secmark; cipso is still allowed to override secmark currently in this regard (will rely on Paul Moore at HP to bring cipso into the reconciliation path). I like these changes, but wondering why you haven't supplied code for the outbound case ? - James -- James Morris [EMAIL PROTECTED] - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2.6.17 0/9] NetXen: 1G/10G Ethernet Driver - patch for big-endian systems
On Thursday 24 August 2006 22:36, wen xiong wrote: Hi All, This patch brings the NetXen Ethernet driver to work on big-endian systems. I have tested this patch on difference platforms including little-endian and big-endian systems. The patch included: (1)transmit and receive descriptors endian issue fix. (2)MAC address endian issue fix. Next time please inline the patch in the mail. diff -Nuar old/drivers/net/netxen/netxen_nic_hw.c new/drivers/net/netxen/netxen_nic_hw.c --- old/drivers/net/netxen/netxen_nic_hw.c2006-08-23 12:58:43.0 -0500 +++ new/drivers/net/netxen/netxen_nic_hw.c2006-08-23 13:15:19.0 -0500 @@ -313,7 +313,8 @@ } } CMD_DESC_TCP_HDR_OFFSET_WRT(desc, skb-h.raw - skb-data); - desc-ip_hdr_offset = skb-nh.raw - skb-data; + desc-length_tcp_hdr=cpu_to_le32(desc-length_tcp_hdr); ^^^ spaces here, please. + desc-ip_hdr_offset = skb-nh.raw - skb-data; That's one space too much ;) No need to change that line. @@ -832,9 +832,9 @@ rcv_desc-dma_size, PCI_DMA_FROMDEVICE); /* make a rcv descriptor */ - pdesc-reference_handle = __cpu_to_le16(buffer-ref_handle); - pdesc-buffer_length = __cpu_to_le16(rcv_desc-dma_size); - pdesc-addr_buffer = __cpu_to_le64(buffer-dma); + pdesc-reference_handle = le16_to_cpu(buffer-ref_handle); I think that should be cpu_to_le16() (although they are technically equal..) + pdesc-buffer_length = le16_to_cpu(rcv_desc-dma_size); dito diff -Nuar old/drivers/net/netxen/netxen_nic_niu.c new/drivers/net/netxen/netxen_nic_niu.c --- old/drivers/net/netxen/netxen_nic_niu.c 2006-08-23 12:58:43.0 -0500 +++ new/drivers/net/netxen/netxen_nic_niu.c 2006-08-23 13:15:19.0 -0500 @@ -712,6 +712,7 @@ return -EINVAL; memcpy(temp, addr, 2); + temp=cpu_to_le32(temp); I think that should be: temp = le32_to_cpu(temp); temp = 16; if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_1, temp, 4)) @@ -720,6 +721,7 @@ temp = 0; memcpy(temp, ((u8 *) addr) + 2, sizeof(netxen_crbword_t)); + temp=cpu_to_le32(temp); dito if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_HI, temp, 4)) return -EIO; @@ -760,7 +762,7 @@ long netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter, long port, netxen_niu_prom_mode_t mode) { - long reg; + netxen_crbword_t reg; if ((port 0) || (port NETXEN_NIU_MAX_GBE_PORTS)) return -EINVAL; -- Greetings Michael. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2.6.17 0/9] NetXen: 1G/10G Ethernet Driver - patch for big-endian systems
Hi All, This patch brings the NetXen Ethernet driver to work on big-endian systems. I have tested this patch on difference platforms including little-endian and big-endian systems. The patch included: (1)transmit and receive descriptors endian issue fix. (2)MAC address endian issue fix. This patch can apply to the recently NetXen driver submission patches. If you have any questions and comments, please let me know. Thank for your help! wendy Signed-off-by : Wen Xiong [EMAIL PROTECTED] On Tue, 2006-08-22 at 00:43 -0700, Pradeep Dalvi wrote: Hi, This updated patch with name prefix changes is available for download at, http://www.netxen.com/products/downloads/netxen-2.6.17.patch.zip Thanks and regards, pradeep diff -Nuar old/drivers/net/netxen/netxen_nic_hw.c new/drivers/net/netxen/netxen_nic_hw.c --- old/drivers/net/netxen/netxen_nic_hw.c 2006-08-23 12:58:43.0 -0500 +++ new/drivers/net/netxen/netxen_nic_hw.c 2006-08-23 13:15:19.0 -0500 @@ -313,7 +313,8 @@ } } CMD_DESC_TCP_HDR_OFFSET_WRT(desc, skb-h.raw - skb-data); - desc-ip_hdr_offset = skb-nh.raw - skb-data; + desc-length_tcp_hdr=cpu_to_le32(desc-length_tcp_hdr); + desc-ip_hdr_offset = skb-nh.raw - skb-data; adapter-stats.xmitcsummed++; } diff -Nuar old/drivers/net/netxen/netxen_nic_init.c new/drivers/net/netxen/netxen_nic_init.c --- old/drivers/net/netxen/netxen_nic_init.c 2006-08-23 12:58:43.0 -0500 +++ new/drivers/net/netxen/netxen_nic_init.c 2006-08-23 13:15:19.0 -0500 @@ -494,7 +494,7 @@ desc_head = recv_ctx-rcv_status_desc_head; desc = desc_head[consumer]; - if ((desc-owner STATUS_OWNER_HOST)) + if (((le16_to_cpu(desc-owner)) STATUS_OWNER_HOST)) return 1; } @@ -540,12 +540,12 @@ struct netxen_port *port = adapter-port[STATUS_DESC_PORT(desc)]; struct pci_dev *pdev = port-pdev; struct net_device *netdev = port-netdev; - int index = __le16_to_cpu(desc-reference_handle); + int index = le16_to_cpu(desc-reference_handle); struct netxen_recv_context *recv_ctx = (adapter-recv_ctx[ctxid]); struct netxen_rx_buffer *buffer; struct sk_buff *skb; - u32 length = __le16_to_cpu(desc-total_length); + u16 length = le16_to_cpu(desc-total_length); u32 desc_ctx; struct netxen_rcv_desc_ctx *rcv_desc; int ret; @@ -640,7 +640,7 @@ */ while (count max) { desc = desc_head[consumer]; - if (!(desc-owner STATUS_OWNER_HOST)) { + if (!((le16_to_cpu(desc-owner)) STATUS_OWNER_HOST)) { DPRINTK(ERR, desc %p ownedby %x\n, desc, desc-owner); break; } @@ -832,9 +832,9 @@ rcv_desc-dma_size, PCI_DMA_FROMDEVICE); /* make a rcv descriptor */ - pdesc-reference_handle = __cpu_to_le16(buffer-ref_handle); - pdesc-buffer_length = __cpu_to_le16(rcv_desc-dma_size); - pdesc-addr_buffer = __cpu_to_le64(buffer-dma); + pdesc-reference_handle = le16_to_cpu(buffer-ref_handle); + pdesc-buffer_length = le16_to_cpu(rcv_desc-dma_size); + pdesc-addr_buffer = cpu_to_le64(buffer-dma); DPRINTK(INFO, done writing descripter\n); producer = get_next_index(producer, rcv_desc-max_rx_desc_count); diff -Nuar old/drivers/net/netxen/netxen_nic_main.c new/drivers/net/netxen/netxen_nic_main.c --- old/drivers/net/netxen/netxen_nic_main.c 2006-08-23 12:58:43.0 -0500 +++ new/drivers/net/netxen/netxen_nic_main.c 2006-08-23 13:15:19.0 -0500 @@ -746,8 +746,8 @@ hwdesc-opcode = TX_ETHER_PKT; CMD_DESC_PORT_WRT(hwdesc, port-portnum); - hwdesc-buffer1_length = __cpu_to_le16(first_seg_len); - hwdesc-addr_buffer1 = __cpu_to_le64(buffrag-dma); + hwdesc-buffer1_length = cpu_to_le16(first_seg_len); + hwdesc-addr_buffer1 = cpu_to_le64(buffrag-dma); for (i = 1, k = 1; i frag_count; i++, k++) { struct skb_frag_struct *frag; @@ -778,20 +778,20 @@ DPRINTK(INFO, for loop. i=%d k=%d\n, i, k); switch (k) { case 0: - hwdesc-buffer1_length = __cpu_to_le16(temp_len); - hwdesc-addr_buffer1 = __cpu_to_le64(temp_dma); + hwdesc-buffer1_length = cpu_to_le16(temp_len); + hwdesc-addr_buffer1 = cpu_to_le64(temp_dma); break; case 1: - hwdesc-buffer2_length = __cpu_to_le16(temp_len); - hwdesc-addr_buffer2 = __cpu_to_le64(temp_dma); + hwdesc-buffer2_length = cpu_to_le16(temp_len); + hwdesc-addr_buffer2 = cpu_to_le64(temp_dma); break; case 2: - hwdesc-buffer3_length = __cpu_to_le16(temp_len); - hwdesc-addr_buffer3 = __cpu_to_le64(temp_dma); + hwdesc-buffer3_length = cpu_to_le16(temp_len); + hwdesc-addr_buffer3 = cpu_to_le64(temp_dma); break; case 3: hwdesc-buffer4_length = temp_len; - hwdesc-addr_buffer4 = __cpu_to_le64(temp_dma); + hwdesc-addr_buffer4 = cpu_to_le64(temp_dma); break; } frag++; diff -Nuar old/drivers/net/netxen/netxen_nic_niu.c new/drivers/net/netxen/netxen_nic_niu.c --- old/drivers/net/netxen/netxen_nic_niu.c 2006-08-23 12:58:43.0 -0500 +++ new/drivers/net/netxen/netxen_nic_niu.c 2006-08-23 13:15:19.0 -0500 @@ -712,6 +712,7 @@ return -EINVAL;
[PATCH] ssb: minor fixes and cleanups
Hi John, Please apply this to wireless-dev -- Minor fixes and cleanups to the ssb driver. Signed-off-by: Michael Buesch [EMAIL PROTECTED] Index: wireless-dev/drivers/misc/ssb.c === --- wireless-dev.orig/drivers/misc/ssb.c2006-08-24 22:18:03.0 +0200 +++ wireless-dev/drivers/misc/ssb.c 2006-08-24 22:33:44.0 +0200 @@ -518,7 +518,8 @@ { int err; - if (!ssb || !pci_dev || !device_suspend || !device_resume) + if (!ssb || !pci_dev || !mmio || + !device_suspend || !device_resume) return -EINVAL; memset(ssb, 0, sizeof(*ssb)); @@ -551,9 +552,9 @@ list_del(ssb-list); mutex_unlock(ssb_list_mutex); + mutex_destroy(ssb-suspend_mutex); + mutex_destroy(ssb-mutex); kfree(ssb-cores); - if (SSB_DEBUG) - memset(ssb, 0x5B, sizeof(*ssb)); } EXPORT_SYMBOL_GPL(ssb_exit); @@ -592,8 +593,8 @@ return -ENODEV; } -int ssb_switch_core_locked(struct ssb *ssb, - struct ssb_core *new_core) +static int ssb_switch_core_locked(struct ssb *ssb, + struct ssb_core *new_core) { int err = 0; Index: wireless-dev/include/linux/ssb.h === --- wireless-dev.orig/include/linux/ssb.h 2006-08-24 22:18:03.0 +0200 +++ wireless-dev/include/linux/ssb.h2006-08-24 22:28:03.0 +0200 @@ -170,7 +170,7 @@ #define SSB_SPROM2_BFLHI 0x1038 /* Boardflags (high 16 bits) */ #define SSB_SPROM2_MAXP_A 0x103A /* A-PHY Max Power */ #define SSB_SPROM2_MAXP_A_HI 0x00FF /* Max Power High */ -#define SSB_SPROM2_MAXP_A_LO 0x1100 /* Max Power Low */ +#define SSB_SPROM2_MAXP_A_LO 0xFF00 /* Max Power Low */ #define SSB_SPROM2_MAXP_A_LO_SHIFT8 #define SSB_SPROM2_PA1LOB0 0x103C /* A-PHY PowerAmplifier Low Settings */ #define SSB_SPROM2_PA1LOB1 0x103E /* A-PHY PowerAmplifier Low Settings */ -- Greetings Michael. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] ssb: add MAINTAINERS entry
Hi John, Please apply this to wireless-dev. -- Add MAINTAINERS entry for the Sonics Silicon Backplane driver. Signed-off-by: Michael Buesch [EMAIL PROTECTED] Index: wireless-dev/MAINTAINERS === --- wireless-dev.orig/MAINTAINERS 2006-08-24 22:18:03.0 +0200 +++ wireless-dev/MAINTAINERS2006-08-24 22:45:51.0 +0200 @@ -2644,6 +2644,12 @@ L: netdev@vger.kernel.org S: Maintained +SONICS SILICON BACKPLANE DRIVER (SSB) +P: Michael Buesch +M: [EMAIL PROTECTED] +L: netdev@vger.kernel.org +S: Maintained + SONY VAIO CONTROL DEVICE DRIVER P: Stelian Pop M: [EMAIL PROTECTED] -- Greetings Michael. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2.6.17 0/9] NetXen: 1G/10G Ethernet Driver - patch for big-endian systems
wen xiong [EMAIL PROTECTED] : [...] diff -Nuar old/drivers/net/netxen/netxen_nic_hw.c new/drivers/net/netxen/netxen_nic_hw.c --- old/drivers/net/netxen/netxen_nic_hw.c2006-08-23 12:58:43.0 -0500 +++ new/drivers/net/netxen/netxen_nic_hw.c2006-08-23 13:15:19.0 -0500 @@ -313,7 +313,8 @@ } } CMD_DESC_TCP_HDR_OFFSET_WRT(desc, skb-h.raw - skb-data); - desc-ip_hdr_offset = skb-nh.raw - skb-data; + desc-length_tcp_hdr=cpu_to_le32(desc-length_tcp_hdr); s/=/ = / (several occurences) [...] diff -Nuar old/drivers/net/netxen/netxen_nic_init.c new/drivers/net/netxen/netxen_nic_init.c --- old/drivers/net/netxen/netxen_nic_init.c 2006-08-23 12:58:43.0 -0500 +++ new/drivers/net/netxen/netxen_nic_init.c 2006-08-23 13:15:19.0 -0500 @@ -494,7 +494,7 @@ desc_head = recv_ctx-rcv_status_desc_head; desc = desc_head[consumer]; - if ((desc-owner STATUS_OWNER_HOST)) + if (((le16_to_cpu(desc-owner)) STATUS_OWNER_HOST)) Would it make a difference to swab the constant part, i.e.: if (desc-owner cpu_to_le16(STATUS_OWNER_HOST)) -- Ueimor - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/7] [DCCP]: Fixes and enhancements
I spent all of today on USAGI's IPSEC/MIPV6 patches and related issues, so I'll look into this tomorrow. Thanks Ian. Yes I saw that. Take your time as this is nowhere near as important! Regards, Ian -- Ian McDonald Web: http://wand.net.nz/~iam4 Blog: http://imcdnzl.blogspot.com WAND Network Research Group Department of Computer Science University of Waikato New Zealand - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] IP1000A: IC Plus update 2006-08-22
Jesse Huang [EMAIL PROTECTED] : [...] Added: 0039-ip1000-cosmetic-in-ipg_interrupt_handler.txt 0040-ip1000-irq-handler-and-device-close-race.txt 0041-ip1000-schedule-the-host-error-recovery-to-user-context.txt 0042-ip1000-no-need-to-mask-a-constant-field-with-RSVD_MASK.txt ipg_reset() may still delay for several ms in irq context :o( -- Ueimor - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
myri10ge conversion to non-contiguous skb
Hi, During the submission of the myri10ge driver, some people raised the question of using pages (or any kind of non-contiguous skb) instead of our current 16kB contiguous skb. We are looking at this right now and it is not clear what solution is the best. From what we understand, Linux provides two mostly redundant mechanisms to handle discontinuous skb, the skb-frags and the skb-frag_list, s2io using the latter while e1000 uses the former. Is one or the other recommended? What is the purpose of having them both in the net core? Thank you Brice Goglin Imho you will want to work directly with pages shortly. We had thought about doing this, but were a little nervous since we did not know of any other drivers that worked directly with pages. If this is an official direction to work directly with pages, we will. s2io does. e1000 does it with skb frags. If your hardware allows header split and driver can put headers into skb-data and real data into frag_list, that allows to create various interesting things like receiving zero-copy support and netchannels support. It is work in progress, not official direction currently, but this definitely will help your driver to support future high performance extensions. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 44/44] [XFRM] IPV6: Support Mobile IPv6 extension headers sorting.
David Miller wrote: From: Masahide NAKAMURA [EMAIL PROTECTED] Date: Thu, 24 Aug 2006 16:05:39 +0900 David Miller wrote: In the mean time, I will work on porting my XFRM hashing changes for the current net-2.6.19 tree. FYI, your work will not have any conflict with the left of MIPv6 patches which I will describe later since they are almost out of XFRM. Great. I just finished the port and pushed all of that work to net-2.6.19, can folks please take a look? I tested IPSEC as best as I could with XFRM_SUB_POLICY enabled, but I have no way currently to test sub-policies or MIPV6 cases. OK, I will review it and also start my XFRM test with net-2.6.19 as I've done with my tree. Regards, -- Masahide NAKAMURA - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] tcp_lp: use BUILD_BUG_ON
Signed-off-by: Alexey Dobriyan [EMAIL PROTECTED] --- net/ipv4/tcp_lp.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/ipv4/tcp_lp.c +++ b/net/ipv4/tcp_lp.c @@ -321,7 +321,7 @@ static struct tcp_congestion_ops tcp_lp static int __init tcp_lp_register(void) { - BUG_ON(sizeof(struct lp) ICSK_CA_PRIV_SIZE); + BUILD_BUG_ON(sizeof(struct lp) ICSK_CA_PRIV_SIZE); return tcp_register_congestion_control(tcp_lp); } - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] tcp_bic: use BUILD_BUG_ON
Signed-off-by: Alexey Dobriyan [EMAIL PROTECTED] --- net/ipv4/tcp_bic.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/ipv4/tcp_bic.c +++ b/net/ipv4/tcp_bic.c @@ -231,7 +231,7 @@ static struct tcp_congestion_ops bictcp static int __init bictcp_register(void) { - BUG_ON(sizeof(struct bictcp) ICSK_CA_PRIV_SIZE); + BUILD_BUG_ON(sizeof(struct bictcp) ICSK_CA_PRIV_SIZE); return tcp_register_congestion_control(bictcp); } - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] ip6t_REJECT: wire up ip6t_register_target() return value
Signed-off-by: Alexey Dobriyan [EMAIL PROTECTED] --- net/ipv6/netfilter/ip6t_REJECT.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/net/ipv6/netfilter/ip6t_REJECT.c +++ b/net/ipv6/netfilter/ip6t_REJECT.c @@ -256,9 +256,7 @@ static struct ip6t_target ip6t_reject_re static int __init ip6t_reject_init(void) { - if (ip6t_register_target(ip6t_reject_reg)) - return -EINVAL; - return 0; + return ip6t_register_target(ip6t_reject_reg); } static void __exit ip6t_reject_fini(void) - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 40/44] [XFRM] POLICY: sub policy support.
David Miller [EMAIL PROTECTED] wrote: Those socket policies are becomming more and more difficult to deal with. I like them as a feature, but I wonder who uses them :-) They do not live in the flow cache so they hurt performance until we find a way to place them there. Perhaps we can extend the flow keying somehow to account for socket based policies in the flow cache. The KM's use it to allow ISAKMP traffic to punch through IPsec. That should definitely be the exception though. Most apps should have zero socket policies, especially since socket policies need root privileges. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED] Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [take13 1/3] kevent: Core files.
One question on the implementation of kevent_user_ctl_modify/ kevent_user_ctl_remove/kevent_user_ctl_add: What benchmarks did you do to add the separate 'fastpath' with the single onstack ukevent structure if there are three or less events? I can't believe this actually helps in practice for various reasons: - you add quite a lot of icache footprint by duplicating all this code - kmalloc is really fast - two or three small copy_from/to_user calls are quite a bit slower than one that covers the size of all of them. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] ip6t_REJECT: wire up ip6t_register_target() return value
Alexey Dobriyan wrote: Signed-off-by: Alexey Dobriyan [EMAIL PROTECTED] --- net/ipv6/netfilter/ip6t_REJECT.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/net/ipv6/netfilter/ip6t_REJECT.c +++ b/net/ipv6/netfilter/ip6t_REJECT.c @@ -256,9 +256,7 @@ static struct ip6t_target ip6t_reject_re static int __init ip6t_reject_init(void) { - if (ip6t_register_target(ip6t_reject_reg)) - return -EINVAL; - return 0; + return ip6t_register_target(ip6t_reject_reg); } This is already changed in the net-2.6.19 tree. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [take13 1/3] kevent: Core files.
On Thu, Aug 24, 2006 at 09:03:22PM +0100, Christoph Hellwig ([EMAIL PROTECTED]) wrote: One question on the implementation of kevent_user_ctl_modify/ kevent_user_ctl_remove/kevent_user_ctl_add: What benchmarks did you do to add the separate 'fastpath' with the single onstack ukevent structure if there are three or less events? I can't believe this actually helps in practice for various reasons: - you add quite a lot of icache footprint by duplicating all this code - kmalloc is really fast - two or three small copy_from/to_user calls are quite a bit slower than one that covers the size of all of them. kmalloc is really slow actually - it always shows somewhere on top in profiles and brings noticeble overhead (as was shown in network tree allocator project, although there were used bigger allocations). I chose 3 ukevents, since they fit exactly one cache line (on my test machine). In general I try to avoid allocation as much as possible, and more generic usage case (for various servers) to accept one client and add it, instead of waiting for several of them and commit them at once. -- Evgeniy Polyakov - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html