* [PATCH 07/15]drivers:net:wireless:iwlwifi Typo change diable to disable.
From: Justin P. Mattock @ 2010-12-30 23:07 UTC (permalink / raw)
To: trivial-DgEjT+Ai2ygdnm+yROfE0A
Cc: devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
linux-scsi-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
ivtv-devel-jGorlIydJmRM656bX5wj8A,
linux-m68k-cunTk1MwBs8S/qaLPR03pWD2FQJk+8+b, Justin P. Mattock,
spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
linux-media-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1293750484-1161-6-git-send-email-justinmattock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
The below patch fixes a typo "diable" to "disable". Please let me know if this
is correct or not.
Signed-off-by: Justin P. Mattock <justinmattock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
drivers/net/wireless/iwlwifi/iwl-agn-ict.c | 2 +-
drivers/net/wireless/iwlwifi/iwl-agn.c | 4 ++--
drivers/net/wireless/iwlwifi/iwl-core.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-ict.c b/drivers/net/wireless/iwlwifi/iwl-agn-ict.c
index a5dbfea..b5cb3be 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-ict.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-ict.c
@@ -197,7 +197,7 @@ static irqreturn_t iwl_isr(int irq, void *data)
none:
/* re-enable interrupts here since we don't have anything to service. */
- /* only Re-enable if diabled by irq and no schedules tasklet. */
+ /* only Re-enable if disabled by irq and no schedules tasklet. */
if (test_bit(STATUS_INT_ENABLED, &priv->status) && !priv->_agn.inta)
iwl_enable_interrupts(priv);
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index c2636a7..9b912c0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1316,7 +1316,7 @@ static void iwl_irq_tasklet_legacy(struct iwl_priv *priv)
}
/* Re-enable all interrupts */
- /* only Re-enable if diabled by irq */
+ /* only Re-enable if disabled by irq */
if (test_bit(STATUS_INT_ENABLED, &priv->status))
iwl_enable_interrupts(priv);
@@ -1530,7 +1530,7 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
}
/* Re-enable all interrupts */
- /* only Re-enable if diabled by irq */
+ /* only Re-enable if disabled by irq */
if (test_bit(STATUS_INT_ENABLED, &priv->status))
iwl_enable_interrupts(priv);
}
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 25fb391..8700ab3 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1304,7 +1304,7 @@ irqreturn_t iwl_isr_legacy(int irq, void *data)
none:
/* re-enable interrupts here since we don't have anything to service. */
- /* only Re-enable if diabled by irq */
+ /* only Re-enable if disabled by irq */
if (test_bit(STATUS_INT_ENABLED, &priv->status))
iwl_enable_interrupts(priv);
spin_unlock_irqrestore(&priv->lock, flags);
--
1.6.5.2.180.gc5b3e
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
^ permalink raw reply related
* [PATCH 06/15]drivers:staging:xgifb:vb_setmode.c Typo change diable to disable.
From: Justin P. Mattock @ 2010-12-30 23:07 UTC (permalink / raw)
To: trivial-DgEjT+Ai2ygdnm+yROfE0A
Cc: devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
linux-scsi-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
ivtv-devel-jGorlIydJmRM656bX5wj8A,
linux-m68k-cunTk1MwBs8S/qaLPR03pWD2FQJk+8+b, Justin P. Mattock,
spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
linux-media-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1293750484-1161-5-git-send-email-justinmattock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
The below patch fixes a typo "diable" to "disable". Please let me know if this
is correct or not.
Signed-off-by: Justin P. Mattock <justinmattock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
drivers/staging/xgifb/vb_setmode.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c
index 7016fdd..fb49641 100644
--- a/drivers/staging/xgifb/vb_setmode.c
+++ b/drivers/staging/xgifb/vb_setmode.c
@@ -1920,7 +1920,7 @@ void XGI_SetCRT1FIFO(unsigned short ModeNo,
data = XGINew_GetReg1(pVBInfo->P3c4, 0x3D);
data &= 0xfe;
- XGINew_SetReg1(pVBInfo->P3c4, 0x3D, data); /* diable auto-threshold */
+ XGINew_SetReg1(pVBInfo->P3c4, 0x3D, data); /* disable auto-threshold */
if (ModeNo > 0x13) {
XGINew_SetReg1(pVBInfo->P3c4, 0x08, 0x34);
--
1.6.5.2.180.gc5b3e
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
^ permalink raw reply related
* [PATCH 05/15]drivers:staging:vt6655:rf.c Typo change diable to disable.
From: Justin P. Mattock @ 2010-12-30 23:07 UTC (permalink / raw)
To: trivial
Cc: linux-m68k, linux-kernel, netdev, ivtv-devel, linux-media,
linux-wireless, linux-scsi, spi-devel-general, devel, linux-usb,
Justin P. Mattock
In-Reply-To: <1293750484-1161-4-git-send-email-justinmattock@gmail.com>
The below patch fixes a typo "diable" to "disable". Please let me know if this
is correct or not.
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
---
drivers/staging/vt6655/rf.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
index b8ec783..cdd9165 100644
--- a/drivers/staging/vt6655/rf.c
+++ b/drivers/staging/vt6655/rf.c
@@ -496,11 +496,11 @@ bool s_bAL7230Init (unsigned long dwIoBase)
//Calibration
MACvTimer0MicroSDelay(dwIoBase, 150);//150us
- bResult &= IFRFbWriteEmbeded(dwIoBase, (0x9ABA8F00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW)); //TXDCOC:active, RCK:diable
+ bResult &= IFRFbWriteEmbeded(dwIoBase, (0x9ABA8F00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW)); //TXDCOC:active, RCK:disable
MACvTimer0MicroSDelay(dwIoBase, 30);//30us
- bResult &= IFRFbWriteEmbeded(dwIoBase, (0x3ABA8F00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW)); //TXDCOC:diable, RCK:active
+ bResult &= IFRFbWriteEmbeded(dwIoBase, (0x3ABA8F00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW)); //TXDCOC:disable, RCK:active
MACvTimer0MicroSDelay(dwIoBase, 30);//30us
- bResult &= IFRFbWriteEmbeded(dwIoBase, dwAL7230InitTable[CB_AL7230_INIT_SEQ-1]); //TXDCOC:diable, RCK:diable
+ bResult &= IFRFbWriteEmbeded(dwIoBase, dwAL7230InitTable[CB_AL7230_INIT_SEQ-1]); //TXDCOC:diable, RCK:disable
MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, (SOFTPWRCTL_SWPE3 |
SOFTPWRCTL_SWPE2 |
--
1.6.5.2.180.gc5b3e
^ permalink raw reply related
* [PATCH 04/15]drivers:staging:comedi:drivers:das800.c Typo change diable to disable.
From: Justin P. Mattock @ 2010-12-30 23:07 UTC (permalink / raw)
To: trivial
Cc: linux-m68k, linux-kernel, netdev, ivtv-devel, linux-media,
linux-wireless, linux-scsi, spi-devel-general, devel, linux-usb,
Justin P. Mattock
In-Reply-To: <1293750484-1161-3-git-send-email-justinmattock@gmail.com>
The below patch fixes a typo "diable" to "disable". Please let me know if this
is correct or not.
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
---
drivers/staging/comedi/drivers/das800.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/comedi/drivers/das800.c b/drivers/staging/comedi/drivers/das800.c
index aecaedc..3ecae47 100644
--- a/drivers/staging/comedi/drivers/das800.c
+++ b/drivers/staging/comedi/drivers/das800.c
@@ -450,7 +450,7 @@ static irqreturn_t das800_interrupt(int irq, void *d)
/* otherwise, stop taking data */
} else {
spin_unlock_irqrestore(&dev->spinlock, irq_flags);
- disable_das800(dev); /* diable hardware triggered conversions */
+ disable_das800(dev); /* disable hardware triggered conversions */
async->events |= COMEDI_CB_EOA;
}
comedi_event(dev, s);
--
1.6.5.2.180.gc5b3e
^ permalink raw reply related
* [PATCH 03/15]drivers:staging:rtl8187se:r8180_hw.h Typo change diable to disable.
From: Justin P. Mattock @ 2010-12-30 23:07 UTC (permalink / raw)
To: trivial-DgEjT+Ai2ygdnm+yROfE0A
Cc: devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
linux-scsi-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
ivtv-devel-jGorlIydJmRM656bX5wj8A,
linux-m68k-cunTk1MwBs8S/qaLPR03pWD2FQJk+8+b, Justin P. Mattock,
spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
linux-media-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1293750484-1161-2-git-send-email-justinmattock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
The below patch fixes a typo "diable" to "disable". Please let me know if this
is correct or not.
Signed-off-by: Justin P. Mattock <justinmattock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
drivers/staging/rtl8187se/r8180_hw.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/rtl8187se/r8180_hw.h b/drivers/staging/rtl8187se/r8180_hw.h
index 3fca144..2911d40 100644
--- a/drivers/staging/rtl8187se/r8180_hw.h
+++ b/drivers/staging/rtl8187se/r8180_hw.h
@@ -554,7 +554,7 @@
/* by amy for power save */
/* by amy for antenna */
#define EEPROM_SW_REVD_OFFSET 0x3f
-/* BIT[8-9] is for SW Antenna Diversity. Only the value EEPROM_SW_AD_ENABLE means enable, other values are diable. */
+/* BIT[8-9] is for SW Antenna Diversity. Only the value EEPROM_SW_AD_ENABLE means enable, other values are disabled. */
#define EEPROM_SW_AD_MASK 0x0300
#define EEPROM_SW_AD_ENABLE 0x0100
--
1.6.5.2.180.gc5b3e
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
^ permalink raw reply related
* RE: [PATCH net-2.6] bridge: fix br_multicast_ipv6_rcv for paged skbs
From: Stephen Hemminger @ 2010-12-30 23:06 UTC (permalink / raw)
To: Winkler, Tomas, Stephen Hemminger, Johannes Berg
Cc: davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org ,
linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Although copy is slower for large packets, this is a non performance path. The code in question is for bridged multicast Ipv6 ICMP packets. This case is so uncritical it could be done in BASIC and no one could possibly care!
"Winkler, Tomas" <tomas.winkler@intel.com> wrote:
>
>
>> -----Original Message-----
>> From: Stephen Hemminger [mailto:shemminger@vyatta.com]
>> Sent: Thursday, December 30, 2010 9:06 PM
>> To: Johannes Berg
>> Cc: Winkler, Tomas; davem@davemloft.net; netdev@vger.kernel.org; linux-
>> wireless@vger.kernel.org
>> Subject: Re: [PATCH net-2.6] bridge: fix br_multicast_ipv6_rcv for paged
>> skbs
>>
>> On Thu, 30 Dec 2010 19:52:14 +0100
>> Johannes Berg <johannes@sipsolutions.net> wrote:
>>
>> > On Thu, 2010-12-30 at 10:46 -0800, Stephen Hemminger wrote:
>> >
>> > > This doesn't look correct. The calculation of the offset doesn't look
>> correct.
>> > > Just following the skb_clone(), the skb_pull value is "offset".
>> > > Also, the other checks return -EINVAL for incorrectly formed packet.
>> > >
>> > > --- a/net/bridge/br_multicast.c 2010-12-30 10:29:58.579510488 -0800
>> > > +++ b/net/bridge/br_multicast.c 2010-12-30 10:43:27.273386691 -0800
>> > > @@ -1464,6 +1464,9 @@ static int br_multicast_ipv6_rcv(struct
>> > > if (offset < 0 || nexthdr != IPPROTO_ICMPV6)
>> > > return 0;
>> > >
>> > > + if (!pskb_may_pull(skb, offset))
>> > > + return -EINVAL;
>> > > +
>> > > /* Okay, we found ICMPv6 header */
>> > > skb2 = skb_clone(skb, GFP_ATOMIC);
>> > > if (!skb2)
>> >
>> > Wouldn't that make more sense after the clone anyway? But if you look at
>> > my email, you'll find that there's potentially, and conditionally, more
>> > stuff that will be read from the skb's header, which hasn't necessarily
>> > been pulled in, so I think this still won't fix all the issues.
>> >
>> > Seeing how this only affects some ICMPv6 packets, maybe we should just
>> > use skb_copy() instead?
>>
>> It comes out cleaner, and the check can be simplified.
>>
>> --- a/net/bridge/br_multicast.c 2010-12-30 10:47:12.031733855 -0800
>> +++ b/net/bridge/br_multicast.c 2010-12-30 11:00:12.135801266 -0800
>> @@ -1465,19 +1465,19 @@ static int br_multicast_ipv6_rcv(struct
>> return 0;
>>
>> /* Okay, we found ICMPv6 header */
>> - skb2 = skb_clone(skb, GFP_ATOMIC);
>> + skb2 = skb_copy(skb, GFP_ATOMIC);
>> if (!skb2)
>> return -ENOMEM;
>>
>> + err = -EINVAL;
>> + if (skb2->len < offset + sizeof(*icmp6h))
>> + goto out;
>> +
>> len -= offset - skb_network_offset(skb2);
>>
>> __skb_pull(skb2, offset);
>> skb_reset_transport_header(skb2);
>>
>> - err = -EINVAL;
>> - if (!pskb_may_pull(skb2, sizeof(*icmp6h)))
>> - goto out;
>> -
>> icmp6h = icmp6_hdr(skb2);
>>
>> switch (icmp6h->icmp6_type) {
>>
>>
>Sorry for dump question but isn't there performance penalty on using skb_copy vs. skb_clone?
>
>Anyhow Below is a code snippet from ip6_input.c so you probably would want to fix it all over.
>BTW offset and the pointer arithmetic really gives the same number +1, I'm not surly why the original author would thought it be safer than just using offset.
>
> offset = ipv6_skip_exthdr(skb, sizeof(*hdr),
> &nexthdr);
> if (offset < 0)
> goto out;
>
> if (nexthdr != IPPROTO_ICMPV6)
> goto out;
>
> if (!pskb_may_pull(skb, (skb_network_header(skb) +
> offset + 1 - skb->data)))
> goto out;
>
> icmp6 = (struct icmp6hdr *)(skb_network_header(skb) + offset);
>
>
>
>Thanks
>Tomas
>
>
>---------------------------------------------------------------------
>Intel Israel (74) Limited
>
>This e-mail and any attachments may contain confidential material for
>the sole use of the intended recipient(s). Any review or distribution
>by others is strictly prohibited. If you are not the intended
>recipient, please contact the sender and delete all copies.
>
^ permalink raw reply
* Re: [PATCH] skge: Do not use legacy PCI power management
From: Rafael J. Wysocki @ 2010-12-30 22:50 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, David Miller, Linux-pm mailing list
In-Reply-To: <20101230105229.189f3737@nehalam>
On Thursday, December 30, 2010, Stephen Hemminger wrote:
> The skge driver used the legacy PCI power management, and did its
> own PCI callbacks. Use the same code model as Rafael's changes to
> sky2. Let the PCI subsystem take care of all the PCI-specific aspects of
> device handling during system power transitions.
>
> Compile tested only (so far).
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
> --- a/drivers/net/skge.c 2010-12-30 10:19:01.191095951 -0800
> +++ b/drivers/net/skge.c 2010-12-30 10:49:30.780295215 -0800
> @@ -4044,53 +4044,40 @@ static void __devexit skge_remove(struct
> }
>
> #ifdef CONFIG_PM
> -static int skge_suspend(struct pci_dev *pdev, pm_message_t state)
> +static int skge_suspend(struct device *dev)
> {
> + struct pci_dev *pdev = to_pci_dev(dev);
> struct skge_hw *hw = pci_get_drvdata(pdev);
> - int i, err, wol = 0;
> + int i;
>
> if (!hw)
> return 0;
>
> - err = pci_save_state(pdev);
> - if (err)
> - return err;
> -
> for (i = 0; i < hw->ports; i++) {
> struct net_device *dev = hw->dev[i];
> struct skge_port *skge = netdev_priv(dev);
>
> if (netif_running(dev))
> skge_down(dev);
> +
> if (skge->wol)
> skge_wol_init(skge);
> -
> - wol |= skge->wol;
> }
>
> skge_write32(hw, B0_IMSK, 0);
>
> - pci_prepare_to_sleep(pdev);
> -
> return 0;
> }
>
> -static int skge_resume(struct pci_dev *pdev)
> +static int skge_resume(struct device *dev)
> {
> + struct pci_dev *pdev = to_pci_dev(dev);
> struct skge_hw *hw = pci_get_drvdata(pdev);
> int i, err;
>
> if (!hw)
> return 0;
>
> - err = pci_back_from_sleep(pdev);
> - if (err)
> - goto out;
> -
> - err = pci_restore_state(pdev);
> - if (err)
> - goto out;
> -
> err = skge_reset(hw);
> if (err)
> goto out;
> @@ -4111,12 +4098,19 @@ static int skge_resume(struct pci_dev *p
> out:
> return err;
> }
> +
> +static SIMPLE_DEV_PM_OPS(skge_pm_ops, skge_suspend, skge_resume);
> +#define SKGE_PM_OPS (&skge_pm_ops)
> +
> +#else
> +
> +#define SKGE_PM_OPS NULL
> #endif
>
> static void skge_shutdown(struct pci_dev *pdev)
> {
> struct skge_hw *hw = pci_get_drvdata(pdev);
> - int i, wol = 0;
> + int i;
>
> if (!hw)
> return;
> @@ -4127,15 +4121,10 @@ static void skge_shutdown(struct pci_dev
>
> if (skge->wol)
> skge_wol_init(skge);
> - wol |= skge->wol;
> }
>
> - if (pci_enable_wake(pdev, PCI_D3cold, wol))
> - pci_enable_wake(pdev, PCI_D3hot, wol);
> -
> - pci_disable_device(pdev);
> + pci_wake_from_d3(pdev, device_may_wakeup(&pdev->dev));
> pci_set_power_state(pdev, PCI_D3hot);
> -
> }
>
> static struct pci_driver skge_driver = {
> @@ -4143,11 +4132,8 @@ static struct pci_driver skge_driver = {
> .id_table = skge_id_table,
> .probe = skge_probe,
> .remove = __devexit_p(skge_remove),
> -#ifdef CONFIG_PM
> - .suspend = skge_suspend,
> - .resume = skge_resume,
> -#endif
> .shutdown = skge_shutdown,
> + .driver.pm = SKGE_PM_OPS,
> };
>
> static struct dmi_system_id skge_32bit_dma_boards[] = {
>
>
^ permalink raw reply
* dm9000: adding support for coldfire
From: Angelo Dureghello @ 2010-12-30 22:28 UTC (permalink / raw)
To: netdev
Hi all,
i have succesfully working dm9000e with MCF5307 with kernel 2.6.36.2.
If the data bus of the cpu (big endian) is cross-wired to the dm9000, no
addition to actual 1.31 driver should be needed (untested, see patch
comments).
In my case, i wired D0:31 of cpu directly straight to D0:31 of dm9000e.
In case this wiring configuration would be supported, i post this patch.
If this "straight-wiring" will not be considered a supported/standard
way of connectiong to dm9000e, i can cross wire the bus on my board.
Regards,
angelo
*** dm9000.c.orig 2010-12-30 23:19:39.747836070 +0100
--- dm9000.c 2010-12-30 22:50:17.167899041 +0100
***************
*** 48,53 ****
--- 48,74 ----
#define CARDNAME "dm9000"
#define DRV_VERSION "1.31"
+ #ifdef CONFIG_COLDFIRE
+ /**
+ * Coldfire processors are big endian, so to use this driver
+ * without any change wiring should be done crossing the bytes:
+ *
+ * 8 bit mode, D24:31 cpu to D0:7 dm9000
+ * 16 bit mode, D24:31 cpu to D0:7 dm9000
+ * D16:23 cpu to D8:15 dm9000
+ * 32 bit mode, D24:31 cpu to D0:7 dm9000
+ * D16:23 cpu to D8:15 dm9000
+ * D8 :15 cpu to D16:23 dm9000
+ * D0 :7 cpu to D24:31 dm9000
+ *
+ * If the Coldfire bus has been wired straight to dm9000,
+ * following define/patch must be used.
+ *
+ * 32 bit mode, D0:31 straight wired : BE2LE32BIT
+ */
+ #define BE2LE32BIT 1
+ #endif
+
/*
* Transmit timeout, default 5 seconds.
*/
***************
*** 158,166 ****
--- 179,195 ----
dev_dbg(db->dev, "resetting device\n");
/* RESET device */
+ #ifdef BE2LE32BIT
+ writel(DM9000_NCR, db->io_addr);
+ #else
writeb(DM9000_NCR, db->io_addr);
+ #endif
udelay(200);
+ #ifdef BE2LE32BIT
+ writel(NCR_RST, db->io_data);
+ #else
writeb(NCR_RST, db->io_data);
+ #endif
udelay(200);
}
***************
*** 170,177 ****
--- 199,211 ----
static u8
ior(board_info_t * db, int reg)
{
+ #ifdef BE2LE32BIT
+ writel(reg, db->io_addr);
+ return (u8)readl(db->io_data);
+ #else
writeb(reg, db->io_addr);
return readb(db->io_data);
+ #endif
}
/*
***************
*** 181,223 ****
--- 215,310 ----
static void
iow(board_info_t * db, int reg, int value)
{
+ #ifdef BE2LE32BIT
+ writel(reg, db->io_addr);
+ writel(value, db->io_data);
+ #else
writeb(reg, db->io_addr);
writeb(value, db->io_data);
+ #endif
}
/* routines for sending block to chip */
static void dm9000_outblk_8bit(void __iomem *reg, void *data, int count)
{
+ #ifdef CONFIG_COLDFIRE
+ u8 *p=(u8 *)data;
+
+ while (count--)
+ #ifdef BE2LE32BIT
+ writel((int)(*p++), reg);
+ #else
+ writeb(*p++, reg);
+ #endif
+ #else
writesb(reg, data, count);
+ #endif
}
static void dm9000_outblk_16bit(void __iomem *reg, void *data, int count)
{
+ #ifdef CONFIG_COLDFIRE
+ // TO DO
+ #else
writesw(reg, data, (count+1) >> 1);
+ #endif
}
static void dm9000_outblk_32bit(void __iomem *reg, void *data, int count)
{
+ #ifdef CONFIG_COLDFIRE
+ u32 *p = (u32*)data;
+
+ count = (count+3)>>2;
+
+ while (count--)
+ writel(le32_to_cpu(*p++), reg);
+ #else
writesl(reg, data, (count+3) >> 2);
+ #endif
}
/* input block from chip to memory */
static void dm9000_inblk_8bit(void __iomem *reg, void *data, int count)
{
+ #ifdef CONFIG_COLDFIRE
+ u8 *p=data;
+
+ while (count--)
+ *p++ = readb(reg);
+ #else
readsb(reg, data, count);
+ #endif
}
static void dm9000_inblk_16bit(void __iomem *reg, void *data, int count)
{
+ #ifdef CONFIG_COLDFIRE
+ #ifdef BE2LE32BIT
+ /* to do */
+ #else
+ /* to do */
+ #endif
+ #else
readsw(reg, data, (count+1) >> 1);
+ #endif
}
static void dm9000_inblk_32bit(void __iomem *reg, void *data, int count)
{
+ #ifdef CONFIG_COLDFIRE
+ unsigned long *p=data;
+
+ count = (count + 3) >> 2;
+
+ while (count--)
+ *p++ = le32_to_cpu(readl(reg));
+ #else
readsl(reg, data, (count+3) >> 2);
+ #endif
}
/* dump block from chip to null */
***************
*** 228,234 ****
--- 315,325 ----
int tmp;
for (i = 0; i < count; i++)
+ #ifdef BE2LE32BIT
+ tmp = readl(reg);
+ #else
tmp = readb(reg);
+ #endif
}
static void dm9000_dumpblk_16bit(void __iomem *reg, int count)
***************
*** 239,245 ****
--- 330,341 ----
count = (count + 1) >> 1;
for (i = 0; i < count; i++)
+ #ifdef BE2LE32BIT
+ tmp = readl(reg);
+ #else
tmp = readw(reg);
+ #endif
+
}
static void dm9000_dumpblk_32bit(void __iomem *reg, int count)
***************
*** 863,870 ****
netif_wake_queue(dev);
/* Restore previous register address */
writeb(reg_save, db->io_addr);
! spin_unlock_irqrestore(&db->lock, flags);
}
static void dm9000_send_packet(struct net_device *dev,
--- 959,971 ----
netif_wake_queue(dev);
/* Restore previous register address */
+ #ifdef BE2LE32BIT
+ writel(reg_save, db->io_addr);
+ #else
writeb(reg_save, db->io_addr);
! #endif
!
! spin_unlock_irqrestore(&db->lock,flags);
}
static void dm9000_send_packet(struct net_device *dev,
***************
*** 908,914 ****
--- 1009,1019 ----
spin_lock_irqsave(&db->lock, flags);
/* Move data to DM9000 TX RAM */
+ #ifdef BE2LE32BIT
+ writel(DM9000_MWCMD, db->io_addr);
+ #else
writeb(DM9000_MWCMD, db->io_addr);
+ #endif
(db->outblk)(db->io_data, skb->data, skb->len);
dev->stats.tx_bytes += skb->len;
***************
*** 981,987 ****
ior(db, DM9000_MRCMDX); /* Dummy read */
/* Get most updated data */
! rxbyte = readb(db->io_data);
/* Status check: this byte must be 0 or 1 */
if (rxbyte & DM9000_PKT_ERR) {
--- 1086,1096 ----
ior(db, DM9000_MRCMDX); /* Dummy read */
/* Get most updated data */
! #ifdef BE2LE32BIT
! rxbyte = (u8)readl(db->io_data);
! #else
! rxbyte = readb(db->io_data);
! #endif
/* Status check: this byte must be 0 or 1 */
if (rxbyte & DM9000_PKT_ERR) {
***************
*** 996,1003 ****
/* A packet ready now & Get status/length */
GoodPacket = true;
- writeb(DM9000_MRCMD, db->io_addr);
(db->inblk)(db->io_data, &rxhdr, sizeof(rxhdr));
RxLen = le16_to_cpu(rxhdr.RxLen);
--- 1105,1117 ----
/* A packet ready now & Get status/length */
GoodPacket = true;
+ #ifdef BE2LE32BIT
+ writel(DM9000_MRCMD, db->io_addr);
+ #else
+ writeb(DM9000_MRCMD, db->io_addr);
+ #endif
+
(db->inblk)(db->io_data, &rxhdr, sizeof(rxhdr));
RxLen = le16_to_cpu(rxhdr.RxLen);
***************
*** 1077,1083 ****
unsigned long flags;
u8 reg_save;
! dm9000_dbg(db, 3, "entering %s\n", __func__);
/* A real interrupt coming */
--- 1191,1197 ----
unsigned long flags;
u8 reg_save;
! //dm9000_dbg(db, 3, "entering %s\n", __func__);
/* A real interrupt coming */
***************
*** 1085,1091 ****
spin_lock_irqsave(&db->lock, flags);
/* Save previous register address */
! reg_save = readb(db->io_addr);
/* Disable all interrupts */
iow(db, DM9000_IMR, IMR_PAR);
--- 1199,1209 ----
spin_lock_irqsave(&db->lock, flags);
/* Save previous register address */
! #ifdef BE2LE32BIT
! reg_save = (u8)readl(db->io_addr);
! #else
! reg_save = readb(db->io_addr);
! #endif
/* Disable all interrupts */
iow(db, DM9000_IMR, IMR_PAR);
***************
*** 1100,1106 ****
/* Received the coming packet */
if (int_status & ISR_PRS)
dm9000_rx(dev);
!
/* Trnasmit Interrupt check */
if (int_status & ISR_PTS)
dm9000_tx_done(dev, db);
--- 1218,1224 ----
/* Received the coming packet */
if (int_status & ISR_PRS)
dm9000_rx(dev);
!
/* Trnasmit Interrupt check */
if (int_status & ISR_PTS)
dm9000_tx_done(dev, db);
***************
*** 1116,1123 ****
iow(db, DM9000_IMR, db->imr_all);
/* Restore previous register address */
writeb(reg_save, db->io_addr);
!
spin_unlock_irqrestore(&db->lock, flags);
return IRQ_HANDLED;
--- 1234,1245 ----
iow(db, DM9000_IMR, db->imr_all);
/* Restore previous register address */
+ #ifdef BE2LE32BIT
+ writel(reg_save, db->io_addr);
+ #else
writeb(reg_save, db->io_addr);
! #endif
!
spin_unlock_irqrestore(&db->lock, flags);
return IRQ_HANDLED;
***************
*** 1233,1243 ****
int ret;
mutex_lock(&db->addr_lock);
!
spin_lock_irqsave(&db->lock,flags);
/* Save previous register address */
! reg_save = readb(db->io_addr);
/* Fill the phyxcer register into REG_0C */
iow(db, DM9000_EPAR, DM9000_PHY | reg);
--- 1355,1369 ----
int ret;
mutex_lock(&db->addr_lock);
!
spin_lock_irqsave(&db->lock,flags);
/* Save previous register address */
! #ifdef BE2LE32BIT
! reg_save = (u8)readl(db->io_addr);
! #else
! reg_save = readb(db->io_addr);
! #endif
/* Fill the phyxcer register into REG_0C */
iow(db, DM9000_EPAR, DM9000_PHY | reg);
***************
*** 1250,1256 ****
dm9000_msleep(db, 1); /* Wait read complete */
spin_lock_irqsave(&db->lock,flags);
! reg_save = readb(db->io_addr);
iow(db, DM9000_EPCR, 0x0); /* Clear phyxcer read command */
--- 1376,1386 ----
dm9000_msleep(db, 1); /* Wait read complete */
spin_lock_irqsave(&db->lock,flags);
! #ifdef BE2LE32BIT
! reg_save = (u8)readl(db->io_addr);
! #else
! reg_save = readb(db->io_addr);
! #endif
iow(db, DM9000_EPCR, 0x0); /* Clear phyxcer read command */
***************
*** 1258,1266 ****
ret = (ior(db, DM9000_EPDRH) << 8) | ior(db, DM9000_EPDRL);
/* restore the previous address */
writeb(reg_save, db->io_addr);
! spin_unlock_irqrestore(&db->lock,flags);
mutex_unlock(&db->addr_lock);
dm9000_dbg(db, 5, "phy_read[%02x] -> %04x\n", reg, ret);
--- 1388,1401 ----
ret = (ior(db, DM9000_EPDRH) << 8) | ior(db, DM9000_EPDRL);
/* restore the previous address */
+ #ifdef BE2LE32BIT
+ writel(reg_save, db->io_addr);
+ #else
writeb(reg_save, db->io_addr);
! #endif
+ spin_unlock_irqrestore(&db->lock,flags);
+
mutex_unlock(&db->addr_lock);
dm9000_dbg(db, 5, "phy_read[%02x] -> %04x\n", reg, ret);
***************
*** 1284,1290 ****
spin_lock_irqsave(&db->lock,flags);
/* Save previous register address */
! reg_save = readb(db->io_addr);
/* Fill the phyxcer register into REG_0C */
iow(db, DM9000_EPAR, DM9000_PHY | reg);
--- 1419,1429 ----
spin_lock_irqsave(&db->lock,flags);
/* Save previous register address */
! #ifdef BE2LE32BIT
! reg_save = (u8)readl(db->io_addr);
! #else
! reg_save = readb(db->io_addr);
! #endif
/* Fill the phyxcer register into REG_0C */
iow(db, DM9000_EPAR, DM9000_PHY | reg);
***************
*** 1295,1312 ****
iow(db, DM9000_EPCR, EPCR_EPOS | EPCR_ERPRW); /* Issue phyxcer
write command */
writeb(reg_save, db->io_addr);
spin_unlock_irqrestore(&db->lock, flags);
dm9000_msleep(db, 1); /* Wait write complete */
spin_lock_irqsave(&db->lock,flags);
! reg_save = readb(db->io_addr);
iow(db, DM9000_EPCR, 0x0); /* Clear phyxcer write command */
/* restore the previous address */
writeb(reg_save, db->io_addr);
spin_unlock_irqrestore(&db->lock, flags);
mutex_unlock(&db->addr_lock);
--- 1434,1464 ----
iow(db, DM9000_EPCR, EPCR_EPOS | EPCR_ERPRW); /* Issue phyxcer
write command */
+ #ifdef BE2LE32BIT
+ writel(reg_save, db->io_addr);
+ #else
writeb(reg_save, db->io_addr);
+ #endif
+
spin_unlock_irqrestore(&db->lock, flags);
dm9000_msleep(db, 1); /* Wait write complete */
spin_lock_irqsave(&db->lock,flags);
! #ifdef BE2LE32BIT
! reg_save = (u8)readl(db->io_addr);
! #else
! reg_save = readb(db->io_addr);
! #endif
iow(db, DM9000_EPCR, 0x0); /* Clear phyxcer write command */
/* restore the previous address */
+ #ifdef BE2LE32BIT
+ writel(reg_save, db->io_addr);
+ #else
writeb(reg_save, db->io_addr);
+ #endif
spin_unlock_irqrestore(&db->lock, flags);
mutex_unlock(&db->addr_lock);
^ permalink raw reply
* Re: [PATCH net-next-2.6] sfq: fix slot_dequeue_head()
From: Eric Dumazet @ 2010-12-30 21:31 UTC (permalink / raw)
To: Jarek Poplawski; +Cc: David Miller, netdev
In-Reply-To: <20101230174918.GA2018@del.dom.local>
Le jeudi 30 décembre 2010 à 18:49 +0100, Jarek Poplawski a écrit :
> Nice scenario ;-) Of course, it's easy to guess I looked for something
> like this after your previous fix and missed that :-| Btw, it looks
> like slot_queue_init() could go back to sfq_init() now.
>
Indeed, I tested following combined patch and all is good.
Thanks Jarek !
[PATCH v2 net-next-2.6] sfq: fix slot_dequeue_head()
slot_dequeue_head() should make sure slot skb chain is correct in both
ways, or we can crash if all possible flows are in use.
Jarek pointed out slot_queue_init() can now be done in sfq_init() once,
instead each time a flow is setup.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Jarek Poplawski <jarkao2@gmail.com>
---
net/sched/sch_sfq.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c
index 6a2f88f..02fa1dd 100644
--- a/net/sched/sch_sfq.c
+++ b/net/sched/sch_sfq.c
@@ -292,6 +292,7 @@ static inline struct sk_buff *slot_dequeue_head(struct sfq_slot *slot)
struct sk_buff *skb = slot->skblist_next;
slot->skblist_next = skb->next;
+ skb->next->prev = (struct sk_buff *)slot;
skb->next = skb->prev = NULL;
return skb;
}
@@ -375,7 +376,6 @@ sfq_enqueue(struct sk_buff *skb, struct Qdisc *sch)
q->ht[hash] = x;
slot = &q->slots[x];
slot->hash = hash;
- slot_queue_init(slot);
}
/* If selected queue has length q->limit, do simple tail drop,
@@ -533,8 +533,10 @@ static int sfq_init(struct Qdisc *sch, struct nlattr *opt)
return err;
}
- for (i = 0; i < SFQ_SLOTS; i++)
+ for (i = 0; i < SFQ_SLOTS; i++) {
+ slot_queue_init(&q->slots[i]);
sfq_link(q, i);
+ }
return 0;
}
^ permalink raw reply related
* RE: [PATCH net-2.6] bridge: fix br_multicast_ipv6_rcv for paged skbs
From: Winkler, Tomas @ 2010-12-30 21:00 UTC (permalink / raw)
To: Stephen Hemminger, Johannes Berg
Cc: davem@davemloft.net, netdev@vger.kernel.org,
linux-wireless@vger.kernel.org
In-Reply-To: <20101230110609.08b7ee38@nehalam>
> -----Original Message-----
> From: Stephen Hemminger [mailto:shemminger@vyatta.com]
> Sent: Thursday, December 30, 2010 9:06 PM
> To: Johannes Berg
> Cc: Winkler, Tomas; davem@davemloft.net; netdev@vger.kernel.org; linux-
> wireless@vger.kernel.org
> Subject: Re: [PATCH net-2.6] bridge: fix br_multicast_ipv6_rcv for paged
> skbs
>
> On Thu, 30 Dec 2010 19:52:14 +0100
> Johannes Berg <johannes@sipsolutions.net> wrote:
>
> > On Thu, 2010-12-30 at 10:46 -0800, Stephen Hemminger wrote:
> >
> > > This doesn't look correct. The calculation of the offset doesn't look
> correct.
> > > Just following the skb_clone(), the skb_pull value is "offset".
> > > Also, the other checks return -EINVAL for incorrectly formed packet.
> > >
> > > --- a/net/bridge/br_multicast.c 2010-12-30 10:29:58.579510488 -0800
> > > +++ b/net/bridge/br_multicast.c 2010-12-30 10:43:27.273386691 -0800
> > > @@ -1464,6 +1464,9 @@ static int br_multicast_ipv6_rcv(struct
> > > if (offset < 0 || nexthdr != IPPROTO_ICMPV6)
> > > return 0;
> > >
> > > + if (!pskb_may_pull(skb, offset))
> > > + return -EINVAL;
> > > +
> > > /* Okay, we found ICMPv6 header */
> > > skb2 = skb_clone(skb, GFP_ATOMIC);
> > > if (!skb2)
> >
> > Wouldn't that make more sense after the clone anyway? But if you look at
> > my email, you'll find that there's potentially, and conditionally, more
> > stuff that will be read from the skb's header, which hasn't necessarily
> > been pulled in, so I think this still won't fix all the issues.
> >
> > Seeing how this only affects some ICMPv6 packets, maybe we should just
> > use skb_copy() instead?
>
> It comes out cleaner, and the check can be simplified.
>
> --- a/net/bridge/br_multicast.c 2010-12-30 10:47:12.031733855 -0800
> +++ b/net/bridge/br_multicast.c 2010-12-30 11:00:12.135801266 -0800
> @@ -1465,19 +1465,19 @@ static int br_multicast_ipv6_rcv(struct
> return 0;
>
> /* Okay, we found ICMPv6 header */
> - skb2 = skb_clone(skb, GFP_ATOMIC);
> + skb2 = skb_copy(skb, GFP_ATOMIC);
> if (!skb2)
> return -ENOMEM;
>
> + err = -EINVAL;
> + if (skb2->len < offset + sizeof(*icmp6h))
> + goto out;
> +
> len -= offset - skb_network_offset(skb2);
>
> __skb_pull(skb2, offset);
> skb_reset_transport_header(skb2);
>
> - err = -EINVAL;
> - if (!pskb_may_pull(skb2, sizeof(*icmp6h)))
> - goto out;
> -
> icmp6h = icmp6_hdr(skb2);
>
> switch (icmp6h->icmp6_type) {
>
>
Sorry for dump question but isn't there performance penalty on using skb_copy vs. skb_clone?
Anyhow Below is a code snippet from ip6_input.c so you probably would want to fix it all over.
BTW offset and the pointer arithmetic really gives the same number +1, I'm not surly why the original author would thought it be safer than just using offset.
offset = ipv6_skip_exthdr(skb, sizeof(*hdr),
&nexthdr);
if (offset < 0)
goto out;
if (nexthdr != IPPROTO_ICMPV6)
goto out;
if (!pskb_may_pull(skb, (skb_network_header(skb) +
offset + 1 - skb->data)))
goto out;
icmp6 = (struct icmp6hdr *)(skb_network_header(skb) + offset);
Thanks
Tomas
---------------------------------------------------------------------
Intel Israel (74) Limited
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply
* Re: sysctls below net.ipv[46].conf.all not working as expected
From: Uwe Kleine-König @ 2010-12-30 20:43 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20101230.123023.226775556.davem@davemloft.net>
Hello David,
On Thu, Dec 30, 2010 at 12:30:23PM -0800, David Miller wrote:
> From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Date: Wed, 29 Dec 2010 17:06:07 +0100
>
> > I did the following:
> >
> > cassiopeia:~# sysctl net.ipv6.conf.all.use_tempaddr
> > net.ipv6.conf.all.use_tempaddr = 0
> >
> > cassiopeia:~# sysctl net.ipv6.conf.eth0.use_tempaddr
> > net.ipv6.conf.eth0.use_tempaddr = 0
> >
> > cassiopeia:~# sysctl -w net.ipv6.conf.all.use_tempaddr=1
> > net.ipv6.conf.all.use_tempaddr = 1
> >
> > cassiopeia:~# sysctl net.ipv6.conf.all.use_tempaddr
> > net.ipv6.conf.all.use_tempaddr = 1
> >
> > cassiopeia:~# sysctl net.ipv6.conf.eth0.use_tempaddr
> > net.ipv6.conf.eth0.use_tempaddr = 0
> >
> > Here I would have expected that eth0's use_tempaddr is 1, too. The
> > problem is not that this entry isn't writeable:
>
> The "all" value is propagated at the first moment that the ipv6 device
> private is created, usually that is when the device is first brought up
> which means it can happen as early as the exact moment the device is
> registered.
>
> Therefore, if you want "all" to apply to "eth0", you must make sure
> the sysctl is set properly before the device is registered.
I thought this is what "default" was used for?!
If you are really right, the documentation is (IMHO) misleading. e.g.
Documentation/networking/ip-sysctl.txt tells:
conf/default/*:
Change the interface-specific default settings.
conf/all/*:
Change all the interface-specific settings.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply
* Re: sysctls below net.ipv[46].conf.all not working as expected
From: David Miller @ 2010-12-30 20:30 UTC (permalink / raw)
To: u.kleine-koenig; +Cc: netdev
In-Reply-To: <20101229160607.GH14221@pengutronix.de>
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date: Wed, 29 Dec 2010 17:06:07 +0100
> I did the following:
>
> cassiopeia:~# sysctl net.ipv6.conf.all.use_tempaddr
> net.ipv6.conf.all.use_tempaddr = 0
>
> cassiopeia:~# sysctl net.ipv6.conf.eth0.use_tempaddr
> net.ipv6.conf.eth0.use_tempaddr = 0
>
> cassiopeia:~# sysctl -w net.ipv6.conf.all.use_tempaddr=1
> net.ipv6.conf.all.use_tempaddr = 1
>
> cassiopeia:~# sysctl net.ipv6.conf.all.use_tempaddr
> net.ipv6.conf.all.use_tempaddr = 1
>
> cassiopeia:~# sysctl net.ipv6.conf.eth0.use_tempaddr
> net.ipv6.conf.eth0.use_tempaddr = 0
>
> Here I would have expected that eth0's use_tempaddr is 1, too. The
> problem is not that this entry isn't writeable:
The "all" value is propagated at the first moment that the ipv6 device
private is created, usually that is when the device is first brought up
which means it can happen as early as the exact moment the device is
registered.
Therefore, if you want "all" to apply to "eth0", you must make sure
the sysctl is set properly before the device is registered.
^ permalink raw reply
* Re: sysctls below net.ipv[46].conf.all not working as expected
From: Uwe Kleine-König @ 2010-12-30 20:20 UTC (permalink / raw)
To: netdev; +Cc: Marco d'Itri
In-Reply-To: <20101229160607.GH14221@pengutronix.de>
Hello again,
On Wed, Dec 29, 2010 at 05:06:07PM +0100, Uwe Kleine-König wrote:
> I did the following:
>
> cassiopeia:~# sysctl net.ipv6.conf.all.use_tempaddr
> net.ipv6.conf.all.use_tempaddr = 0
>
> cassiopeia:~# sysctl net.ipv6.conf.eth0.use_tempaddr
> net.ipv6.conf.eth0.use_tempaddr = 0
>
> cassiopeia:~# sysctl -w net.ipv6.conf.all.use_tempaddr=1
> net.ipv6.conf.all.use_tempaddr = 1
>
> cassiopeia:~# sysctl net.ipv6.conf.all.use_tempaddr
> net.ipv6.conf.all.use_tempaddr = 1
>
> cassiopeia:~# sysctl net.ipv6.conf.eth0.use_tempaddr
> net.ipv6.conf.eth0.use_tempaddr = 0
>
> Here I would have expected that eth0's use_tempaddr is 1, too. The
> problem is not that this entry isn't writeable:
>
> cassiopeia:~# sysctl -w net.ipv6.conf.eth0.use_tempaddr=1
> net.ipv6.conf.eth0.use_tempaddr = 1
>
> cassiopeia:~# sysctl net.ipv6.conf.eth0.use_tempaddr
> net.ipv6.conf.eth0.use_tempaddr = 1
>
> I got the same results when using net.ipv4.conf.all.rp_filter (and
> net.ipv4.conf.eth0.rp_filter resp.)
>
> Is this a bug or just my failure to see how conf/all works?
I put the following in my /etc/sysctl.conf:
net.ipv6.conf.default.use_tempaddr = 1
net.ipv6.conf.all.use_tempaddr = 1
net.ipv6.conf.eth0.use_tempaddr = 1
and after a reboot eth0 got a temporary dynamic address, eth1 did not.
So it doesn't seem to be as guessed by someone on #debian-kernel that
the setting works but isn't propagated back to the sysctl of the
interface.
This makes me wonder how useful the lines
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.all.rp_filter = 1
(suggested by the Debian package netbase) are.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply
* [net-next-2.6 PATCH v2 3/3] net_dcb: add application notifiers
From: John Fastabend @ 2010-12-30 19:26 UTC (permalink / raw)
To: davem; +Cc: john.r.fastabend, netdev, lucy.liu, shmulikr
In-Reply-To: <20101230192449.21487.9764.stgit@jf-dev1-dcblab>
DCBx applications priorities can be changed dynamically. If
application stacks are expected to keep the skb priority
consistent with the dcbx priority the stack will need to
be notified when these changes occur.
This patch adds application notifiers for the stack to register
with.
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
---
include/net/dcbevent.h | 31 +++++++++++++++++++++++++++++++
net/dcb/Makefile | 2 +-
net/dcb/dcbevent.c | 40 ++++++++++++++++++++++++++++++++++++++++
net/dcb/dcbnl.c | 2 ++
4 files changed, 74 insertions(+), 1 deletions(-)
create mode 100644 include/net/dcbevent.h
create mode 100644 net/dcb/dcbevent.c
diff --git a/include/net/dcbevent.h b/include/net/dcbevent.h
new file mode 100644
index 0000000..bc1e7ef
--- /dev/null
+++ b/include/net/dcbevent.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2010, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
+ *
+ * Author: John Fastabend <john.r.fastabend@intel.com>
+ */
+
+#ifndef _DCB_EVENT_H
+#define _DCB_EVENT_H
+
+enum dcbevent_notif_type {
+ DCB_APP_EVENT = 1,
+};
+
+extern int register_dcbevent_notifier(struct notifier_block *nb);
+extern int unregister_dcbevent_notifier(struct notifier_block *nb);
+extern int call_dcbevent_notifiers(unsigned long val, void *v);
+
+#endif
diff --git a/net/dcb/Makefile b/net/dcb/Makefile
index 9930f4c..c1282c9 100644
--- a/net/dcb/Makefile
+++ b/net/dcb/Makefile
@@ -1 +1 @@
-obj-$(CONFIG_DCB) += dcbnl.o
+obj-$(CONFIG_DCB) += dcbnl.o dcbevent.o
diff --git a/net/dcb/dcbevent.c b/net/dcb/dcbevent.c
new file mode 100644
index 0000000..665a880
--- /dev/null
+++ b/net/dcb/dcbevent.c
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2010, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
+ *
+ * Author: John Fastabend <john.r.fastabend@intel.com>
+ */
+
+#include <linux/rtnetlink.h>
+#include <linux/notifier.h>
+
+static ATOMIC_NOTIFIER_HEAD(dcbevent_notif_chain);
+
+int register_dcbevent_notifier(struct notifier_block *nb)
+{
+ return atomic_notifier_chain_register(&dcbevent_notif_chain, nb);
+}
+EXPORT_SYMBOL(register_dcbevent_notifier);
+
+int unregister_dcbevent_notifier(struct notifier_block *nb)
+{
+ return atomic_notifier_chain_unregister(&dcbevent_notif_chain, nb);
+}
+EXPORT_SYMBOL(unregister_dcbevent_notifier);
+
+int call_dcbevent_notifiers(unsigned long val, void *v)
+{
+ return atomic_notifier_call_chain(&dcbevent_notif_chain, val, v);
+}
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index cfd731f..6914412 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -23,6 +23,7 @@
#include <net/netlink.h>
#include <net/rtnetlink.h>
#include <linux/dcbnl.h>
+#include <net/dcbevent.h>
#include <linux/rtnetlink.h>
#include <net/sock.h>
@@ -1460,6 +1461,7 @@ u8 dcb_setapp(struct net_device *dev, struct dcb_app *new)
}
out:
spin_unlock(&dcb_lock);
+ call_dcbevent_notifiers(DCB_APP_EVENT, new);
return 0;
}
EXPORT_SYMBOL(dcb_setapp);
^ permalink raw reply related
* [net-next-2.6 PATCH v2 2/3] dcbnl: add appliction tlv handlers
From: John Fastabend @ 2010-12-30 19:26 UTC (permalink / raw)
To: davem; +Cc: john.r.fastabend, netdev, lucy.liu, shmulikr
In-Reply-To: <20101230192449.21487.9764.stgit@jf-dev1-dcblab>
This patch adds application tlv handlers. Networking stacks
may use the application priority to set the skb priority of
their stack using the negoatiated dcbx priority.
This patch provides the dcb_{get|set}app() routines for the
stack to query these parameters. Notice lower layer drivers
can use the dcbnl_ops routines if additional handling is
needed. Perhaps in the firmware case for example
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: Shmulik Ravid <shmulikr@broadcom.com>
---
include/linux/dcbnl.h | 4 +
include/net/dcbnl.h | 9 +++
net/dcb/dcbnl.c | 133 +++++++++++++++++++++++++++++++++++++++++++++----
3 files changed, 135 insertions(+), 11 deletions(-)
diff --git a/include/linux/dcbnl.h b/include/linux/dcbnl.h
index 287b561..775bdb4 100644
--- a/include/linux/dcbnl.h
+++ b/include/linux/dcbnl.h
@@ -82,7 +82,9 @@ struct ieee_pfc {
__u64 indications[IEEE_8021QAZ_MAX_TCS];
};
-/* This structure contains the IEEE 802.1Qaz APP managed object
+/* This structure contains the IEEE 802.1Qaz APP managed object. This
+ * object is also used for the CEE std as well. There is no difference
+ * between the objects.
*
* @selector: protocol identifier type
* @protocol: protocol of type indicated
diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h
index e2d841e..ab7d623 100644
--- a/include/net/dcbnl.h
+++ b/include/net/dcbnl.h
@@ -22,6 +22,15 @@
#include <linux/dcbnl.h>
+struct dcb_app_type {
+ char name[IFNAMSIZ];
+ struct dcb_app app;
+ struct list_head list;
+};
+
+u8 dcb_setapp(struct net_device *, struct dcb_app *);
+u8 dcb_getapp(struct net_device *, struct dcb_app *);
+
/*
* Ops struct for the netlink callbacks. Used by DCB-enabled drivers through
* the netdevice struct.
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index 2ff9084..cfd731f 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -179,6 +179,9 @@ static const struct nla_policy dcbnl_ieee_app[DCB_ATTR_IEEE_APP_MAX + 1] = {
[DCB_ATTR_IEEE_APP] = {.len = sizeof(struct dcb_app)},
};
+static LIST_HEAD(dcb_app_list);
+static DEFINE_SPINLOCK(dcb_lock);
+
/* standard netlink reply call */
static int dcbnl_reply(u8 value, u8 event, u8 cmd, u8 attr, u32 pid,
u32 seq, u16 flags)
@@ -634,12 +637,12 @@ out:
static int dcbnl_setapp(struct net_device *netdev, struct nlattr **tb,
u32 pid, u32 seq, u16 flags)
{
- int ret = -EINVAL;
+ int err, ret = -EINVAL;
u16 id;
u8 up, idtype;
struct nlattr *app_tb[DCB_APP_ATTR_MAX + 1];
- if (!tb[DCB_ATTR_APP] || !netdev->dcbnl_ops->setapp)
+ if (!tb[DCB_ATTR_APP])
goto out;
ret = nla_parse_nested(app_tb, DCB_APP_ATTR_MAX, tb[DCB_ATTR_APP],
@@ -663,9 +666,18 @@ static int dcbnl_setapp(struct net_device *netdev, struct nlattr **tb,
id = nla_get_u16(app_tb[DCB_APP_ATTR_ID]);
up = nla_get_u8(app_tb[DCB_APP_ATTR_PRIORITY]);
- ret = dcbnl_reply(netdev->dcbnl_ops->setapp(netdev, idtype, id, up),
- RTM_SETDCB, DCB_CMD_SAPP, DCB_ATTR_APP,
- pid, seq, flags);
+ if (netdev->dcbnl_ops->setapp) {
+ err = netdev->dcbnl_ops->setapp(netdev, idtype, id, up);
+ } else {
+ struct dcb_app app;
+ app.selector = idtype;
+ app.protocol = id;
+ app.priority = up;
+ err = dcb_setapp(netdev, &app);
+ }
+
+ ret = dcbnl_reply(err, RTM_SETDCB, DCB_CMD_SAPP, DCB_ATTR_APP,
+ pid, seq, flags);
out:
return ret;
}
@@ -1164,7 +1176,7 @@ static int dcbnl_ieee_set(struct net_device *netdev, struct nlattr **tb,
goto err;
}
- if (ieee[DCB_ATTR_IEEE_APP_TABLE] && ops->ieee_setapp) {
+ if (ieee[DCB_ATTR_IEEE_APP_TABLE]) {
struct nlattr *attr;
int rem;
@@ -1173,7 +1185,10 @@ static int dcbnl_ieee_set(struct net_device *netdev, struct nlattr **tb,
if (nla_type(attr) != DCB_ATTR_IEEE_APP)
continue;
app_data = nla_data(attr);
- err = ops->ieee_setapp(netdev, app_data);
+ if (ops->ieee_setapp)
+ err = ops->ieee_setapp(netdev, app_data);
+ else
+ err = dcb_setapp(netdev, app_data);
if (err)
goto err;
}
@@ -1193,7 +1208,8 @@ static int dcbnl_ieee_get(struct net_device *netdev, struct nlattr **tb,
struct sk_buff *skb;
struct nlmsghdr *nlh;
struct dcbmsg *dcb;
- struct nlattr *ieee;
+ struct nlattr *ieee, *app;
+ struct dcb_app_type *itr;
const struct dcbnl_rtnl_ops *ops = netdev->dcbnl_ops;
int err;
@@ -1230,6 +1246,19 @@ static int dcbnl_ieee_get(struct net_device *netdev, struct nlattr **tb,
NLA_PUT(skb, DCB_ATTR_IEEE_PFC, sizeof(pfc), &pfc);
}
+ app = nla_nest_start(skb, DCB_ATTR_IEEE_APP_TABLE);
+ if (!app)
+ goto nla_put_failure;
+
+ spin_lock(&dcb_lock);
+ list_for_each_entry(itr, &dcb_app_list, list) {
+ if (strncmp(itr->name, netdev->name, IFNAMSIZ) == 0)
+ NLA_PUT(skb, DCB_ATTR_IEEE_APP,
+ sizeof(itr->app), &itr->app);
+ }
+ spin_unlock(&dcb_lock);
+ nla_nest_end(skb, app);
+
nla_nest_end(skb, ieee);
nlmsg_end(skb, nlh);
@@ -1364,8 +1393,93 @@ out:
return ret;
}
+/**
+ * dcb_getapp - retrieve the DCBX application user priority
+ *
+ * On success returns a non-zero 802.1p user priority bitmap
+ * otherwise returns 0 as the invalid user priority bitmap to
+ * indicate an error.
+ */
+u8 dcb_getapp(struct net_device *dev, struct dcb_app *app)
+{
+ struct dcb_app_type *itr;
+ u8 prio = 0;
+
+ spin_lock(&dcb_lock);
+ list_for_each_entry(itr, &dcb_app_list, list) {
+ if (itr->app.selector == app->selector &&
+ itr->app.protocol == app->protocol &&
+ (strncmp(itr->name, dev->name, IFNAMSIZ) == 0)) {
+ prio = itr->app.priority;
+ break;
+ }
+ }
+ spin_unlock(&dcb_lock);
+
+ return prio;
+}
+EXPORT_SYMBOL(dcb_getapp);
+
+/**
+ * ixgbe_dcbnl_setapp - add dcb application data to app list
+ *
+ * Priority 0 is the default priority this removes applications
+ * from the app list if the priority is set to zero.
+ */
+u8 dcb_setapp(struct net_device *dev, struct dcb_app *new)
+{
+ struct dcb_app_type *itr;
+
+ spin_lock(&dcb_lock);
+ /* Search for existing match and replace */
+ list_for_each_entry(itr, &dcb_app_list, list) {
+ if (itr->app.selector == new->selector &&
+ itr->app.protocol == new->protocol &&
+ (strncmp(itr->name, dev->name, IFNAMSIZ) == 0)) {
+ if (new->priority)
+ itr->app.priority = new->priority;
+ else {
+ list_del(&itr->list);
+ kfree(itr);
+ }
+ goto out;
+ }
+ }
+ /* App type does not exist add new application type */
+ if (new->priority) {
+ struct dcb_app_type *entry;
+ entry = kmalloc(sizeof(struct dcb_app_type), GFP_ATOMIC);
+ if (!entry) {
+ spin_unlock(&dcb_lock);
+ return -ENOMEM;
+ }
+
+ memcpy(&entry->app, new, sizeof(*new));
+ strncpy(entry->name, dev->name, IFNAMSIZ);
+ list_add(&entry->list, &dcb_app_list);
+ }
+out:
+ spin_unlock(&dcb_lock);
+ return 0;
+}
+EXPORT_SYMBOL(dcb_setapp);
+
+void dcb_flushapp(void)
+{
+ struct dcb_app_type *app;
+
+ spin_lock(&dcb_lock);
+ list_for_each_entry(app, &dcb_app_list, list) {
+ list_del(&app->list);
+ kfree(app);
+ }
+ spin_unlock(&dcb_lock);
+}
+
static int __init dcbnl_init(void)
{
+ INIT_LIST_HEAD(&dcb_app_list);
+
rtnl_register(PF_UNSPEC, RTM_GETDCB, dcb_doit, NULL);
rtnl_register(PF_UNSPEC, RTM_SETDCB, dcb_doit, NULL);
@@ -1377,7 +1491,6 @@ static void __exit dcbnl_exit(void)
{
rtnl_unregister(PF_UNSPEC, RTM_GETDCB);
rtnl_unregister(PF_UNSPEC, RTM_SETDCB);
+ dcb_flushapp();
}
module_exit(dcbnl_exit);
-
-
^ permalink raw reply related
* [net-next-2.6 PATCH v2 1/3] dcbnl: add support for ieee8021Qaz attributes
From: John Fastabend @ 2010-12-30 19:25 UTC (permalink / raw)
To: davem; +Cc: john.r.fastabend, netdev, lucy.liu, shmulikr
In-Reply-To: <20101230192449.21487.9764.stgit@jf-dev1-dcblab>
The IEEE8021Qaz is the IEEE standard version of CEE. The
standard has had enough significant changes from the CEE
version that many of the CEE attributes have no meaning
in the new spec or do not easily map to IEEE standards.
Rather then attempt to create a complicated mapping
between CEE and IEEE standards this patch adds a nested
IEEE attribute to the list of DCB attributes. The policy
is,
[DCB_ATTR_IFNAME]
[DCB_ATTR_STATE]
...
[DCB_ATTR_IEEE]
[DCB_ATTR_IEEE_ETS]
[DCB_ATTR_IEEE_PFC]
[DCB_ATTR_IEEE_APP_TABLE]
[DCB_ATTR_IEEE_APP]
...
The following dcbnl_rtnl_ops routines were added to handle
the IEEE standard,
int (*ieee_getets) (struct net_device *, struct ieee_ets *);
int (*ieee_setets) (struct net_device *, struct ieee_ets *);
int (*ieee_getpfc) (struct net_device *, struct ieee_pfc *);
int (*ieee_setpfc) (struct net_device *, struct ieee_pfc *);
int (*ieee_getapp) (struct net_device *, struct dcb_app *);
int (*ieee_setapp) (struct net_device *, struct dcb_app *);
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
---
include/linux/dcbnl.h | 106 ++++++++++++++++++++++++++++++++++++++++
include/net/dcbnl.h | 11 ++++
net/dcb/dcbnl.c | 131 +++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 248 insertions(+), 0 deletions(-)
diff --git a/include/linux/dcbnl.h b/include/linux/dcbnl.h
index 8723491..287b561 100644
--- a/include/linux/dcbnl.h
+++ b/include/linux/dcbnl.h
@@ -22,6 +22,87 @@
#include <linux/types.h>
+/* IEEE 802.1Qaz std supported values */
+#define IEEE_8021QAZ_MAX_TCS 8
+
+/* This structure contains the IEEE 802.1Qaz ETS managed object
+ *
+ * @willing: willing bit in ETS configuratin TLV
+ * @ets_cap: indicates supported capacity of ets feature
+ * @cbs: credit based shaper ets algorithm supported
+ * @tc_tx_bw: tc tx bandwidth indexed by traffic class
+ * @tc_rx_bw: tc rx bandwidth indexed by traffic class
+ * @tc_tsa: TSA Assignment table, indexed by traffic class
+ * @prio_tc: priority assignment table mapping 8021Qp to traffic class
+ * @tc_reco_bw: recommended tc bandwidth indexed by traffic class for TLV
+ * @tc_reco_tsa: recommended tc bandwidth indexed by traffic class for TLV
+ * @reco_prio_tc: recommended tc tx bandwidth indexed by traffic class for TLV
+ *
+ * Recommended values are used to set fields in the ETS recommendation TLV
+ * with hardware offloaded LLDP.
+ *
+ * ----
+ * TSA Assignment 8 bit identifiers
+ * 0 strict priority
+ * 1 credit-based shaper
+ * 2 enhanced transmission selection
+ * 3-254 reserved
+ * 255 vendor specific
+ */
+struct ieee_ets {
+ __u8 willing;
+ __u8 ets_cap;
+ __u8 cbs;
+ __u8 tc_tx_bw[IEEE_8021QAZ_MAX_TCS];
+ __u8 tc_rx_bw[IEEE_8021QAZ_MAX_TCS];
+ __u8 tc_tsa[IEEE_8021QAZ_MAX_TCS];
+ __u8 prio_tc[IEEE_8021QAZ_MAX_TCS];
+ __u8 tc_reco_bw[IEEE_8021QAZ_MAX_TCS];
+ __u8 tc_reco_tsa[IEEE_8021QAZ_MAX_TCS];
+ __u8 reco_prio_tc[IEEE_8021QAZ_MAX_TCS];
+};
+
+/* This structure contains the IEEE 802.1Qaz PFC managed object
+ *
+ * @pfc_cap: Indicates the number of traffic classes on the local device
+ * that may simultaneously have PFC enabled.
+ * @pfc_en: bitmap indicating pfc enabled traffic classes
+ * @mbc: enable macsec bypass capability
+ * @delay: the allowance made for a round-trip propagation delay of the
+ * link in bits.
+ * @requests: count of the sent pfc frames
+ * @indications: count of the received pfc frames
+ */
+struct ieee_pfc {
+ __u8 pfc_cap;
+ __u8 pfc_en;
+ __u8 mbc;
+ __u16 delay;
+ __u64 requests[IEEE_8021QAZ_MAX_TCS];
+ __u64 indications[IEEE_8021QAZ_MAX_TCS];
+};
+
+/* This structure contains the IEEE 802.1Qaz APP managed object
+ *
+ * @selector: protocol identifier type
+ * @protocol: protocol of type indicated
+ * @priority: 3-bit unsigned integer indicating priority
+ *
+ * ----
+ * Selector field values
+ * 0 Reserved
+ * 1 Ethertype
+ * 2 Well known port number over TCP or SCTP
+ * 3 Well known port number over UDP or DCCP
+ * 4 Well known port number over TCP, SCTP, UDP, or DCCP
+ * 5-7 Reserved
+ */
+struct dcb_app {
+ __u8 selector;
+ __u32 protocol;
+ __u8 priority;
+};
+
struct dcbmsg {
__u8 dcb_family;
__u8 cmd;
@@ -50,6 +131,8 @@ struct dcbmsg {
* @DCB_CMD_SBCN: get backward congestion notification configration.
* @DCB_CMD_GAPP: get application protocol configuration
* @DCB_CMD_SAPP: set application protocol configuration
+ * @DCB_CMD_IEEE_SET: set IEEE 802.1Qaz configuration
+ * @DCB_CMD_IEEE_GET: get IEEE 802.1Qaz configuration
*/
enum dcbnl_commands {
DCB_CMD_UNDEFINED,
@@ -83,6 +166,9 @@ enum dcbnl_commands {
DCB_CMD_GAPP,
DCB_CMD_SAPP,
+ DCB_CMD_IEEE_SET,
+ DCB_CMD_IEEE_GET,
+
__DCB_CMD_ENUM_MAX,
DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1,
};
@@ -102,6 +188,7 @@ enum dcbnl_commands {
* @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED)
* @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED)
* @DCB_ATTR_BCN: backward congestion notification configuration (NLA_NESTED)
+ * @DCB_ATTR_IEEE: IEEE 802.1Qaz supported attributes (NLA_NESTED)
*/
enum dcbnl_attrs {
DCB_ATTR_UNDEFINED,
@@ -119,10 +206,29 @@ enum dcbnl_attrs {
DCB_ATTR_BCN,
DCB_ATTR_APP,
+ /* IEEE std attributes */
+ DCB_ATTR_IEEE,
+
__DCB_ATTR_ENUM_MAX,
DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1,
};
+enum ieee_attrs {
+ DCB_ATTR_IEEE_UNSPEC,
+ DCB_ATTR_IEEE_ETS,
+ DCB_ATTR_IEEE_PFC,
+ DCB_ATTR_IEEE_APP_TABLE,
+ __DCB_ATTR_IEEE_MAX
+};
+#define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1)
+
+enum ieee_attrs_app {
+ DCB_ATTR_IEEE_APP_UNSPEC,
+ DCB_ATTR_IEEE_APP,
+ __DCB_ATTR_IEEE_APP_MAX
+};
+#define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1)
+
/**
* enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs
*
diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h
index b36ac7e..e2d841e 100644
--- a/include/net/dcbnl.h
+++ b/include/net/dcbnl.h
@@ -20,11 +20,22 @@
#ifndef __NET_DCBNL_H__
#define __NET_DCBNL_H__
+#include <linux/dcbnl.h>
+
/*
* Ops struct for the netlink callbacks. Used by DCB-enabled drivers through
* the netdevice struct.
*/
struct dcbnl_rtnl_ops {
+ /* IEEE 802.1Qaz std */
+ int (*ieee_getets) (struct net_device *, struct ieee_ets *);
+ int (*ieee_setets) (struct net_device *, struct ieee_ets *);
+ int (*ieee_getpfc) (struct net_device *, struct ieee_pfc *);
+ int (*ieee_setpfc) (struct net_device *, struct ieee_pfc *);
+ int (*ieee_getapp) (struct net_device *, struct dcb_app *);
+ int (*ieee_setapp) (struct net_device *, struct dcb_app *);
+
+ /* CEE std */
u8 (*getstate)(struct net_device *);
u8 (*setstate)(struct net_device *, u8);
void (*getpermhwaddr)(struct net_device *, u8 *);
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index 19ac2b9..2ff9084 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -66,6 +66,7 @@ static const struct nla_policy dcbnl_rtnl_policy[DCB_ATTR_MAX + 1] = {
[DCB_ATTR_PFC_STATE] = {.type = NLA_U8},
[DCB_ATTR_BCN] = {.type = NLA_NESTED},
[DCB_ATTR_APP] = {.type = NLA_NESTED},
+ [DCB_ATTR_IEEE] = {.type = NLA_NESTED},
};
/* DCB priority flow control to User Priority nested attributes */
@@ -167,6 +168,17 @@ static const struct nla_policy dcbnl_app_nest[DCB_APP_ATTR_MAX + 1] = {
[DCB_APP_ATTR_PRIORITY] = {.type = NLA_U8},
};
+/* IEEE 802.1Qaz nested attributes. */
+static const struct nla_policy dcbnl_ieee_policy[DCB_ATTR_IEEE_MAX + 1] = {
+ [DCB_ATTR_IEEE_ETS] = {.len = sizeof(struct ieee_ets)},
+ [DCB_ATTR_IEEE_PFC] = {.len = sizeof(struct ieee_pfc)},
+ [DCB_ATTR_IEEE_APP_TABLE] = {.type = NLA_NESTED},
+};
+
+static const struct nla_policy dcbnl_ieee_app[DCB_ATTR_IEEE_APP_MAX + 1] = {
+ [DCB_ATTR_IEEE_APP] = {.len = sizeof(struct dcb_app)},
+};
+
/* standard netlink reply call */
static int dcbnl_reply(u8 value, u8 event, u8 cmd, u8 attr, u32 pid,
u32 seq, u16 flags)
@@ -1118,6 +1130,117 @@ err:
return ret;
}
+/* Handle IEEE 802.1Qaz SET commands. If any requested operation can not
+ * be completed the entire msg is aborted and error value is returned.
+ * No attempt is made to reconcile the case where only part of the
+ * cmd can be completed.
+ */
+static int dcbnl_ieee_set(struct net_device *netdev, struct nlattr **tb,
+ u32 pid, u32 seq, u16 flags)
+{
+ const struct dcbnl_rtnl_ops *ops = netdev->dcbnl_ops;
+ struct nlattr *ieee[DCB_ATTR_IEEE_MAX + 1];
+ int err = -EOPNOTSUPP;
+
+ if (!ops)
+ goto err;
+
+ err = nla_parse_nested(ieee, DCB_ATTR_IEEE_MAX,
+ tb[DCB_ATTR_IEEE], dcbnl_ieee_policy);
+ if (err)
+ goto err;
+
+ if (ieee[DCB_ATTR_IEEE_ETS] && ops->ieee_setets) {
+ struct ieee_ets *ets = nla_data(ieee[DCB_ATTR_IEEE_ETS]);
+ err = ops->ieee_setets(netdev, ets);
+ if (err)
+ goto err;
+ }
+
+ if (ieee[DCB_ATTR_IEEE_PFC] && ops->ieee_setets) {
+ struct ieee_pfc *pfc = nla_data(ieee[DCB_ATTR_IEEE_PFC]);
+ err = ops->ieee_setpfc(netdev, pfc);
+ if (err)
+ goto err;
+ }
+
+ if (ieee[DCB_ATTR_IEEE_APP_TABLE] && ops->ieee_setapp) {
+ struct nlattr *attr;
+ int rem;
+
+ nla_for_each_nested(attr, ieee[DCB_ATTR_IEEE_APP_TABLE], rem) {
+ struct dcb_app *app_data;
+ if (nla_type(attr) != DCB_ATTR_IEEE_APP)
+ continue;
+ app_data = nla_data(attr);
+ err = ops->ieee_setapp(netdev, app_data);
+ if (err)
+ goto err;
+ }
+ }
+
+err:
+ dcbnl_reply(err, RTM_SETDCB, DCB_CMD_IEEE_SET, DCB_ATTR_IEEE,
+ pid, seq, flags);
+ return err;
+}
+
+
+/* Handle IEEE 802.1Qaz GET commands. */
+static int dcbnl_ieee_get(struct net_device *netdev, struct nlattr **tb,
+ u32 pid, u32 seq, u16 flags)
+{
+ struct sk_buff *skb;
+ struct nlmsghdr *nlh;
+ struct dcbmsg *dcb;
+ struct nlattr *ieee;
+ const struct dcbnl_rtnl_ops *ops = netdev->dcbnl_ops;
+ int err;
+
+ if (!ops)
+ return -EOPNOTSUPP;
+
+ skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
+ if (!skb)
+ return -ENOBUFS;
+
+ nlh = NLMSG_NEW(skb, pid, seq, RTM_GETDCB, sizeof(*dcb), flags);
+
+ dcb = NLMSG_DATA(nlh);
+ dcb->dcb_family = AF_UNSPEC;
+ dcb->cmd = DCB_CMD_IEEE_GET;
+
+ NLA_PUT_STRING(skb, DCB_ATTR_IFNAME, netdev->name);
+
+ ieee = nla_nest_start(skb, DCB_ATTR_IEEE);
+ if (!ieee)
+ goto nla_put_failure;
+
+ if (ops->ieee_getets) {
+ struct ieee_ets ets;
+ err = ops->ieee_getets(netdev, &ets);
+ if (!err)
+ NLA_PUT(skb, DCB_ATTR_IEEE_ETS, sizeof(ets), &ets);
+ }
+
+ if (ops->ieee_getpfc) {
+ struct ieee_pfc pfc;
+ err = ops->ieee_getpfc(netdev, &pfc);
+ if (!err)
+ NLA_PUT(skb, DCB_ATTR_IEEE_PFC, sizeof(pfc), &pfc);
+ }
+
+ nla_nest_end(skb, ieee);
+ nlmsg_end(skb, nlh);
+
+ return rtnl_unicast(skb, &init_net, pid);
+nla_put_failure:
+ nlmsg_cancel(skb, nlh);
+nlmsg_failure:
+ kfree_skb(skb);
+ return -1;
+}
+
static int dcb_doit(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
{
struct net *net = sock_net(skb->sk);
@@ -1223,6 +1346,14 @@ static int dcb_doit(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
ret = dcbnl_setapp(netdev, tb, pid, nlh->nlmsg_seq,
nlh->nlmsg_flags);
goto out;
+ case DCB_CMD_IEEE_SET:
+ ret = dcbnl_ieee_set(netdev, tb, pid, nlh->nlmsg_seq,
+ nlh->nlmsg_flags);
+ goto out;
+ case DCB_CMD_IEEE_GET:
+ ret = dcbnl_ieee_get(netdev, tb, pid, nlh->nlmsg_seq,
+ nlh->nlmsg_flags);
+ goto out;
default:
goto errout;
}
^ permalink raw reply related
* [net-next-2.6 PATCH v2 0/3] Series short description
From: John Fastabend @ 2010-12-30 19:25 UTC (permalink / raw)
To: davem; +Cc: john.r.fastabend, netdev, lucy.liu, shmulikr
Version 2 adds the recommended tlv attributes to the ets struct this will
be needed for offloaded LLDP engines. Host controlled LLDP agents will most
likely not use these fields.
Also Shmulik Ravid caught an error with a spin_lock on kmalloc failure.
---
John Fastabend (3):
net_dcb: add application notifiers
dcbnl: add appliction tlv handlers
dcbnl: add support for ieee8021Qaz attributes
include/linux/dcbnl.h | 108 ++++++++++++++++++++
include/net/dcbevent.h | 31 ++++++
include/net/dcbnl.h | 20 ++++
net/dcb/Makefile | 2
net/dcb/dcbevent.c | 40 +++++++
net/dcb/dcbnl.c | 260 +++++++++++++++++++++++++++++++++++++++++++++++-
6 files changed, 453 insertions(+), 8 deletions(-)
create mode 100644 include/net/dcbevent.h
create mode 100644 net/dcb/dcbevent.c
--
Signature
^ permalink raw reply
* Re: [net-next-2.6 PATCH v2 4/4] dcbnl: cleanup
From: John Fastabend @ 2010-12-30 19:17 UTC (permalink / raw)
To: Shmulik Ravid
Cc: davem@davemloft.net, Eilon Greenstein, Liu, Lucy,
netdev@vger.kernel.org
In-Reply-To: <1293726430.29378.95.camel@lb-tlvb-shmulik.il.broadcom.com>
On 12/30/2010 8:27 AM, Shmulik Ravid wrote:
> A couple of small cleanups for patches:
> [net-next-2.6 PATCH 1/3] dcbnl: add support for ieee8021Qaz attributes
> [net-next-2.6 PATCH 2/3] dcbnl: add appliction tlv handlers
> [net-next-2.6 PATCH 3/3] net_dcb: add application notifiers
>
> Signed-off-by: Shmulik Ravid <shmulikr@broadcom.com>
> ---
Good catch, thanks a lot. I will roll this into my patch and push a v2 so that we don't introduce a known bug. Of course I'll give you credit.
Thanks,
John.
> net/dcb/dcbnl.c | 6 ++++--
> 1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
> index b387816..ff3c12d 100644
> --- a/net/dcb/dcbnl.c
> +++ b/net/dcb/dcbnl.c
> @@ -1626,8 +1626,10 @@ u8 dcb_setapp(struct net_device *dev, struct dcb_app *new)
> if (new->priority) {
> struct dcb_app_type *entry;
> entry = kmalloc(sizeof(struct dcb_app_type), GFP_ATOMIC);
> - if (!entry)
> + if (!entry) {
> + spin_unlock(&dcb_lock);
> return -ENOMEM;
> + }
>
> memcpy(&entry->app, new, sizeof(*new));
> strncpy(entry->name, dev->name, IFNAMSIZ);
> @@ -1640,7 +1642,7 @@ out:
> }
> EXPORT_SYMBOL(dcb_setapp);
>
> -void dcb_flushapp(void)
> +static void dcb_flushapp(void)
> {
> struct dcb_app_type *app;
>
^ permalink raw reply
* Re: [net-next-2.6 PATCH v2 1/4] dcbnl: adding DCBX engine capability
From: John Fastabend @ 2010-12-30 19:09 UTC (permalink / raw)
To: Shmulik Ravid
Cc: davem@davemloft.net, Eilon Greenstein, Liu, Lucy,
netdev@vger.kernel.org
In-Reply-To: <4D1CD560.3000609@intel.com>
On 12/30/2010 10:54 AM, John Fastabend wrote:
> On 12/30/2010 8:26 AM, Shmulik Ravid wrote:
>> Adding an optional DCBX capability and a pair for get-set routines for
>> setting the device DCBX mode. The DCBX capability is a bit field of
>> supported attributes. The user is expected to set the DCBX mode with a
>> subset of the advertised attributes.
>>
>> This patch is dependent on the following patches:
>> [net-next-2.6 PATCH 1/3] dcbnl: add support for ieee8021Qaz attributes
>> [net-next-2.6 PATCH 2/3] dcbnl: add appliction tlv handlers
>> [net-next-2.6 PATCH 3/3] net_dcb: add application notifiers
>>
>> Signed-off-by: Shmulik Ravid <shmulikr@broadcom.com>
>> ---
>
> Acked-by: John Fastabend <john.r.fastabend@intel.com>
>
> Thanks for doing this Shmulik.
>
Sorry missed this on my first pass.
>
> +/* DCBX configuration */
> +static int dcbnl_getdcbx(struct net_device *netdev, struct nlattr **tb,
> + u32 pid, u32 seq, u16 flags)
> +{
> + int ret = -EINVAL;
> +
> + if (!netdev->dcbnl_ops->getdcbx)
> + return ret;
I think we should actually return -EOPNOTSUPP here.
> +
> + ret = dcbnl_reply(netdev->dcbnl_ops->getdcbx(netdev), RTM_GETDCB,
> + DCB_CMD_GDCBX, DCB_ATTR_DCBX, pid, seq, flags);
> +
> + return ret;
> +}
> +
^ permalink raw reply
* Re: [PATCH net-2.6] bridge: fix br_multicast_ipv6_rcv for paged skbs
From: Stephen Hemminger @ 2010-12-30 19:06 UTC (permalink / raw)
To: Johannes Berg
Cc: Tomas Winkler, davem-fT/PcQaiUtIeIZ0/mPfg9Q,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1293735134.21956.1.camel-8upI4CBIZJIJvtFkdXX2HixXY32XiHfO@public.gmane.org>
On Thu, 30 Dec 2010 19:52:14 +0100
Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org> wrote:
> On Thu, 2010-12-30 at 10:46 -0800, Stephen Hemminger wrote:
>
> > This doesn't look correct. The calculation of the offset doesn't look correct.
> > Just following the skb_clone(), the skb_pull value is "offset".
> > Also, the other checks return -EINVAL for incorrectly formed packet.
> >
> > --- a/net/bridge/br_multicast.c 2010-12-30 10:29:58.579510488 -0800
> > +++ b/net/bridge/br_multicast.c 2010-12-30 10:43:27.273386691 -0800
> > @@ -1464,6 +1464,9 @@ static int br_multicast_ipv6_rcv(struct
> > if (offset < 0 || nexthdr != IPPROTO_ICMPV6)
> > return 0;
> >
> > + if (!pskb_may_pull(skb, offset))
> > + return -EINVAL;
> > +
> > /* Okay, we found ICMPv6 header */
> > skb2 = skb_clone(skb, GFP_ATOMIC);
> > if (!skb2)
>
> Wouldn't that make more sense after the clone anyway? But if you look at
> my email, you'll find that there's potentially, and conditionally, more
> stuff that will be read from the skb's header, which hasn't necessarily
> been pulled in, so I think this still won't fix all the issues.
>
> Seeing how this only affects some ICMPv6 packets, maybe we should just
> use skb_copy() instead?
It comes out cleaner, and the check can be simplified.
--- a/net/bridge/br_multicast.c 2010-12-30 10:47:12.031733855 -0800
+++ b/net/bridge/br_multicast.c 2010-12-30 11:00:12.135801266 -0800
@@ -1465,19 +1465,19 @@ static int br_multicast_ipv6_rcv(struct
return 0;
/* Okay, we found ICMPv6 header */
- skb2 = skb_clone(skb, GFP_ATOMIC);
+ skb2 = skb_copy(skb, GFP_ATOMIC);
if (!skb2)
return -ENOMEM;
+ err = -EINVAL;
+ if (skb2->len < offset + sizeof(*icmp6h))
+ goto out;
+
len -= offset - skb_network_offset(skb2);
__skb_pull(skb2, offset);
skb_reset_transport_header(skb2);
- err = -EINVAL;
- if (!pskb_may_pull(skb2, sizeof(*icmp6h)))
- goto out;
^ permalink raw reply
* Re: [net-next-2.6 PATCH v2 2/4] dcbnl: adding DCBX feature flags get-set
From: John Fastabend @ 2010-12-30 19:05 UTC (permalink / raw)
To: Shmulik Ravid
Cc: davem@davemloft.net, Eilon Greenstein, Liu, Lucy,
netdev@vger.kernel.org
In-Reply-To: <1293726415.29378.93.camel@lb-tlvb-shmulik.il.broadcom.com>
On 12/30/2010 8:26 AM, Shmulik Ravid wrote:
> Adding a pair of set-get routines to dcbnl for setting the negotiation
> flags of the various DCB features. Conforms to the CEE flavor of DCBX
> The user sets these flags (enable, advertise, willing) for each feature
> to be used by the DCBX engine. The 'get' routine returns which of the
> features is enabled after the negotiation.
>
> This patch is dependent on the following patches:
> [net-next-2.6 PATCH 1/3] dcbnl: add support for ieee8021Qaz attributes
> [net-next-2.6 PATCH 2/3] dcbnl: add appliction tlv handlers
> [net-next-2.6 PATCH 3/3] net_dcb: add application notifiers
>
> Signed-off-by: Shmulik Ravid <shmulikr@broadcom.com>
> ---
[...]
One more nit ;)
> +
> + ret = nla_parse_nested(data, DCB_FEATCFG_ATTR_MAX, tb[DCB_ATTR_FEATCFG],
> + dcbnl_featcfg_nest);
> + if (ret) {
> + ret = -EINVAL;
> + goto err_out;
> + }
Why do you set EINVAL here if you use the returned error code from nla_parse_nested you get a more descriptive error. See ./lib/nlattr.c:nla_parse()/validate_nla().
[...]
> +static int dcbnl_setfeatcfg(struct net_device *netdev, struct nlattr **tb,
> + u32 pid, u32 seq, u16 flags)
> +{
> + struct nlattr *data[DCB_FEATCFG_ATTR_MAX + 1];
> + int ret = -EINVAL;
> + u8 value;
> + int i;
> +
> + if (!tb[DCB_ATTR_FEATCFG] || !netdev->dcbnl_ops->setfeatcfg)
> + return ret;
> +
> + ret = nla_parse_nested(data, DCB_FEATCFG_ATTR_MAX, tb[DCB_ATTR_FEATCFG],
> + dcbnl_featcfg_nest);
> +
> + if (ret) {
> + ret = -EINVAL;
> + goto err;
> + }
Same here.
Thanks,
John.
^ permalink raw reply
* Re: [net-next-2.6 PATCH v2 1/4] dcbnl: adding DCBX engine capability
From: John Fastabend @ 2010-12-30 18:54 UTC (permalink / raw)
To: Shmulik Ravid
Cc: davem@davemloft.net, Eilon Greenstein, Liu, Lucy,
netdev@vger.kernel.org
In-Reply-To: <1293726408.29378.92.camel@lb-tlvb-shmulik.il.broadcom.com>
On 12/30/2010 8:26 AM, Shmulik Ravid wrote:
> Adding an optional DCBX capability and a pair for get-set routines for
> setting the device DCBX mode. The DCBX capability is a bit field of
> supported attributes. The user is expected to set the DCBX mode with a
> subset of the advertised attributes.
>
> This patch is dependent on the following patches:
> [net-next-2.6 PATCH 1/3] dcbnl: add support for ieee8021Qaz attributes
> [net-next-2.6 PATCH 2/3] dcbnl: add appliction tlv handlers
> [net-next-2.6 PATCH 3/3] net_dcb: add application notifiers
>
> Signed-off-by: Shmulik Ravid <shmulikr@broadcom.com>
> ---
Acked-by: John Fastabend <john.r.fastabend@intel.com>
Thanks for doing this Shmulik.
^ permalink raw reply
* [PATCH] skge: Do not use legacy PCI power management
From: Stephen Hemminger @ 2010-12-30 18:52 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: netdev, David Miller, Linux-pm mailing list
In-Reply-To: <201012261944.32517.rjw@sisk.pl>
The skge driver used the legacy PCI power management, and did its
own PCI callbacks. Use the same code model as Rafael's changes to
sky2. Let the PCI subsystem take care of all the PCI-specific aspects of
device handling during system power transitions.
Compile tested only (so far).
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/drivers/net/skge.c 2010-12-30 10:19:01.191095951 -0800
+++ b/drivers/net/skge.c 2010-12-30 10:49:30.780295215 -0800
@@ -4044,53 +4044,40 @@ static void __devexit skge_remove(struct
}
#ifdef CONFIG_PM
-static int skge_suspend(struct pci_dev *pdev, pm_message_t state)
+static int skge_suspend(struct device *dev)
{
+ struct pci_dev *pdev = to_pci_dev(dev);
struct skge_hw *hw = pci_get_drvdata(pdev);
- int i, err, wol = 0;
+ int i;
if (!hw)
return 0;
- err = pci_save_state(pdev);
- if (err)
- return err;
-
for (i = 0; i < hw->ports; i++) {
struct net_device *dev = hw->dev[i];
struct skge_port *skge = netdev_priv(dev);
if (netif_running(dev))
skge_down(dev);
+
if (skge->wol)
skge_wol_init(skge);
-
- wol |= skge->wol;
}
skge_write32(hw, B0_IMSK, 0);
- pci_prepare_to_sleep(pdev);
-
return 0;
}
-static int skge_resume(struct pci_dev *pdev)
+static int skge_resume(struct device *dev)
{
+ struct pci_dev *pdev = to_pci_dev(dev);
struct skge_hw *hw = pci_get_drvdata(pdev);
int i, err;
if (!hw)
return 0;
- err = pci_back_from_sleep(pdev);
- if (err)
- goto out;
-
- err = pci_restore_state(pdev);
- if (err)
- goto out;
-
err = skge_reset(hw);
if (err)
goto out;
@@ -4111,12 +4098,19 @@ static int skge_resume(struct pci_dev *p
out:
return err;
}
+
+static SIMPLE_DEV_PM_OPS(skge_pm_ops, skge_suspend, skge_resume);
+#define SKGE_PM_OPS (&skge_pm_ops)
+
+#else
+
+#define SKGE_PM_OPS NULL
#endif
static void skge_shutdown(struct pci_dev *pdev)
{
struct skge_hw *hw = pci_get_drvdata(pdev);
- int i, wol = 0;
+ int i;
if (!hw)
return;
@@ -4127,15 +4121,10 @@ static void skge_shutdown(struct pci_dev
if (skge->wol)
skge_wol_init(skge);
- wol |= skge->wol;
}
- if (pci_enable_wake(pdev, PCI_D3cold, wol))
- pci_enable_wake(pdev, PCI_D3hot, wol);
-
- pci_disable_device(pdev);
+ pci_wake_from_d3(pdev, device_may_wakeup(&pdev->dev));
pci_set_power_state(pdev, PCI_D3hot);
-
}
static struct pci_driver skge_driver = {
@@ -4143,11 +4132,8 @@ static struct pci_driver skge_driver = {
.id_table = skge_id_table,
.probe = skge_probe,
.remove = __devexit_p(skge_remove),
-#ifdef CONFIG_PM
- .suspend = skge_suspend,
- .resume = skge_resume,
-#endif
.shutdown = skge_shutdown,
+ .driver.pm = SKGE_PM_OPS,
};
static struct dmi_system_id skge_32bit_dma_boards[] = {
^ permalink raw reply
* Re: [PATCH net-2.6] bridge: fix br_multicast_ipv6_rcv for paged skbs
From: Johannes Berg @ 2010-12-30 18:52 UTC (permalink / raw)
To: Stephen Hemminger
Cc: Tomas Winkler, davem-fT/PcQaiUtIeIZ0/mPfg9Q,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20101230104656.6c5a4b4e@nehalam>
On Thu, 2010-12-30 at 10:46 -0800, Stephen Hemminger wrote:
> This doesn't look correct. The calculation of the offset doesn't look correct.
> Just following the skb_clone(), the skb_pull value is "offset".
> Also, the other checks return -EINVAL for incorrectly formed packet.
>
> --- a/net/bridge/br_multicast.c 2010-12-30 10:29:58.579510488 -0800
> +++ b/net/bridge/br_multicast.c 2010-12-30 10:43:27.273386691 -0800
> @@ -1464,6 +1464,9 @@ static int br_multicast_ipv6_rcv(struct
> if (offset < 0 || nexthdr != IPPROTO_ICMPV6)
> return 0;
>
> + if (!pskb_may_pull(skb, offset))
> + return -EINVAL;
> +
> /* Okay, we found ICMPv6 header */
> skb2 = skb_clone(skb, GFP_ATOMIC);
> if (!skb2)
Wouldn't that make more sense after the clone anyway? But if you look at
my email, you'll find that there's potentially, and conditionally, more
stuff that will be read from the skb's header, which hasn't necessarily
been pulled in, so I think this still won't fix all the issues.
Seeing how this only affects some ICMPv6 packets, maybe we should just
use skb_copy() instead?
johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH net-2.6] bridge: fix br_multicast_ipv6_rcv for paged skbs
From: Stephen Hemminger @ 2010-12-30 18:46 UTC (permalink / raw)
To: Tomas Winkler; +Cc: davem, netdev, linux-wireless, Johannes Berg
In-Reply-To: <1293708753-17728-1-git-send-email-tomas.winkler@intel.com>
On Thu, 30 Dec 2010 13:32:33 +0200
Tomas Winkler <tomas.winkler@intel.com> wrote:
> use pskb_may_pull to access header correctly for paged skbs
>
> the pskb_may_pull ideom is used ipv6 heder parsing
> but omitted int the bridge code
>
> this fixes bug https://bugzilla.kernel.org/show_bug.cgi?id=25202
>
> Dec 15 14:36:40 User-PC hostapd: wlan0: STA 00:15:00:60:5d:34 IEEE 802.11: authenticated
> Dec 15 14:36:40 User-PC hostapd: wlan0: STA 00:15:00:60:5d:34 IEEE 802.11: associated (aid 2)
> Dec 15 14:36:40 User-PC hostapd: wlan0: STA 00:15:00:60:5d:34 RADIUS: starting accounting session 4D0608A3-00000005
> Dec 15 14:36:41 User-PC kernel: [175576.120287] ------------[ cut here ]------------
> Dec 15 14:36:41 User-PC kernel: [175576.120452] kernel BUG at include/linux/skbuff.h:1178!
> Dec 15 14:36:41 User-PC kernel: [175576.120609] invalid opcode: 0000 [#1] SMP
> Dec 15 14:36:41 User-PC kernel: [175576.120749] last sysfs file: /sys/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/uevent
> Dec 15 14:36:41 User-PC kernel: [175576.121035] Modules linked in: oprofile binfmt_misc bridge stp llc parport_pc ppdev arc4 iwlagn snd_hda_codec_realtek iwlcore i915 snd_hda_intel mac80211 joydev snd_hda_codec snd_hwdep snd_pcm snd_seq_midi drm_kms_helper snd_rawmidi drm snd_seq_midi_event snd_seq snd_timer snd_seq_device cfg80211 eeepc_wmi usbhid psmouse intel_agp i2c_algo_bit intel_gtt uvcvideo agpgart videodev sparse_keymap snd shpchp v4l1_compat lp hid video serio_raw soundcore output snd_page_alloc ahci libahci atl1c
> Dec 15 14:36:41 User-PC kernel: [175576.122712]
> Dec 15 14:36:41 User-PC kernel: [175576.122769] Pid: 0, comm: kworker/0:0 Tainted: G W 2.6.37-rc5-wl+ #3 1015PE/1016P
> Dec 15 14:36:41 User-PC kernel: [175576.123012] EIP: 0060:[<f83edd65>] EFLAGS: 00010283 CPU: 1
> Dec 15 14:36:41 User-PC kernel: [175576.123193] EIP is at br_multicast_rcv+0xc95/0xe1c [bridge]
> Dec 15 14:36:41 User-PC kernel: [175576.123362] EAX: 0000001c EBX: f5626318 ECX: 00000000 EDX: 00000000
> Dec 15 14:36:41 User-PC kernel: [175576.123550] ESI: ec512262 EDI: f5626180 EBP: f60b5ca0 ESP: f60b5bd8
> Dec 15 14:36:41 User-PC kernel: [175576.123737] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
> Dec 15 14:36:41 User-PC kernel: [175576.123902] Process kworker/0:0 (pid: 0, ti=f60b4000 task=f60a8000 task.ti=f60b0000)
> Dec 15 14:36:41 User-PC kernel: [175576.124137] Stack:
> Dec 15 14:36:41 User-PC kernel: [175576.124181] ec556500 f6d06800 f60b5be8 c01087d8 ec512262 00000030 00000024 f5626180
> Dec 15 14:36:41 User-PC kernel: [175576.124181] f572c200 ef463440 f5626300 3affffff f6d06dd0 e60766a4 000000c4 f6d06860
> Dec 15 14:36:41 User-PC kernel: [175576.124181] ffffffff ec55652c 00000001 f6d06844 f60b5c64 c0138264 c016e451 c013e47d
> Dec 15 14:36:41 User-PC kernel: [175576.124181] Call Trace:
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<c01087d8>] ? sched_clock+0x8/0x10
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<c0138264>] ? enqueue_entity+0x174/0x440
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<c016e451>] ? sched_clock_cpu+0x131/0x190
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<c013e47d>] ? select_task_rq_fair+0x2ad/0x730
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<c0524fc1>] ? nf_iterate+0x71/0x90
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<f83e4914>] ? br_handle_frame_finish+0x184/0x220 [bridge]
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<f83e4790>] ? br_handle_frame_finish+0x0/0x220 [bridge]
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<f83e46e9>] ? br_handle_frame+0x189/0x230 [bridge]
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<f83e4790>] ? br_handle_frame_finish+0x0/0x220 [bridge]
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<f83e4560>] ? br_handle_frame+0x0/0x230 [bridge]
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<c04ff026>] ? __netif_receive_skb+0x1b6/0x5b0
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<c04f7a30>] ? skb_copy_bits+0x110/0x210
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<c0503a7f>] ? netif_receive_skb+0x6f/0x80
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<f82cb74c>] ? ieee80211_deliver_skb+0x8c/0x1a0 [mac80211]
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<f82cc836>] ? ieee80211_rx_handlers+0xeb6/0x1aa0 [mac80211]
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<c04ff1f0>] ? __netif_receive_skb+0x380/0x5b0
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<c016e242>] ? sched_clock_local+0xb2/0x190
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<c012b688>] ? default_spin_lock_flags+0x8/0x10
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<c05d83df>] ? _raw_spin_lock_irqsave+0x2f/0x50
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<f82cd621>] ? ieee80211_prepare_and_rx_handle+0x201/0xa90 [mac80211]
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<f82ce154>] ? ieee80211_rx+0x2a4/0x830 [mac80211]
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<f815a8d6>] ? iwl_update_stats+0xa6/0x2a0 [iwlcore]
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<f8499212>] ? iwlagn_rx_reply_rx+0x292/0x3b0 [iwlagn]
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<c05d83df>] ? _raw_spin_lock_irqsave+0x2f/0x50
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<f8483697>] ? iwl_rx_handle+0xe7/0x350 [iwlagn]
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<f8486ab7>] ? iwl_irq_tasklet+0xf7/0x5c0 [iwlagn]
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<c01aece1>] ? __rcu_process_callbacks+0x201/0x2d0
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<c0150d05>] ? tasklet_action+0xc5/0x100
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<c0150a07>] ? __do_softirq+0x97/0x1d0
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<c05d910c>] ? nmi_stack_correct+0x2f/0x34
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<c0150970>] ? __do_softirq+0x0/0x1d0
> Dec 15 14:36:41 User-PC kernel: [175576.124181] <IRQ>
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<c01508f5>] ? irq_exit+0x65/0x70
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<c05df062>] ? do_IRQ+0x52/0xc0
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<c01036b0>] ? common_interrupt+0x30/0x38
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<c03a1fc2>] ? intel_idle+0xc2/0x160
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<c04daebb>] ? cpuidle_idle_call+0x6b/0x100
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<c0101dea>] ? cpu_idle+0x8a/0xf0
> Dec 15 14:36:41 User-PC kernel: [175576.124181] [<c05d2702>] ? start_secondary+0x1e8/0x1ee
>
> Cc:YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
> Cc: Johannes Berg <johannes@sipsolutions.net>
> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
> ---
> net/bridge/br_multicast.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
> index f19e347..074c478 100644
> --- a/net/bridge/br_multicast.c
> +++ b/net/bridge/br_multicast.c
> @@ -1464,6 +1464,10 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br,
> if (offset < 0 || nexthdr != IPPROTO_ICMPV6)
> return 0;
>
> + if (!pskb_may_pull(skb,
> + (skb_network_header(skb) + offset + 1 - skb->data)))
> + return 0;
> +
> /* Okay, we found ICMPv6 header */
> skb2 = skb_clone(skb, GFP_ATOMIC);
> if (!skb2)
This doesn't look correct. The calculation of the offset doesn't look correct.
Just following the skb_clone(), the skb_pull value is "offset".
Also, the other checks return -EINVAL for incorrectly formed packet.
--- a/net/bridge/br_multicast.c 2010-12-30 10:29:58.579510488 -0800
+++ b/net/bridge/br_multicast.c 2010-12-30 10:43:27.273386691 -0800
@@ -1464,6 +1464,9 @@ static int br_multicast_ipv6_rcv(struct
if (offset < 0 || nexthdr != IPPROTO_ICMPV6)
return 0;
+ if (!pskb_may_pull(skb, offset))
+ return -EINVAL;
+
/* Okay, we found ICMPv6 header */
skb2 = skb_clone(skb, GFP_ATOMIC);
if (!skb2)
--
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox