Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH net-next 1/5] sky2: force receive checksum when using RSS on some hardware
From: Michał Mirosław @ 2011-07-07 17:04 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David S. Miller, netdev
In-Reply-To: <20110707155212.000920741@vyatta.com>

2011/7/7 Stephen Hemminger <shemminger@vyatta.com>:
> Found when reviewing the vendor driver. Apparently some chip versions
> require receive checksumming to be enabled in order for RSS to work.
> Rather than silently enabling checksumming which is what the vendor
> driver does, return an error to the user instead.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>
>
> --- a/drivers/net/sky2.c        2011-07-07 08:36:10.748003369 -0700
> +++ b/drivers/net/sky2.c        2011-07-07 08:36:37.372004595 -0700
> @@ -2996,7 +2996,8 @@ static int __devinit sky2_init(struct sk
>                hw->flags = SKY2_HW_GIGABIT
>                        | SKY2_HW_NEWER_PHY
>                        | SKY2_HW_NEW_LE
> -                       | SKY2_HW_ADV_POWER_CTL;
> +                       | SKY2_HW_ADV_POWER_CTL
> +                       | SKY2_HW_RSS_CHKSUM;
>
>                /* New transmit checksum */
>                if (hw->chip_rev != CHIP_REV_YU_EX_B0)
> @@ -3024,7 +3025,7 @@ static int __devinit sky2_init(struct sk
>
>                /* The workaround for status conflicts VLAN tag detection. */
>                if (hw->chip_rev == CHIP_REV_YU_FE2_A0)
> -                       hw->flags |= SKY2_HW_VLAN_BROKEN;
> +                       hw->flags |= SKY2_HW_VLAN_BROKEN | SKY2_HW_RSS_CHKSUM;
>                break;
>
>        case CHIP_ID_YUKON_SUPR:
> @@ -3033,6 +3034,9 @@ static int __devinit sky2_init(struct sk
>                        | SKY2_HW_NEW_LE
>                        | SKY2_HW_AUTO_TX_SUM
>                        | SKY2_HW_ADV_POWER_CTL;
> +
> +               if (hw->chip_rev == CHIP_REV_YU_SU_A0)
> +                       hw->flags |= SKY2_HW_RSS_CHKSUM;
>                break;
>
>        case CHIP_ID_YUKON_UL_2:
> @@ -4187,6 +4191,11 @@ static int sky2_set_features(struct net_
>        struct sky2_port *sky2 = netdev_priv(dev);
>        u32 changed = dev->features ^ features;
>
> +       /* Some hardware requires receive checksum for RSS to work. */
> +       if ( (features & (NETIF_F_RXHASH|NETIF_F_RXCSUM)) == NETIF_F_RXHASH &&
> +            (sky2->hw->flags & SKY2_HW_RSS_CHKSUM))
> +               return -EINVAL;
> +
>        if (changed & NETIF_F_RXCSUM) {
>                u32 on = features & NETIF_F_RXCSUM;
>                sky2_write32(sky2->hw, Q_ADDR(rxqaddr[sky2->port], Q_CSR),

Nah. This won't work as the error is not passed to user (except via
dmesg) as there is no way to do it. Failing ndo_set_features() without
updating dev->features will also prevent other unrelated changes to
features set.

This should either force RXCSUM when RXHASH is on or disable RXHASH
when RXCSUM is off (both in sky2_fix_features()). Or maybe enable
RXCSUM with RXHASH but ignore hardware-computed checksum when it's not
requested.

Best Regards,
Michał Mirosław

^ permalink raw reply

* Re: linux-next: Tree for July 7 (net/af_packet)
From: Mike Frysinger @ 2011-07-07 17:06 UTC (permalink / raw)
  To: David Miller; +Cc: randy.dunlap, sfr, netdev, linux-next, linux-kernel
In-Reply-To: <20110707.081839.2119597618388053074.davem@davemloft.net>

On Thu, Jul 7, 2011 at 11:18, David Miller wrote:
> packet: Fix build with INET disabled.
>
> af_packet.c:(.text+0x3d130): undefined reference to `ip_defrag'
> or
> ERROR: "ip_defrag" [net/packet/af_packet.ko] undefined!

fixes some Blackfin boards too.
Acked-by: Mike Frysinger <vapier@gentoo.org>
-mike

^ permalink raw reply

* Re: [PATCH net-next 1/5] sky2: force receive checksum when using RSS on some hardware
From: Stephen Hemminger @ 2011-07-07 17:13 UTC (permalink / raw)
  To: Michał Mirosław; +Cc: David S. Miller, netdev
In-Reply-To: <CAHXqBF+Ha9XaMDB0x1XBD633mj2b6Jxmg9U_JSokrov90gPA-g@mail.gmail.com>

On Thu, 7 Jul 2011 19:04:46 +0200
Michał Mirosław <mirqus@gmail.com> wrote:

> 2011/7/7 Stephen Hemminger <shemminger@vyatta.com>:
> > Found when reviewing the vendor driver. Apparently some chip versions
> > require receive checksumming to be enabled in order for RSS to work.
> > Rather than silently enabling checksumming which is what the vendor
> > driver does, return an error to the user instead.
> >
> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> >
> >
> > --- a/drivers/net/sky2.c        2011-07-07 08:36:10.748003369 -0700
> > +++ b/drivers/net/sky2.c        2011-07-07 08:36:37.372004595 -0700
> > @@ -2996,7 +2996,8 @@ static int __devinit sky2_init(struct sk
> >                hw->flags = SKY2_HW_GIGABIT
> >                        | SKY2_HW_NEWER_PHY
> >                        | SKY2_HW_NEW_LE
> > -                       | SKY2_HW_ADV_POWER_CTL;
> > +                       | SKY2_HW_ADV_POWER_CTL
> > +                       | SKY2_HW_RSS_CHKSUM;
> >
> >                /* New transmit checksum */
> >                if (hw->chip_rev != CHIP_REV_YU_EX_B0)
> > @@ -3024,7 +3025,7 @@ static int __devinit sky2_init(struct sk
> >
> >                /* The workaround for status conflicts VLAN tag detection. */
> >                if (hw->chip_rev == CHIP_REV_YU_FE2_A0)
> > -                       hw->flags |= SKY2_HW_VLAN_BROKEN;
> > +                       hw->flags |= SKY2_HW_VLAN_BROKEN | SKY2_HW_RSS_CHKSUM;
> >                break;
> >
> >        case CHIP_ID_YUKON_SUPR:
> > @@ -3033,6 +3034,9 @@ static int __devinit sky2_init(struct sk
> >                        | SKY2_HW_NEW_LE
> >                        | SKY2_HW_AUTO_TX_SUM
> >                        | SKY2_HW_ADV_POWER_CTL;
> > +
> > +               if (hw->chip_rev == CHIP_REV_YU_SU_A0)
> > +                       hw->flags |= SKY2_HW_RSS_CHKSUM;
> >                break;
> >
> >        case CHIP_ID_YUKON_UL_2:
> > @@ -4187,6 +4191,11 @@ static int sky2_set_features(struct net_
> >        struct sky2_port *sky2 = netdev_priv(dev);
> >        u32 changed = dev->features ^ features;
> >
> > +       /* Some hardware requires receive checksum for RSS to work. */
> > +       if ( (features & (NETIF_F_RXHASH|NETIF_F_RXCSUM)) == NETIF_F_RXHASH &&
> > +            (sky2->hw->flags & SKY2_HW_RSS_CHKSUM))
> > +               return -EINVAL;
> > +
> >        if (changed & NETIF_F_RXCSUM) {
> >                u32 on = features & NETIF_F_RXCSUM;
> >                sky2_write32(sky2->hw, Q_ADDR(rxqaddr[sky2->port], Q_CSR),
> 
> Nah. This won't work as the error is not passed to user (except via
> dmesg) as there is no way to do it. Failing ndo_set_features() without
> updating dev->features will also prevent other unrelated changes to
> features set.

I think this needs to be fixed in the netdev core then.
There are bound to be hardware types that can support only some combinations
of features. It should be passed back like all other errors.

^ permalink raw reply

* Re: Getting the correct asix AX88178 usb gige driver in mainline?
From: Marc MERLIN @ 2011-07-07 17:23 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: netdev, greg
In-Reply-To: <201107071455.36975.arnd@arndb.de>

On Thu, Jul 07, 2011 at 02:55:36PM +0200, Arnd Bergmann wrote:
> On Wednesday 06 July 2011, Marc MERLIN wrote:
> > > The patch I mentioned was merged back in 2006, for 2.6.19. Either that
> > > patch was never complete and is missing support for your hardware, or
> > > it broke since then. You should probably try an old kernel to see if it's
> > > actually a regression.
> > 
> > Thanks for the details Arnd, I'll see if I can boot 2.6.19 on that laptop
> > and report back.
> 
> I would perhaps try something less ancient first, 2.6.27-longterm would be
> a good candidate. If it was working at some point but broken later, chances
> are that it wasn't broken until a few years ago, rather than shortly after
> it was merged.

So, it was problematic to build and boot old kernels for that system, but I
tried my USB adapter in older systems with older kernels.

2.6.20 and 2.6.22.1 both were able to bring the interface up and DHCP.
2.6.24.3 was NOT able to.
Neither was 2.6.34.1.

Mind you, those were not exactly the same kernels with the compile options
on the same machine, but those were the tests I was reasonably able to do
for now.




Linux polgara.svh.merlins.org 2.6.20-16-generic #2 SMP Thu Jun 7 20:19:32 UTC 2007 i686 GNU/Linux
usb 1-5: new high speed USB device using ehci_hcd and address 3
usb 1-5: configuration #1 chosen from 1 choice
eth0: register 'asix' at usb-0000:00:1a.7-5, ASIX AX88178 USB 2.0 Ethernet, 00:0e:c6:88:7c:ae
usbcore: registered new interface driver asix
eth2: link down
ADDRCONF(NETDEV_UP): eth2: link is not ready
ADDRCONF(NETDEV_CHANGE): eth2: link becomes ready
eth2: link up, 1000Mbps, full-duplex, lpa 0xC5E1
eth2: no IPv6 routers present
eth1: no IPv6 routers present
-> OK


2.6.22.1-libata-tj-20070803-p4smp-preempt-1khz-marc4
eth0: register 'asix' at usb-0000:00:1a.7-5, ASIX AX88178 USB 2.0 Ethernet, 00:0e:c6:88:7c:ae
usbcore: registered new interface driver asix
eth2: link down
ADDRCONF(NETDEV_UP): eth2: link is not ready
ADDRCONF(NETDEV_CHANGE): eth2: link becomes ready
eth2: link up, 1000Mbps, full-duplex, lpa 0xC5E1
eth2: no IPv6 routers present
eth1: no IPv6 routers present
-> OK


2.6.24.3-slub-k8up-preempt-noticks-marc1 (different machine)
usb 1-4: new high speed USB device using ehci_hcd and address 4
usb 1-4: configuration #1 chosen from 1 choice
eth1: register 'asix' at usb-0000:00:02.2-4, ASIX AX88178 USB 2.0 Ethernet, 00:0e:c6:88:7c:ae
usbcore: registered new interface driver asix
udev: renamed network interface eth1 to eth3
eth3: link up, 1000Mbps, full-duplex, lpa 0xCDE1
eth3: link up, 1000Mbps, full-duplex, lpa 0xCDE1
eth3: no IPv6 routers present
-> NOT OK
 
Linux polgara.svh.merlins.org 2.6.34.1-core2smp-1khznohz-preempt-notcks-noide-hm64-20100724 #2 SMP Sat Jul 24 16:02:09 PDT 2010 i686 GNU/Linux
usb 1-5: new high speed USB device using ehci_hcd and address 4
usb 1-5: New USB device found, idVendor=0b95, idProduct=1780
usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-5: Product: AX88178 
usb 1-5: Manufacturer: ASIX Elec. Corp.
usb 1-5: SerialNumber: 000002
asix 1-5:1.0: eth1: register 'asix' at usb-0000:00:1a.7-5, ASIX AX88178 USB
2.0 Ethernet, 00:0e:c6:88:7c:ae
usbcore: registered new interface driver asix
eth1: link down
ADDRCONF(NETDEV_UP): eth1: link is not ready
ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
eth1: link up, 1000Mbps, full-duplex, lpa 0xC5E1
eth1: no IPv6 routers present
->  NOT OK

Marc
-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/  

^ permalink raw reply

* Re: [PATCH net-next 1/5] sky2: force receive checksum when using RSS on some hardware
From: Michał Mirosław @ 2011-07-07 17:40 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David S. Miller, netdev
In-Reply-To: <20110707101322.784409eb@nehalam.ftrdhcpuser.net>

W dniu 7 lipca 2011 19:13 użytkownik Stephen Hemminger
<shemminger@vyatta.com> napisał:
> On Thu, 7 Jul 2011 19:04:46 +0200
> Michał Mirosław <mirqus@gmail.com> wrote:
>
>> 2011/7/7 Stephen Hemminger <shemminger@vyatta.com>:
>> > Found when reviewing the vendor driver. Apparently some chip versions
>> > require receive checksumming to be enabled in order for RSS to work.
>> > Rather than silently enabling checksumming which is what the vendor
>> > driver does, return an error to the user instead.
>> >
>> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>> >
>> >
>> > --- a/drivers/net/sky2.c        2011-07-07 08:36:10.748003369 -0700
>> > +++ b/drivers/net/sky2.c        2011-07-07 08:36:37.372004595 -0700
>> > @@ -2996,7 +2996,8 @@ static int __devinit sky2_init(struct sk
>> >                hw->flags = SKY2_HW_GIGABIT
>> >                        | SKY2_HW_NEWER_PHY
>> >                        | SKY2_HW_NEW_LE
>> > -                       | SKY2_HW_ADV_POWER_CTL;
>> > +                       | SKY2_HW_ADV_POWER_CTL
>> > +                       | SKY2_HW_RSS_CHKSUM;
>> >
>> >                /* New transmit checksum */
>> >                if (hw->chip_rev != CHIP_REV_YU_EX_B0)
>> > @@ -3024,7 +3025,7 @@ static int __devinit sky2_init(struct sk
>> >
>> >                /* The workaround for status conflicts VLAN tag detection. */
>> >                if (hw->chip_rev == CHIP_REV_YU_FE2_A0)
>> > -                       hw->flags |= SKY2_HW_VLAN_BROKEN;
>> > +                       hw->flags |= SKY2_HW_VLAN_BROKEN | SKY2_HW_RSS_CHKSUM;
>> >                break;
>> >
>> >        case CHIP_ID_YUKON_SUPR:
>> > @@ -3033,6 +3034,9 @@ static int __devinit sky2_init(struct sk
>> >                        | SKY2_HW_NEW_LE
>> >                        | SKY2_HW_AUTO_TX_SUM
>> >                        | SKY2_HW_ADV_POWER_CTL;
>> > +
>> > +               if (hw->chip_rev == CHIP_REV_YU_SU_A0)
>> > +                       hw->flags |= SKY2_HW_RSS_CHKSUM;
>> >                break;
>> >
>> >        case CHIP_ID_YUKON_UL_2:
>> > @@ -4187,6 +4191,11 @@ static int sky2_set_features(struct net_
>> >        struct sky2_port *sky2 = netdev_priv(dev);
>> >        u32 changed = dev->features ^ features;
>> >
>> > +       /* Some hardware requires receive checksum for RSS to work. */
>> > +       if ( (features & (NETIF_F_RXHASH|NETIF_F_RXCSUM)) == NETIF_F_RXHASH &&
>> > +            (sky2->hw->flags & SKY2_HW_RSS_CHKSUM))
>> > +               return -EINVAL;
>> > +
>> >        if (changed & NETIF_F_RXCSUM) {
>> >                u32 on = features & NETIF_F_RXCSUM;
>> >                sky2_write32(sky2->hw, Q_ADDR(rxqaddr[sky2->port], Q_CSR),
>>
>> Nah. This won't work as the error is not passed to user (except via
>> dmesg) as there is no way to do it. Failing ndo_set_features() without
>> updating dev->features will also prevent other unrelated changes to
>> features set.
>
> I think this needs to be fixed in the netdev core then.
> There are bound to be hardware types that can support only some combinations
> of features. It should be passed back like all other errors.

This is what ndo_fix_features callback is for - it should alter passed
feature set to what combinations are permitted for the device's
current state.

Updating of the features is not always initiated by user (it might be
because, e.g. link speed changed) - in those cases the error has no
place to go.

Best Regards,
Michał Mirosław

^ permalink raw reply

* Re: Getting the correct asix AX88178 usb gige driver in mainline?
From: Arnd Bergmann @ 2011-07-07 17:43 UTC (permalink / raw)
  To: Marc MERLIN; +Cc: netdev, greg
In-Reply-To: <20110707172350.GD13683@merlins.org>

On Thursday 07 July 2011 19:23:50 Marc MERLIN wrote:
> On Thu, Jul 07, 2011 at 02:55:36PM +0200, Arnd Bergmann wrote:
> > On Wednesday 06 July 2011, Marc MERLIN wrote:
> > > > The patch I mentioned was merged back in 2006, for 2.6.19. Either that
> > > > patch was never complete and is missing support for your hardware, or
> > > > it broke since then. You should probably try an old kernel to see if it's
> > > > actually a regression.
> > > 
> > > Thanks for the details Arnd, I'll see if I can boot 2.6.19 on that laptop
> > > and report back.
> > 
> > I would perhaps try something less ancient first, 2.6.27-longterm would be
> > a good candidate. If it was working at some point but broken later, chances
> > are that it wasn't broken until a few years ago, rather than shortly after
> > it was merged.
> 
> So, it was problematic to build and boot old kernels for that system, but I
> tried my USB adapter in older systems with older kernels.
> 
> 2.6.20 and 2.6.22.1 both were able to bring the interface up and DHCP.
> 2.6.24.3 was NOT able to.
> Neither was 2.6.34.1.

Not a lot has changed int hat driver between 2.6.22 and 2.6.24, so you could
try

git diff v2.6.22..v2.6.24 drivers/net/usb/asix.c  | patch -Rp1 

on the latest version and see if that helps. There are some rejects, but
those all look harmless.

	Arnd

^ permalink raw reply

* Re: [PATCH 08/10] dynamic_debug: make netif_dbg() call __netdev_printk()
From: Jason Baron @ 2011-07-07 18:09 UTC (permalink / raw)
  To: Joe Perches
  Cc: gregkh, jim.cromie, bvanassche, linux-kernel, davem,
	aloisio.almeida, netdev
In-Reply-To: <1310056161.27526.47.camel@Joe-Laptop>

On Thu, Jul 07, 2011 at 09:29:21AM -0700, Joe Perches wrote:
> On Thu, 2011-07-07 at 10:13 -0400, Jason Baron wrote:
> > On Wed, Jul 06, 2011 at 02:59:03PM -0700, Joe Perches wrote:
> > > > diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> > > > @@ -2731,10 +2731,8 @@ do {								\
> > > >  #elif defined(CONFIG_DYNAMIC_DEBUG)
> > > >  #define netif_dbg(priv, type, netdev, format, args...)		\
> > > >  do {								\
> > > > -	if (netif_msg_##type(priv))				\
> > > > -		dynamic_dev_dbg((netdev)->dev.parent,		\
> > > > -				"%s: " format,			\
> > > > -				netdev_name(netdev), ##args);	\
> > > > +	dynamic_netif_dbg(netdev, (netif_msg_##type(priv)),	\
> > > > +				  format, ##args);		\
> > > Because you've already added dynamic_netdev_dbg,
> > > maybe this should be:
> > > #define netif_dbg(priv, type, netdev, format, args...)		\
> > > do {								\
> > > 	if (netif_msg_##type(priv))				\
> > > 		dynamic_netdev_dbg(netdev, format, ##args);	\
> > > } while (0)
> > The reason I didn't add it this way is b/c I plan on converting the
> > outer 'ifs' to the jump label infrastructure - which makes the disabled
> > case just a no-op and moves the printk and tests out of line.
> 
> Perhaps you needn't do that.
> 
> I think there's little to be gained to move the test
> outwards and not perform the netif_msg##type(priv)

In this particualr case, there might not be a large gain, but when I've
converted all of the dynamic debug infrastructure to jump labels I can
consistently see througput gains of 1% on tbench testing.

> 
> > Until that is done, i could see coding it as you've suggested, but I'd
> > prefer to leave it as is (and leave future churn to within the dynamic
> > debug code as opposed to the netdevice.h header).
> 
> Shrug.  I think that dynamic_debug will have continuing
> impacts on various subsystems unless there's some generic
> __dynamic_dbg() and _prefix() mechanism introduced into
> more generic <foo>_dbg style.
> 
> Anything logging message that uses <foo>_dbg or <foo>_vdbg
> is a candidate for dynamic_debug uses, but there's no
> current generic mechanism to avoid subsystem specific needs.
> 
> Any of these could need some dynamic_debug consideration:
> 

right. looking quickly over this list there seem to be a few different
categories:

-some just alias to dev_dbg(), so they are already picked up
-some use level logging, this could be easily added to dyanmic debug -
  we store level info in the descriptor and then check it against
  a currently set level, which can be per-debug statement
-any ones that can't fit the current model could probably be easily
 converted using a callback, That is we have some dynamic debug
 function take an optional function, which if the debugging is enabled
 is called. The format string, could optionally be blank in this case,
 I guess.

So I think it could be converted while being minimaly invasive in terms
of run-time checking. In fact, that was one of my original goals was to
try and convert all the disparate debugging calls, to a more generic
infrastructure. I know some subsystem converted to use pr_debug(), to
tie into dynamic debug, but it would take a bit of work to convert the
rest...thoughts?

thanks,

-Jason


> $ grep -rPoh --include=*.[ch] "[a-z_]+_[v]?dbg\(" * | sort | uniq
> acpi_ut_allocate_object_desc_dbg(
> acpi_ut_create_internal_object_dbg(
> adc_dbg(
> add_dyn_dbg(
> airo_print_dbg(
> ata_dev_dbg(
> ata_link_dbg(
> ata_port_dbg(
> ath_dbg(
> atm_dbg(
> bat_dbg(
> bit_dbg(
> cafe_dev_dbg(
> cam_dbg(
> c_freq_dbg(
> chan_dbg(
> chan_reg_rule_print_dbg(
> cmm_dbg(
> c_pm_dbg(
> ctrl_dbg(
> __dbg(
> desc_dbg(
> dev_dbg(
> dev_vdbg(
> dma_request_channel_dbg(
> __dump_desc_dbg(
> dump_desc_dbg(
> dump_pq_desc_dbg(
> dynamic_dev_dbg(
> e_dbg(
> ehca_dbg(
> ehca_gen_dbg(
> ehci_dbg(
> ehci_vdbg(
> en_dbg(
> ep_dbg(
> ep_vdbg(
> fhci_dbg(
> fhci_vdbg(
> fit_dbg(
> gig_dbg(
> gpio_dbg(
> gru_dbg(
> hgpk_dbg(
> hid_dbg(
> hw_dbg(
> ibmvfc_dbg(
> ipath_dbg(
> ipoib_dbg(
> ipr_dbg(
> iser_dbg(
> isp_isr_dbg(
> itd_dbg(
> ite_dbg(
> l_dbg(
> lg_dbg(
> mce_dbg(
> memblock_dbg(
> mhwmp_dbg(
> mpeg_dbg(
> mpl_dbg(
> msg_dbg(
> mthca_dbg(
> netdev_dbg(
> netdev_vdbg(
> netif_dbg(
> netif_vdbg(
> nfc_dbg(
> nfc_dev_dbg(
> nsp_dbg(
> nvt_dbg(
> ohci_dbg(
> ohci_vdbg(
> oxu_dbg(
> oxu_vdbg(
> pch_dbg(
> pch_pci_dbg(
> pm_dev_dbg(
> pnp_dbg(
> pop_dbg(
> prep_dma_pq_dbg(
> prep_dma_pqzero_sum_dbg(
> prep_dma_xor_dbg(
> _print_dbg(
> print_dbg(
> pwm_dbg(
> rdev_dbg(
> reg_dbg(
> sh_keysc_map_dbg(
> slice_dbg(
> smsc_dbg(
> start_dbg(
> stop_dbg(
> sysrq_handle_dbg(
> tda_dbg(
> tgt_dbg(
> tipc_msg_dbg(
> __tuner_dbg(
> tuner_dbg(
> tveeprom_dbg(
> tx_dbg(
> uea_dbg(
> uea_vdbg(
> ugeth_dbg(
> ugeth_vdbg(
> urb_dbg(
> usb_dbg(
> vpif_dbg(
> wiphy_dbg(
> wiphy_vdbg(
> xhci_dbg(
> x_show_dbg(
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply

* Re: [PATCH V8 2/4 net-next] skbuff: skb supports zero-copy buffers
From: Shirley Ma @ 2011-07-07 18:32 UTC (permalink / raw)
  To: David Miller; +Cc: mst, netdev, kvm, linux-kernel
In-Reply-To: <20110707.040149.441417258943576903.davem@davemloft.net>

On Thu, 2011-07-07 at 04:01 -0700, David Miller wrote:
> From: Shirley Ma <mashirle@us.ibm.com>
> Date: Wed, 06 Jul 2011 15:22:12 -0700
> 
> > +                     while (head) {
> > +                             put_page(head);
> > +                             head = (struct page *)head->private;
> > +                     }
> 
> Looks like you might be referencing the page after it's
> release here.  I think you need something like:
> 
>                         while (head) {
>                                 struct page *next = (struct page
> *)head->private;
>                                 put_page(head);
>                                 head = next;
>                         }
> --

You are right, will fix it.

Thanks
Shirley
 


^ permalink raw reply

* Re: [PATCH V8 2/4 net-next] skbuff: skb supports zero-copy buffers
From: David Miller @ 2011-07-07 18:39 UTC (permalink / raw)
  To: mashirle; +Cc: mst, netdev, kvm, linux-kernel
In-Reply-To: <1310063545.10209.30.camel@localhost.localdomain>

From: Shirley Ma <mashirle@us.ibm.com>
Date: Thu, 07 Jul 2011 11:32:25 -0700

> You are right, will fix it.

You don't need to, I fixed it when I committed the patch
to net-next-2.6

^ permalink raw reply

* Re: [PATCH] net/fec: gasket needs to be enabled for some i.mx
From: Grant Likely @ 2011-07-07 18:44 UTC (permalink / raw)
  To: Shawn Guo
  Cc: David Miller, netdev, s.hauer, troy.kisky, u.kleine-koenig,
	shawn.guo, linux-arm-kernel, LW
In-Reply-To: <20110707134157.GA12722@S2100-06.ap.freescale.net>

On Thu, Jul 07, 2011 at 09:41:58PM +0800, Shawn Guo wrote:
> On Thu, Jul 07, 2011 at 04:12:57AM -0700, David Miller wrote:
> > From: Shawn Guo <shawn.guo@linaro.org>
> > Date: Fri,  1 Jul 2011 18:11:22 +0800
> > 
> > > On the recent i.mx (mx25/50/53), there is a gasket inside fec
> > > controller which needs to be enabled no matter phy works in MII
> > > or RMII mode.
> > > 
> > > The current code enables the gasket only when phy interface is RMII.
> > > It's broken when the driver works with a MII phy.  The patch uses
> > > platform_device_id to distinguish the SoCs that have the gasket and
> > > enables it on these SoCs for both MII and RMII mode.
> > > 
> > > Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> > > Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> > 
> > Acked-by: David S. Miller <davem@davemloft.net>
> > --
> 
> Thanks, David.  I will try to get it through Sascha's tree after
> the rebase again dt series.
> 
> Hi Sascha,
> 
> How should we proceed?  It seems Grant will take the fec-dt series
> on his tree.  Would you then merge that tree into yours, so that I
> can rebase this patch on your tree and get it go through there?

I should probably just take the lot.

g.

> 
> -- 
> Regards,
> Shawn
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply

* I need your assistance
From: leung  cheung @ 2011-07-07 19:47 UTC (permalink / raw)



Hello,

Compliment of the day to you. I am sending this brief letter to solicit 
your partnership to transfer $22,500,000.00 US Dollars from Hong Kong to 
your country. You will be entitled to 40% after compliting the transaction 
while I will be entitled to 60% as the sole initiator of this mutual 
proposal. I shall send you more information and procedures when I receive 
a positive response from you.

Best Regards,

Mr. Leung Cheung
Email: leungcheung18@helixnet.cn



^ permalink raw reply

* Re: [stable] [PATCH] usb: usbnet: suspend count gets lost when -EBUSY
From: Greg KH @ 2011-07-07 20:50 UTC (permalink / raw)
  To: C.Fries; +Cc: David Miller, netdev, stable
In-Reply-To: <CADuEq9BQX2BFBY3pF=CEEymfK4JPwMP7By+JZFdaLqxs+GhtJQ@mail.gmail.com>

On Tue, Jul 05, 2011 at 08:35:05PM -0500, Chris Fries wrote:
> When suspend is refused due to pending transmits, the
> busy counter gets out of sync, and suspend will stop
> working correctly.
> 
> Signed-off-by: Chris Fries <C.Fries@motorola.com>
> ---
>  drivers/net/usb/usbnet.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read Documentation/stable_kernel_rules.txt
for how to do this properly.

</formletter>

^ permalink raw reply

* Re: [PATCHv3] sctp: Enforce retransmission limit during shutdown
From: David Miller @ 2011-07-07 21:09 UTC (permalink / raw)
  To: vladislav.yasevich; +Cc: netdev, yjwei, sri, linux-sctp
In-Reply-To: <4E15B65A.3010209@hp.com>

From: Vladislav Yasevich <vladislav.yasevich@hp.com>
Date: Thu, 07 Jul 2011 09:36:26 -0400

> On 07/07/2011 06:28 AM, Thomas Graf wrote:
>> When initiating a graceful shutdown while having data chunks
>> on the retransmission queue with a peer which is in zero
>> window mode the shutdown is never completed because the
>> retransmission error count is reset periodically by the
>> following two rules:
 ...
>> Signed-off-by: Thomas Graf <tgraf@infradead.org>
> 
> Acked-by: Vlad Yasevich <vladislav.yasevich@hp.com>

Applied.

^ permalink raw reply

* Re: [PATCH 3/4] x86: Implement strict user copy checks for x86_64
From: Andrew Morton @ 2011-07-07 21:54 UTC (permalink / raw)
  To: Stephen Boyd; +Cc: linux-kernel, netdev
In-Reply-To: <1306865673-20560-4-git-send-email-sboyd@codeaurora.org>

On Tue, 31 May 2011 11:14:32 -0700
Stephen Boyd <sboyd@codeaurora.org> wrote:

> Strict user copy checks are only really supported on x86_32 even
> though the config option is selectable on x86_64. Add the
> necessary support to the 64 bit code to trigger copy_from_user()
> warnings at compile time.

I'm still reluctant to go and throw a pile of warnings into many
people's faces without having made an attempt to fix them.


We get a screen full of these:

    inlined from 'pktgen_if_write' at net/core/pktgen.c:877:
/usr/src/devel/arch/x86/include/asm/uaccess_64.h:64: warning: call to 'copy_from_user_overflow' declared with attribute warning: copy_from_user() buffer size is not provably correct
In function 'copy_from_user',
    inlined from 'pktgen_if_write' at net/core/pktgen.c:1145:
/usr/src/devel/arch/x86/include/asm/uaccess_64.h:64: warning: call to 'copy_from_user_overflow' declared with attribute warning: copy_from_user() buffer size is not provably correct
In function 'copy_from_user',
...

and I don't immediately see a way of suppressing them without adding
additional code.

Ideas?

^ permalink raw reply

* RE: [PATCH] [v3][net][bna] Fix call trace when interrupts are disabled while sleeping function kzalloc is called
From: Shyam_Iyer @ 2011-07-07 21:53 UTC (permalink / raw)
  To: ivecera, shyam.iyer.t; +Cc: netdev, rmody, ddutt, huangj, davem
In-Reply-To: <1310051634.4392.29.camel@ceranb.intra.cera.cz>



> -----Original Message-----
> From: Ivan Vecera [mailto:ivecera@redhat.com]
> Sent: Thursday, July 07, 2011 11:14 AM
> To: Shyam Iyer
> Cc: netdev@vger.kernel.org; rmody@brocade.com; ddutt@brocade.com;
> huangj@brocade.com; davem@davemloft.net; Iyer, Shyam
> Subject: Re: [PATCH] [v3][net][bna] Fix call trace when interrupts are
> disabled while sleeping function kzalloc is called
> 
> Small note, the root of the problem was that non-atomic allocation was
> requested with IRQs disabled. Your patch description does not contain
> why were the IRQs disabled.
> The function bnad_mbox_irq_alloc incorrectly uses 'flags' var for two
> different things, 1) to save current CPU flags and 2) for request_irq
> call.
> First the spin_lock_irqsave disables the IRQs and saves _all_ CPU flags
> (including one that enables/disables interrupts) to 'flags'. Then the
> 'flags' is overwritten by 0 or 0x80 (IRQF_SHARED). Finally the
> spin_unlock_irqrestore should restore saved flags, but these flags are
> now either 0x00 or 0x80. The interrupt bit value in flags register on
> x86 arch is 0x100.
> This means that the interrupt bit is zero (IRQs disabled) after
> spin_unlock_irqrestore so the request_irq function is called with
> disabled interrupts.

That seems to make a lot more sense.. and that way I don't have to initialize the flags variable outside of the spin_lock_irqsave/restore bracket to preserve the irqs not being disabled when allocating in request_irq

Would the below patch make sense instead...? (Note that since davem has accepted the earlier one this is on top of the already committed patch)

diff --git a/drivers/net/bna/bnad.c b/drivers/net/bna/bnad.c
index 44e219c..ea13605 100644
--- a/drivers/net/bna/bnad.c
+++ b/drivers/net/bna/bnad.c
@@ -1111,7 +1111,7 @@ bnad_mbox_irq_alloc(struct bnad *bnad,
                    struct bna_intr_info *intr_info)
 {
        int             err = 0;
-       unsigned long   irq_flags = 0, flags;
+       unsigned long   irq_flags, flags;
        u32     irq;
        irq_handler_t   irq_handler;
 
@@ -1125,6 +1125,7 @@ bnad_mbox_irq_alloc(struct bnad *bnad,
        if (bnad->cfg_flags & BNAD_CF_MSIX) {
                irq_handler = (irq_handler_t)bnad_msix_mbox_handler;
                irq = bnad->msix_table[bnad->msix_num - 1].vector;
+               irq_flags = 0;
                intr_info->intr_type = BNA_INTR_T_MSIX;
                intr_info->idl[0].vector = bnad->msix_num - 1;
        } else {
@@ -1135,7 +1136,6 @@ bnad_mbox_irq_alloc(struct bnad *bnad,
                /* intr_info->idl.vector = 0 ? */
        }
        spin_unlock_irqrestore(&bnad->bna_lock, flags);
-       flags = irq_flags;
        sprintf(bnad->mbox_irq_name, "%s", BNAD_NAME);
 
        /*
@@ -1146,7 +1146,7 @@ bnad_mbox_irq_alloc(struct bnad *bnad,
 
        BNAD_UPDATE_CTR(bnad, mbox_intr_disabled);
 
-       err = request_irq(irq, irq_handler, flags,
+       err = request_irq(irq, irq_handler, irq_flags,
                          bnad->mbox_irq_name, bnad);
 
        if (err) {
(END)

> 
> Rasesh, this is not a good idea to use one variable for two different
> purposes in parallel.
> 
> Regards,
> Ivan
> 
> On Tue, 2011-06-28 at 14:58 -0400, Shyam Iyer wrote:
> > request_threaded irq will call kzalloc that can sleep. Initializing
> the flags variable outside of spin_lock_irqsave/restore in
> bnad_mbox_irq_alloc will avoid call traces like below.
> >
> > Jun 27 08:15:24 home-t710 kernel: [11735.634550] Brocade 10G Ethernet
> driver
> > Jun 27 08:15:24 home-t710 kernel: [11735.634590] bnad_pci_probe :
> (0xffff880427f3d000, 0xffffffffa020f3e0) PCI Func : (2)
> > Jun 27 08:15:24 home-t710 kernel: [11735.637677] bna 0000:82:00.2:
> PCI INT A -> GSI 66 (level, low) -> IRQ 66
> > Jun 27 08:15:24 home-t710 kernel: [11735.638290] bar0 mapped to
> ffffc90014980000, len 262144
> > Jun 27 08:15:24 home-t710 kernel: [11735.638732] BUG: sleeping
> function called from invalid context at mm/slub.c:847
> > Jun 27 08:15:24 home-t710 kernel: [11735.638736] in_atomic(): 0,
> irqs_disabled(): 1, pid: 11243, name: insmod
> > Jun 27 08:15:24 home-t710 kernel: [11735.638740] Pid: 11243, comm:
> insmod Not tainted 3.0.0-rc4+ #6
> > Jun 27 08:15:24 home-t710 kernel: [11735.638743] Call Trace:
> > Jun 27 08:15:24 home-t710 kernel: [11735.638755]
> [<ffffffff81046427>] __might_sleep+0xeb/0xf0
> > Jun 27 08:15:24 home-t710 kernel: [11735.638766]
> [<ffffffffa01fe469>] ? netif_wake_queue+0x3d/0x3d [bna]
> > Jun 27 08:15:24 home-t710 kernel: [11735.638773]
> [<ffffffff8111201c>] kmem_cache_alloc_trace+0x43/0xd8
> > Jun 27 08:15:24 home-t710 kernel: [11735.638782]
> [<ffffffffa01fe469>] ? netif_wake_queue+0x3d/0x3d [bna]
> > Jun 27 08:15:24 home-t710 kernel: [11735.638787]
> [<ffffffff810ab791>] request_threaded_irq+0xa1/0x113
> > Jun 27 08:15:24 home-t710 kernel: [11735.638798]
> [<ffffffffa020f0c0>] bnad_pci_probe+0x612/0x8e5 [bna]
> > Jun 27 08:15:24 home-t710 kernel: [11735.638807]
> [<ffffffffa01fe469>] ? netif_wake_queue+0x3d/0x3d [bna]
> > Jun 27 08:15:24 home-t710 kernel: [11735.638816]
> [<ffffffff81482ef4>] ? _raw_spin_unlock_irqrestore+0x17/0x19
> > Jun 27 08:15:24 home-t710 kernel: [11735.638822]
> [<ffffffff8124d17a>] local_pci_probe+0x44/0x75
> > Jun 27 08:15:24 home-t710 kernel: [11735.638826]
> [<ffffffff8124dc06>] pci_device_probe+0xd0/0xff
> > Jun 27 08:15:24 home-t710 kernel: [11735.638832]
> [<ffffffff812ef8ab>] driver_probe_device+0x131/0x213
> > Jun 27 08:15:24 home-t710 kernel: [11735.638836]
> [<ffffffff812ef9e7>] __driver_attach+0x5a/0x7e
> > Jun 27 08:15:24 home-t710 kernel: [11735.638840]
> [<ffffffff812ef98d>] ? driver_probe_device+0x213/0x213
> > Jun 27 08:15:24 home-t710 kernel: [11735.638844]
> [<ffffffff812ee933>] bus_for_each_dev+0x53/0x89
> > Jun 27 08:15:24 home-t710 kernel: [11735.638848]
> [<ffffffff812ef48a>] driver_attach+0x1e/0x20
> > Jun 27 08:15:24 home-t710 kernel: [11735.638852]
> [<ffffffff812ef0ae>] bus_add_driver+0xd1/0x224
> > Jun 27 08:15:24 home-t710 kernel: [11735.638858]
> [<ffffffffa01b8000>] ? 0xffffffffa01b7fff
> > Jun 27 08:15:24 home-t710 kernel: [11735.638862]
> [<ffffffff812efe57>] driver_register+0x98/0x105
> > Jun 27 08:15:24 home-t710 kernel: [11735.638866]
> [<ffffffffa01b8000>] ? 0xffffffffa01b7fff
> > Jun 27 08:15:24 home-t710 kernel: [11735.638871]
> [<ffffffff8124e4c9>] __pci_register_driver+0x56/0xc1
> > Jun 27 08:15:24 home-t710 kernel: [11735.638875]
> [<ffffffffa01b8000>] ? 0xffffffffa01b7fff
> > Jun 27 08:15:24 home-t710 kernel: [11735.638884]
> [<ffffffffa01b8040>] bnad_module_init+0x40/0x60 [bna]
> > Jun 27 08:15:24 home-t710 kernel: [11735.638892]
> [<ffffffff81002099>] do_one_initcall+0x7f/0x136
> > Jun 27 08:15:24 home-t710 kernel: [11735.638899]
> [<ffffffff8108608b>] sys_init_module+0x88/0x1d0
> > Jun 27 08:15:24 home-t710 kernel: [11735.638906]
> [<ffffffff81489682>] system_call_fastpath+0x16/0x1b
> > Jun 27 08:15:24 home-t710 kernel: [11735.639642] bnad_pci_probe :
> (0xffff880427f3e000, 0xffffffffa020f3e0) PCI Func : (3)
> > Jun 27 08:15:24 home-t710 kernel: [11735.639665] bna 0000:82:00.3:
> PCI INT A -> GSI 66 (level, low) -> IRQ 66
> > Jun 27 08:15:24 home-t710 kernel: [11735.639735] bar0 mapped to
> ffffc90014400000, len 262144
> >
> > Signed-off-by: Shyam Iyer <shyam_iyer@dell.com>
> > ---
> >  drivers/net/bna/bnad.c |    7 +++----
> >  1 files changed, 3 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/net/bna/bnad.c b/drivers/net/bna/bnad.c
> > index 7d25a97..44e219c 100644
> > --- a/drivers/net/bna/bnad.c
> > +++ b/drivers/net/bna/bnad.c
> > @@ -1111,7 +1111,7 @@ bnad_mbox_irq_alloc(struct bnad *bnad,
> >  		    struct bna_intr_info *intr_info)
> >  {
> >  	int 		err = 0;
> > -	unsigned long 	flags;
> > +	unsigned long 	irq_flags = 0, flags;
> >  	u32	irq;
> >  	irq_handler_t 	irq_handler;
> >
> > @@ -1125,18 +1125,17 @@ bnad_mbox_irq_alloc(struct bnad *bnad,
> >  	if (bnad->cfg_flags & BNAD_CF_MSIX) {
> >  		irq_handler = (irq_handler_t)bnad_msix_mbox_handler;
> >  		irq = bnad->msix_table[bnad->msix_num - 1].vector;
> > -		flags = 0;
> >  		intr_info->intr_type = BNA_INTR_T_MSIX;
> >  		intr_info->idl[0].vector = bnad->msix_num - 1;
> >  	} else {
> >  		irq_handler = (irq_handler_t)bnad_isr;
> >  		irq = bnad->pcidev->irq;
> > -		flags = IRQF_SHARED;
> > +		irq_flags = IRQF_SHARED;
> >  		intr_info->intr_type = BNA_INTR_T_INTX;
> >  		/* intr_info->idl.vector = 0 ? */
> >  	}
> >  	spin_unlock_irqrestore(&bnad->bna_lock, flags);
> > -
> > +	flags = irq_flags;
> >  	sprintf(bnad->mbox_irq_name, "%s", BNAD_NAME);
> >
> >  	/*
> 
> 


^ permalink raw reply related

* Re: [PATCH 08/10] dynamic_debug: make netif_dbg() call __netdev_printk()
From: Joe Perches @ 2011-07-07 21:55 UTC (permalink / raw)
  To: Jason Baron
  Cc: gregkh, jim.cromie, bvanassche, linux-kernel, davem,
	aloisio.almeida, netdev
In-Reply-To: <20110707180909.GC2536@redhat.com>

On Thu, 2011-07-07 at 14:09 -0400, Jason Baron wrote:
> On Thu, Jul 07, 2011 at 09:29:21AM -0700, Joe Perches wrote:
> > I think there's little to be gained to move the test
> > outwards and not perform the netif_msg##type(priv)
> In this particualr case, there might not be a large gain, but when I've
> converted all of the dynamic debug infrastructure to jump labels I can
> consistently see througput gains of 1% on tbench testing.

And that's not this case is it.
I don't see any value here.

[]

> I think that dynamic_debug will have continuing
> > impacts on various subsystems unless there's some generic
> > __dynamic_dbg() and _prefix() mechanism introduced into
> > more generic <foo>_dbg style.
> > Anything logging message that uses <foo>_dbg or <foo>_vdbg
> > is a candidate for dynamic_debug uses, but there's no
> > current generic mechanism to avoid subsystem specific needs.
> > Any of these could need some dynamic_debug consideration:
> right. looking quickly over this list there seem to be a few different
> categories:
> -some just alias to dev_dbg(), so they are already picked up
> -some use level logging, this could be easily added to dyanmic debug -
>   we store level info in the descriptor and then check it against
>   a currently set level, which can be per-debug statement

Fine by me.

That might also make all other netif_<type>()
and <foo>_<level>(bitmap or level test, fmt, ...)
possible to combine in this mechanism as well.

There are a lot of those.

> -any ones that can't fit the current model could probably be easily
>  converted using a callback, That is we have some dynamic debug
>  function take an optional function, which if the debugging is enabled
>  is called.

I believe that would require some registration mechanism
for modules.

> In fact, that was one of my original goals was to
> try and convert all the disparate debugging calls, to a more generic
> infrastructure. I know some subsystem converted to use pr_debug(), to
> tie into dynamic debug, but it would take a bit of work to convert the
> rest...thoughts?

Go for it.
You're the ddebug maintainer.
I'm gladly review though.

cheers, Joe

^ permalink raw reply

* pull request: batman-adv 2011-07-08
From: Marek Lindner @ 2011-07-07 22:33 UTC (permalink / raw)
  To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r

Hi,

I have another small but important set of changes I'd like to get pulled
into net-next-2.6/3.1. Despite our best efforts, recent tests and reviews
of the protocol changes we have introduced a couple of weeks ago made it 
quite obvious that some bugs slipped through. The implementation of said 
protocol does not handle all corner cases in the way it should, thus 
provoking inconsistent states in the mesh. These 4 patches are meant to
address the found issues.

Thanks,
Marek

^ permalink raw reply

* [PATCH 1/4] batman-adv: initialise last_ttvn and tt_crc for the orig_node structure
From: Marek Lindner @ 2011-07-07 22:33 UTC (permalink / raw)
  To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r, Marek Lindner
In-Reply-To: <1310078023-28958-1-git-send-email-lindner_marek-LWAfsSFWpa4@public.gmane.org>

From: Antonio Quartulli <ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>

The last_ttvn and tt_crc fields of the orig_node structure were not
initialised causing an immediate TT_REQ/RES dialogue even if not needed.

Signed-off-by: Antonio Quartulli <ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>
Signed-off-by: Marek Lindner <lindner_marek-LWAfsSFWpa4@public.gmane.org>
---
 net/batman-adv/originator.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index 4cc94d4..f3c3f62 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -223,6 +223,8 @@ struct orig_node *get_orig_node(struct bat_priv *bat_priv, const uint8_t *addr)
 	orig_node->bat_priv = bat_priv;
 	memcpy(orig_node->orig, addr, ETH_ALEN);
 	orig_node->router = NULL;
+	orig_node->tt_crc = 0;
+	atomic_set(&orig_node->last_ttvn, 0);
 	orig_node->tt_buff = NULL;
 	orig_node->tt_buff_len = 0;
 	atomic_set(&orig_node->tt_size, 0);
-- 
1.7.5.3

^ permalink raw reply related

* [PATCH 2/4] batman-adv: keep local table consistency for further TT_RESPONSE
From: Marek Lindner @ 2011-07-07 22:33 UTC (permalink / raw)
  To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r, Marek Lindner
In-Reply-To: <1310078023-28958-1-git-send-email-lindner_marek-LWAfsSFWpa4@public.gmane.org>

From: Antonio Quartulli <ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>

To keep transtable consistency among all the nodes, an originator must
not send not yet announced clients within a full table TT_RESPONSE.
Instead, deleted client have to be kept in the table in order to be sent
within an immediate TT_RESPONSE. In this way all the nodes in the
network will always provide the same response for the same request.

All the modification are committed at the next ttvn increment event.

Signed-off-by: Antonio Quartulli <ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>
Signed-off-by: Marek Lindner <lindner_marek-LWAfsSFWpa4@public.gmane.org>
---
 net/batman-adv/packet.h            |    4 +-
 net/batman-adv/send.c              |    4 +-
 net/batman-adv/translation-table.c |  146 +++++++++++++++++++++++++++++-------
 net/batman-adv/translation-table.h |    1 +
 4 files changed, 125 insertions(+), 30 deletions(-)

diff --git a/net/batman-adv/packet.h b/net/batman-adv/packet.h
index 590e4a6..b76b4be 100644
--- a/net/batman-adv/packet.h
+++ b/net/batman-adv/packet.h
@@ -84,7 +84,9 @@ enum tt_query_flags {
 enum tt_client_flags {
 	TT_CLIENT_DEL     = 1 << 0,
 	TT_CLIENT_ROAM    = 1 << 1,
-	TT_CLIENT_NOPURGE = 1 << 8
+	TT_CLIENT_NOPURGE = 1 << 8,
+	TT_CLIENT_NEW     = 1 << 9,
+	TT_CLIENT_PENDING = 1 << 10
 };
 
 struct batman_packet {
diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c
index 4b8e11b..58d1447 100644
--- a/net/batman-adv/send.c
+++ b/net/batman-adv/send.c
@@ -309,10 +309,8 @@ void schedule_own_packet(struct hard_iface *hard_iface)
 	if (hard_iface == primary_if) {
 		/* if at least one change happened */
 		if (atomic_read(&bat_priv->tt_local_changes) > 0) {
+			tt_commit_changes(bat_priv);
 			prepare_packet_buffer(bat_priv, hard_iface);
-			/* Increment the TTVN only once per OGM interval */
-			atomic_inc(&bat_priv->ttvn);
-			bat_priv->tt_poss_change = false;
 		}
 
 		/* if the changes have been sent enough times */
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 06d361d..7cc67c0 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -215,11 +215,14 @@ void tt_local_add(struct net_device *soft_iface, const uint8_t *addr)
 
 	tt_local_event(bat_priv, addr, tt_local_entry->flags);
 
+	/* The local entry has to be marked as NEW to avoid to send it in
+	 * a full table response going out before the next ttvn increment
+	 * (consistency check) */
+	tt_local_entry->flags |= TT_CLIENT_NEW;
+
 	hash_add(bat_priv->tt_local_hash, compare_ltt, choose_orig,
 		 tt_local_entry, &tt_local_entry->hash_entry);
 
-	atomic_inc(&bat_priv->num_local_tt);
-
 	/* remove address from global hash if present */
 	tt_global_entry = tt_global_hash_find(bat_priv, addr);
 
@@ -358,19 +361,17 @@ out:
 	return ret;
 }
 
-static void tt_local_del(struct bat_priv *bat_priv,
-			 struct tt_local_entry *tt_local_entry,
-			 const char *message)
+static void tt_local_set_pending(struct bat_priv *bat_priv,
+				 struct tt_local_entry *tt_local_entry,
+				 uint16_t flags)
 {
-	bat_dbg(DBG_TT, bat_priv, "Deleting local tt entry (%pM): %s\n",
-		tt_local_entry->addr, message);
+	tt_local_event(bat_priv, tt_local_entry->addr,
+		       tt_local_entry->flags | flags);
 
-	atomic_dec(&bat_priv->num_local_tt);
-
-	hash_remove(bat_priv->tt_local_hash, compare_ltt, choose_orig,
-		    tt_local_entry->addr);
-
-	tt_local_entry_free_ref(tt_local_entry);
+	/* The local client has to be merked as "pending to be removed" but has
+	 * to be kept in the table in order to send it in an full tables
+	 * response issued before the net ttvn increment (consistency check) */
+	tt_local_entry->flags |= TT_CLIENT_PENDING;
 }
 
 void tt_local_remove(struct bat_priv *bat_priv, const uint8_t *addr,
@@ -379,14 +380,14 @@ void tt_local_remove(struct bat_priv *bat_priv, const uint8_t *addr,
 	struct tt_local_entry *tt_local_entry = NULL;
 
 	tt_local_entry = tt_local_hash_find(bat_priv, addr);
-
 	if (!tt_local_entry)
 		goto out;
 
-	tt_local_event(bat_priv, tt_local_entry->addr,
-		       tt_local_entry->flags | TT_CLIENT_DEL |
-		       (roaming ? TT_CLIENT_ROAM : NO_FLAGS));
-	tt_local_del(bat_priv, tt_local_entry, message);
+	tt_local_set_pending(bat_priv, tt_local_entry, TT_CLIENT_DEL |
+			     (roaming ? TT_CLIENT_ROAM : NO_FLAGS));
+
+	bat_dbg(DBG_TT, bat_priv, "Local tt entry (%pM) pending to be removed: "
+		"%s\n", tt_local_entry->addr, message);
 out:
 	if (tt_local_entry)
 		tt_local_entry_free_ref(tt_local_entry);
@@ -411,18 +412,19 @@ static void tt_local_purge(struct bat_priv *bat_priv)
 			if (tt_local_entry->flags & TT_CLIENT_NOPURGE)
 				continue;
 
+			/* entry already marked for deletion */
+			if (tt_local_entry->flags & TT_CLIENT_PENDING)
+				continue;
+
 			if (!is_out_of_time(tt_local_entry->last_seen,
 					    TT_LOCAL_TIMEOUT * 1000))
 				continue;
 
-			tt_local_event(bat_priv, tt_local_entry->addr,
-				       tt_local_entry->flags | TT_CLIENT_DEL);
-			atomic_dec(&bat_priv->num_local_tt);
-			bat_dbg(DBG_TT, bat_priv, "Deleting local "
-				"tt entry (%pM): timed out\n",
+			tt_local_set_pending(bat_priv, tt_local_entry,
+					     TT_CLIENT_DEL);
+			bat_dbg(DBG_TT, bat_priv, "Local tt entry (%pM) "
+				"pending to be removed: timed out\n",
 				tt_local_entry->addr);
-			hlist_del_rcu(node);
-			tt_local_entry_free_ref(tt_local_entry);
 		}
 		spin_unlock_bh(list_lock);
 	}
@@ -846,6 +848,10 @@ uint16_t tt_local_crc(struct bat_priv *bat_priv)
 		rcu_read_lock();
 		hlist_for_each_entry_rcu(tt_local_entry, node,
 					 head, hash_entry) {
+			/* not yet committed clients have not to be taken into
+			 * account while computing the CRC */
+			if (tt_local_entry->flags & TT_CLIENT_NEW)
+				continue;
 			total_one = 0;
 			for (j = 0; j < ETH_ALEN; j++)
 				total_one = crc16_byte(total_one,
@@ -935,6 +941,16 @@ unlock:
 	return tt_req_node;
 }
 
+/* data_ptr is useless here, but has to be kept to respect the prototype */
+static int tt_local_valid_entry(const void *entry_ptr, const void *data_ptr)
+{
+	const struct tt_local_entry *tt_local_entry = entry_ptr;
+
+	if (tt_local_entry->flags & TT_CLIENT_NEW)
+		return 0;
+	return 1;
+}
+
 static int tt_global_valid_entry(const void *entry_ptr, const void *data_ptr)
 {
 	const struct tt_global_entry *tt_global_entry = entry_ptr;
@@ -1275,7 +1291,8 @@ static bool send_my_tt_response(struct bat_priv *bat_priv,
 
 		skb = tt_response_fill_table(tt_len, ttvn,
 					     bat_priv->tt_local_hash,
-					     primary_if, NULL, NULL);
+					     primary_if, tt_local_valid_entry,
+					     NULL);
 		if (!skb)
 			goto out;
 
@@ -1400,6 +1417,10 @@ bool is_my_client(struct bat_priv *bat_priv, const uint8_t *addr)
 	tt_local_entry = tt_local_hash_find(bat_priv, addr);
 	if (!tt_local_entry)
 		goto out;
+	/* Check if the client has been logically deleted (but is kept for
+	 * consistency purpose) */
+	if (tt_local_entry->flags & TT_CLIENT_PENDING)
+		goto out;
 	ret = true;
 out:
 	if (tt_local_entry)
@@ -1620,3 +1641,76 @@ void tt_free(struct bat_priv *bat_priv)
 
 	kfree(bat_priv->tt_buff);
 }
+
+/* This function will reset the specified flags from all the entries in
+ * the given hash table and will increment num_local_tt for each involved
+ * entry */
+static void tt_local_reset_flags(struct bat_priv *bat_priv, uint16_t flags)
+{
+	int i;
+	struct hashtable_t *hash = bat_priv->tt_local_hash;
+	struct hlist_head *head;
+	struct hlist_node *node;
+	struct tt_local_entry *tt_local_entry;
+
+	if (!hash)
+		return;
+
+	for (i = 0; i < hash->size; i++) {
+		head = &hash->table[i];
+
+		rcu_read_lock();
+		hlist_for_each_entry_rcu(tt_local_entry, node,
+					 head, hash_entry) {
+			tt_local_entry->flags &= ~flags;
+			atomic_inc(&bat_priv->num_local_tt);
+		}
+		rcu_read_unlock();
+	}
+
+}
+
+/* Purge out all the tt local entries marked with TT_CLIENT_PENDING */
+static void tt_local_purge_pending_clients(struct bat_priv *bat_priv)
+{
+	struct hashtable_t *hash = bat_priv->tt_local_hash;
+	struct tt_local_entry *tt_local_entry;
+	struct hlist_node *node, *node_tmp;
+	struct hlist_head *head;
+	spinlock_t *list_lock; /* protects write access to the hash lists */
+	int i;
+
+	if (!hash)
+		return;
+
+	for (i = 0; i < hash->size; i++) {
+		head = &hash->table[i];
+		list_lock = &hash->list_locks[i];
+
+		spin_lock_bh(list_lock);
+		hlist_for_each_entry_safe(tt_local_entry, node, node_tmp,
+					  head, hash_entry) {
+			if (!(tt_local_entry->flags & TT_CLIENT_PENDING))
+				continue;
+
+			bat_dbg(DBG_TT, bat_priv, "Deleting local tt entry "
+				"(%pM): pending\n", tt_local_entry->addr);
+
+			atomic_dec(&bat_priv->num_local_tt);
+			hlist_del_rcu(node);
+			tt_local_entry_free_ref(tt_local_entry);
+		}
+		spin_unlock_bh(list_lock);
+	}
+
+}
+
+void tt_commit_changes(struct bat_priv *bat_priv)
+{
+	tt_local_reset_flags(bat_priv, TT_CLIENT_NEW);
+	tt_local_purge_pending_clients(bat_priv);
+
+	/* Increment the TTVN only once per OGM interval */
+	atomic_inc(&bat_priv->ttvn);
+	bat_priv->tt_poss_change = false;
+}
diff --git a/net/batman-adv/translation-table.h b/net/batman-adv/translation-table.h
index 460e583..d4122cb 100644
--- a/net/batman-adv/translation-table.h
+++ b/net/batman-adv/translation-table.h
@@ -61,5 +61,6 @@ void handle_tt_response(struct bat_priv *bat_priv,
 			struct tt_query_packet *tt_response);
 void send_roam_adv(struct bat_priv *bat_priv, uint8_t *client,
 		   struct orig_node *orig_node);
+void tt_commit_changes(struct bat_priv *bat_priv);
 
 #endif /* _NET_BATMAN_ADV_TRANSLATION_TABLE_H_ */
-- 
1.7.5.3

^ permalink raw reply related

* [PATCH 3/4] batman-adv: keep global table consistency in case of roaming
From: Marek Lindner @ 2011-07-07 22:33 UTC (permalink / raw)
  To: davem; +Cc: netdev, b.a.t.m.a.n, Antonio Quartulli, Marek Lindner
In-Reply-To: <1310078023-28958-1-git-send-email-lindner_marek@yahoo.de>

From: Antonio Quartulli <ordex@autistici.org>

To keep consistency of other originator tables, new clients detected as
roamed, are kept in the global table but are marked as TT_CLIENT_PENDING
They are purged only when the new ttvn is received by the corresponding
originator. Moreover they need to be considered as removed in case of global
transtable lookup.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
---
 net/batman-adv/translation-table.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 7cc67c0..fb6931d 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -230,8 +230,9 @@ void tt_local_add(struct net_device *soft_iface, const uint8_t *addr)
 	if (tt_global_entry) {
 		/* This node is probably going to update its tt table */
 		tt_global_entry->orig_node->tt_poss_change = true;
-		_tt_global_del(bat_priv, tt_global_entry,
-			       "local tt received");
+		/* The global entry has to be marked as PENDING and has to be
+		 * kept for consistency purpose */
+		tt_global_entry->flags |= TT_CLIENT_PENDING;
 		send_roam_adv(bat_priv, tt_global_entry->addr,
 			      tt_global_entry->orig_node);
 	}
@@ -787,6 +788,11 @@ struct orig_node *transtable_search(struct bat_priv *bat_priv,
 	if (!atomic_inc_not_zero(&tt_global_entry->orig_node->refcount))
 		goto free_tt;
 
+	/* A global client marked as PENDING has already moved from that
+	 * originator */
+	if (tt_global_entry->flags & TT_CLIENT_PENDING)
+		goto free_tt;
+
 	orig_node = tt_global_entry->orig_node;
 
 free_tt:
-- 
1.7.5.3


^ permalink raw reply related

* [PATCH 4/4] batman-adv: request the full table if tt_crc doesn't match
From: Marek Lindner @ 2011-07-07 22:35 UTC (permalink / raw)
  To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r, Marek Lindner
In-Reply-To: <1310078023-28958-1-git-send-email-lindner_marek-LWAfsSFWpa4@public.gmane.org>

From: Antonio Quartulli <ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>

In case of tt_crc mismatching for a certain orig_node after applying the
changes, the node must request the full table immediately.

Signed-off-by: Antonio Quartulli <ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>
Signed-off-by: Marek Lindner <lindner_marek-LWAfsSFWpa4@public.gmane.org>
---
 net/batman-adv/routing.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index 2cb98be..0f32c81 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -91,6 +91,18 @@ static void update_transtable(struct bat_priv *bat_priv,
 		 * to recompute it to spot any possible inconsistency
 		 * in the global table */
 		orig_node->tt_crc = tt_global_crc(bat_priv, orig_node);
+
+		/* The ttvn alone is not enough to guarantee consistency
+		 * because a single value could repesent different states
+		 * (due to the wrap around). Thus a node has to check whether
+		 * the resulting table (after applying the changes) is still
+		 * consistent or not. E.g. a node could disconnect while its
+		 * ttvn is X and reconnect on ttvn = X + TTVN_MAX: in this case
+		 * checking the CRC value is mandatory to detect the
+		 * inconsistency */
+		if (orig_node->tt_crc != tt_crc)
+			goto request_table;
+
 		/* Roaming phase is over: tables are in sync again. I can
 		 * unset the flag */
 		orig_node->tt_poss_change = false;
-- 
1.7.5.3

^ permalink raw reply related

* Re: pull request: batman-adv 2011-07-08
From: Marek Lindner @ 2011-07-07 22:39 UTC (permalink / raw)
  To: b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, davem-fT/PcQaiUtIeIZ0/mPfg9Q
In-Reply-To: <1310078023-28958-1-git-send-email-lindner_marek-LWAfsSFWpa4@public.gmane.org>

On Friday, July 08, 2011 00:33:39 Marek Lindner wrote:
> I have another small but important set of changes I'd like to get pulled
> into net-next-2.6/3.1. Despite our best efforts, recent tests and reviews
> of the protocol changes we have introduced a couple of weeks ago made it
> quite obvious that some bugs slipped through. The implementation of said
> protocol does not handle all corner cases in the way it should, thus
> provoking inconsistent states in the mesh. These 4 patches are meant to
> address the found issues.

Woops - pulled the trigger too fast. Here is the missing shortlog:

The following changes since commit 44c4349a2a117b22a5c4087f2ac9faf10c575e17:

  batman-adv: Replace version info instead of appending them (2011-07-05 14:48:56 +0200)

are available in the git repository at:
  git://git.open-mesh.org/linux-merge.git batman-adv/next

Antonio Quartulli (4):
      batman-adv: initialise last_ttvn and tt_crc for the orig_node structure
      batman-adv: keep local table consistency for further TT_RESPONSE
      batman-adv: keep global table consistency in case of roaming
      batman-adv: request the full table if tt_crc doesn't match

 net/batman-adv/originator.c        |    2 +
 net/batman-adv/packet.h            |    4 +-
 net/batman-adv/routing.c           |   12 +++
 net/batman-adv/send.c              |    4 +-
 net/batman-adv/translation-table.c |  156 +++++++++++++++++++++++++++++-------
 net/batman-adv/translation-table.h |    1 +
 6 files changed, 147 insertions(+), 32 deletions(-)

^ permalink raw reply

* RE: [PATCH] [v3][net][bna] Fix call trace when interrupts are disabled while sleeping function kzalloc is called
From: Rasesh Mody @ 2011-07-07 22:20 UTC (permalink / raw)
  To: Ivan Vecera, Shyam Iyer
  Cc: netdev@vger.kernel.org, Debashis Dutt, Jing Huang,
	davem@davemloft.net, Shyam Iyer
In-Reply-To: <1310051634.4392.29.camel@ceranb.intra.cera.cz>

Ivan,

I agree with you regarding use of flags varible used for two different purposes. It is creating some confusion. We can have request_irq function use irq_flags varible. This will ensure flags varible is exclusively used for enabling/disabling IRQs.

Thanks,
Rasesh

>-----Original Message-----
>From: Ivan Vecera [mailto:ivecera@redhat.com]
>Sent: Thursday, July 07, 2011 8:14 AM
>To: Shyam Iyer
>Cc: netdev@vger.kernel.org; Rasesh Mody; Debashis Dutt; Jing Huang;
>davem@davemloft.net; Shyam Iyer
>Subject: Re: [PATCH] [v3][net][bna] Fix call trace when interrupts are
>disabled while sleeping function kzalloc is called
>
>Small note, the root of the problem was that non-atomic allocation was
>requested with IRQs disabled. Your patch description does not contain
>why were the IRQs disabled.
>The function bnad_mbox_irq_alloc incorrectly uses 'flags' var for two
>different things, 1) to save current CPU flags and 2) for request_irq
>call.
>First the spin_lock_irqsave disables the IRQs and saves _all_ CPU flags
>(including one that enables/disables interrupts) to 'flags'. Then the
>'flags' is overwritten by 0 or 0x80 (IRQF_SHARED). Finally the
>spin_unlock_irqrestore should restore saved flags, but these flags are
>now either 0x00 or 0x80. The interrupt bit value in flags register on
>x86 arch is 0x100.
>This means that the interrupt bit is zero (IRQs disabled) after
>spin_unlock_irqrestore so the request_irq function is called with
>disabled interrupts.
>
>Rasesh, this is not a good idea to use one variable for two different
>purposes in parallel.
>
>Regards,
>Ivan
>
>On Tue, 2011-06-28 at 14:58 -0400, Shyam Iyer wrote:
>> request_threaded irq will call kzalloc that can sleep. Initializing
>the flags variable outside of spin_lock_irqsave/restore in
>bnad_mbox_irq_alloc will avoid call traces like below.
>>
>> Jun 27 08:15:24 home-t710 kernel: [11735.634550] Brocade 10G Ethernet
>driver
>> Jun 27 08:15:24 home-t710 kernel: [11735.634590] bnad_pci_probe :
>(0xffff880427f3d000, 0xffffffffa020f3e0) PCI Func : (2)
>> Jun 27 08:15:24 home-t710 kernel: [11735.637677] bna 0000:82:00.2: PCI
>INT A -> GSI 66 (level, low) -> IRQ 66
>> Jun 27 08:15:24 home-t710 kernel: [11735.638290] bar0 mapped to
>ffffc90014980000, len 262144
>> Jun 27 08:15:24 home-t710 kernel: [11735.638732] BUG: sleeping
>function called from invalid context at mm/slub.c:847
>> Jun 27 08:15:24 home-t710 kernel: [11735.638736] in_atomic(): 0,
>irqs_disabled(): 1, pid: 11243, name: insmod
>> Jun 27 08:15:24 home-t710 kernel: [11735.638740] Pid: 11243, comm:
>insmod Not tainted 3.0.0-rc4+ #6
>> Jun 27 08:15:24 home-t710 kernel: [11735.638743] Call Trace:
>> Jun 27 08:15:24 home-t710 kernel: [11735.638755]  [<ffffffff81046427>]
>__might_sleep+0xeb/0xf0
>> Jun 27 08:15:24 home-t710 kernel: [11735.638766]  [<ffffffffa01fe469>]
>? netif_wake_queue+0x3d/0x3d [bna]
>> Jun 27 08:15:24 home-t710 kernel: [11735.638773]  [<ffffffff8111201c>]
>kmem_cache_alloc_trace+0x43/0xd8
>> Jun 27 08:15:24 home-t710 kernel: [11735.638782]  [<ffffffffa01fe469>]
>? netif_wake_queue+0x3d/0x3d [bna]
>> Jun 27 08:15:24 home-t710 kernel: [11735.638787]  [<ffffffff810ab791>]
>request_threaded_irq+0xa1/0x113
>> Jun 27 08:15:24 home-t710 kernel: [11735.638798]  [<ffffffffa020f0c0>]
>bnad_pci_probe+0x612/0x8e5 [bna]
>> Jun 27 08:15:24 home-t710 kernel: [11735.638807]  [<ffffffffa01fe469>]
>? netif_wake_queue+0x3d/0x3d [bna]
>> Jun 27 08:15:24 home-t710 kernel: [11735.638816]  [<ffffffff81482ef4>]
>? _raw_spin_unlock_irqrestore+0x17/0x19
>> Jun 27 08:15:24 home-t710 kernel: [11735.638822]  [<ffffffff8124d17a>]
>local_pci_probe+0x44/0x75
>> Jun 27 08:15:24 home-t710 kernel: [11735.638826]  [<ffffffff8124dc06>]
>pci_device_probe+0xd0/0xff
>> Jun 27 08:15:24 home-t710 kernel: [11735.638832]  [<ffffffff812ef8ab>]
>driver_probe_device+0x131/0x213
>> Jun 27 08:15:24 home-t710 kernel: [11735.638836]  [<ffffffff812ef9e7>]
>__driver_attach+0x5a/0x7e
>> Jun 27 08:15:24 home-t710 kernel: [11735.638840]  [<ffffffff812ef98d>]
>? driver_probe_device+0x213/0x213
>> Jun 27 08:15:24 home-t710 kernel: [11735.638844]  [<ffffffff812ee933>]
>bus_for_each_dev+0x53/0x89
>> Jun 27 08:15:24 home-t710 kernel: [11735.638848]  [<ffffffff812ef48a>]
>driver_attach+0x1e/0x20
>> Jun 27 08:15:24 home-t710 kernel: [11735.638852]  [<ffffffff812ef0ae>]
>bus_add_driver+0xd1/0x224
>> Jun 27 08:15:24 home-t710 kernel: [11735.638858]  [<ffffffffa01b8000>]
>? 0xffffffffa01b7fff
>> Jun 27 08:15:24 home-t710 kernel: [11735.638862]  [<ffffffff812efe57>]
>driver_register+0x98/0x105
>> Jun 27 08:15:24 home-t710 kernel: [11735.638866]  [<ffffffffa01b8000>]
>? 0xffffffffa01b7fff
>> Jun 27 08:15:24 home-t710 kernel: [11735.638871]  [<ffffffff8124e4c9>]
>__pci_register_driver+0x56/0xc1
>> Jun 27 08:15:24 home-t710 kernel: [11735.638875]  [<ffffffffa01b8000>]
>? 0xffffffffa01b7fff
>> Jun 27 08:15:24 home-t710 kernel: [11735.638884]  [<ffffffffa01b8040>]
>bnad_module_init+0x40/0x60 [bna]
>> Jun 27 08:15:24 home-t710 kernel: [11735.638892]  [<ffffffff81002099>]
>do_one_initcall+0x7f/0x136
>> Jun 27 08:15:24 home-t710 kernel: [11735.638899]  [<ffffffff8108608b>]
>sys_init_module+0x88/0x1d0
>> Jun 27 08:15:24 home-t710 kernel: [11735.638906]  [<ffffffff81489682>]
>system_call_fastpath+0x16/0x1b
>> Jun 27 08:15:24 home-t710 kernel: [11735.639642] bnad_pci_probe :
>(0xffff880427f3e000, 0xffffffffa020f3e0) PCI Func : (3)
>> Jun 27 08:15:24 home-t710 kernel: [11735.639665] bna 0000:82:00.3: PCI
>INT A -> GSI 66 (level, low) -> IRQ 66
>> Jun 27 08:15:24 home-t710 kernel: [11735.639735] bar0 mapped to
>ffffc90014400000, len 262144
>>
>> Signed-off-by: Shyam Iyer <shyam_iyer@dell.com>
>> ---
>>  drivers/net/bna/bnad.c |    7 +++----
>>  1 files changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/bna/bnad.c b/drivers/net/bna/bnad.c
>> index 7d25a97..44e219c 100644
>> --- a/drivers/net/bna/bnad.c
>> +++ b/drivers/net/bna/bnad.c
>> @@ -1111,7 +1111,7 @@ bnad_mbox_irq_alloc(struct bnad *bnad,
>>  		    struct bna_intr_info *intr_info)
>>  {
>>  	int 		err = 0;
>> -	unsigned long 	flags;
>> +	unsigned long 	irq_flags = 0, flags;
>>  	u32	irq;
>>  	irq_handler_t 	irq_handler;
>>
>> @@ -1125,18 +1125,17 @@ bnad_mbox_irq_alloc(struct bnad *bnad,
>>  	if (bnad->cfg_flags & BNAD_CF_MSIX) {
>>  		irq_handler = (irq_handler_t)bnad_msix_mbox_handler;
>>  		irq = bnad->msix_table[bnad->msix_num - 1].vector;
>> -		flags = 0;
>>  		intr_info->intr_type = BNA_INTR_T_MSIX;
>>  		intr_info->idl[0].vector = bnad->msix_num - 1;
>>  	} else {
>>  		irq_handler = (irq_handler_t)bnad_isr;
>>  		irq = bnad->pcidev->irq;
>> -		flags = IRQF_SHARED;
>> +		irq_flags = IRQF_SHARED;
>>  		intr_info->intr_type = BNA_INTR_T_INTX;
>>  		/* intr_info->idl.vector = 0 ? */
>>  	}
>>  	spin_unlock_irqrestore(&bnad->bna_lock, flags);
>> -
>> +	flags = irq_flags;
>>  	sprintf(bnad->mbox_irq_name, "%s", BNAD_NAME);
>>
>>  	/*
>
>


^ permalink raw reply

* [PATCH net-next 1/5] sky2: force receive checksum when using RSS on some hardware (v2)
From: Stephen Hemminger @ 2011-07-07 23:40 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Michał Mirosław, David S. Miller, netdev
In-Reply-To: <20110707101322.784409eb@nehalam.ftrdhcpuser.net>

Found when reviewing the vendor driver. Apparently some chip versions
require receive checksumming to be enabled in order for RSS to work.

Also, if fix_features has to change some settings; put in message
in log in similar manner to netdev_fix_features.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

---
v2 - enforce the requirement in fix_features rather than set features

--- a/drivers/net/sky2.c	2011-07-07 13:56:03.575420273 -0700
+++ b/drivers/net/sky2.c	2011-07-07 14:03:17.775403938 -0700
@@ -2996,7 +2996,8 @@ static int __devinit sky2_init(struct sk
 		hw->flags = SKY2_HW_GIGABIT
 			| SKY2_HW_NEWER_PHY
 			| SKY2_HW_NEW_LE
-			| SKY2_HW_ADV_POWER_CTL;
+			| SKY2_HW_ADV_POWER_CTL
+			| SKY2_HW_RSS_CHKSUM;
 
 		/* New transmit checksum */
 		if (hw->chip_rev != CHIP_REV_YU_EX_B0)
@@ -3024,7 +3025,7 @@ static int __devinit sky2_init(struct sk
 
 		/* The workaround for status conflicts VLAN tag detection. */
 		if (hw->chip_rev == CHIP_REV_YU_FE2_A0)
-			hw->flags |= SKY2_HW_VLAN_BROKEN;
+			hw->flags |= SKY2_HW_VLAN_BROKEN | SKY2_HW_RSS_CHKSUM;
 		break;
 
 	case CHIP_ID_YUKON_SUPR:
@@ -3033,6 +3034,9 @@ static int __devinit sky2_init(struct sk
 			| SKY2_HW_NEW_LE
 			| SKY2_HW_AUTO_TX_SUM
 			| SKY2_HW_ADV_POWER_CTL;
+
+		if (hw->chip_rev == CHIP_REV_YU_SU_A0)
+			hw->flags |= SKY2_HW_RSS_CHKSUM;
 		break;
 
 	case CHIP_ID_YUKON_UL_2:
@@ -4176,8 +4180,18 @@ static u32 sky2_fix_features(struct net_
 	/* In order to do Jumbo packets on these chips, need to turn off the
 	 * transmit store/forward. Therefore checksum offload won't work.
 	 */
-	if (dev->mtu > ETH_DATA_LEN && hw->chip_id == CHIP_ID_YUKON_EC_U)
+	if (dev->mtu > ETH_DATA_LEN && hw->chip_id == CHIP_ID_YUKON_EC_U) {
+		netdev_warn(dev, "checksum offload not possible with jumbo frames\n");
 		features &= ~(NETIF_F_TSO|NETIF_F_SG|NETIF_F_ALL_CSUM);
+	}
+
+	/* Some hardware requires receive checksum for RSS to work. */
+	if ( (features & NETIF_F_RXHASH) &&
+	     !(features & NETIF_F_RXCSUM) &&
+	     (sky2->hw->flags & SKY2_HW_RSS_CHKSUM)) {
+		netdev_warn(dev, "receive hashing forces receive checksum\n");
+		features |= NETIF_F_RXCSUM;
+	}
 
 	return features;
 }
--- a/drivers/net/sky2.h	2011-07-07 13:56:03.563420272 -0700
+++ b/drivers/net/sky2.h	2011-07-07 13:56:07.719420117 -0700
@@ -2281,6 +2281,7 @@ struct sky2_hw {
 #define SKY2_HW_ADV_POWER_CTL	0x00000080	/* additional PHY power regs */
 #define SKY2_HW_RSS_BROKEN	0x00000100
 #define SKY2_HW_VLAN_BROKEN     0x00000200
+#define SKY2_HW_RSS_CHKSUM	0x00000400	/* RSS requires chksum */
 
 	u8	     	     chip_id;
 	u8		     chip_rev;


^ permalink raw reply

* Re: [PATCH] net/fec: gasket needs to be enabled for some i.mx
From: Shawn Guo @ 2011-07-08  0:06 UTC (permalink / raw)
  To: Grant Likely
  Cc: David Miller, netdev, s.hauer, troy.kisky, u.kleine-koenig,
	shawn.guo, linux-arm-kernel, LW
In-Reply-To: <20110707184409.GH2824@ponder.secretlab.ca>

On Thu, Jul 07, 2011 at 12:44:09PM -0600, Grant Likely wrote:
> On Thu, Jul 07, 2011 at 09:41:58PM +0800, Shawn Guo wrote:
> > On Thu, Jul 07, 2011 at 04:12:57AM -0700, David Miller wrote:
> > > From: Shawn Guo <shawn.guo@linaro.org>
> > > Date: Fri,  1 Jul 2011 18:11:22 +0800
> > > 
> > > > On the recent i.mx (mx25/50/53), there is a gasket inside fec
> > > > controller which needs to be enabled no matter phy works in MII
> > > > or RMII mode.
> > > > 
> > > > The current code enables the gasket only when phy interface is RMII.
> > > > It's broken when the driver works with a MII phy.  The patch uses
> > > > platform_device_id to distinguish the SoCs that have the gasket and
> > > > enables it on these SoCs for both MII and RMII mode.
> > > > 
> > > > Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> > > > Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> > > 
> > > Acked-by: David S. Miller <davem@davemloft.net>
> > > --
> > 
> > Thanks, David.  I will try to get it through Sascha's tree after
> > the rebase again dt series.
> > 
> > Hi Sascha,
> > 
> > How should we proceed?  It seems Grant will take the fec-dt series
> > on his tree.  Would you then merge that tree into yours, so that I
> > can rebase this patch on your tree and get it go through there?
> 
> I should probably just take the lot.
> 
Thanks, Grant.  That makes people's life easier.  Please let me know
once you apply the dt series, so that I can start rebase the patch on
your tree.

-- 
Regards,
Shawn


^ permalink raw reply


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