* Re: [PATCHv3 net-next-2.6] ethtool: Added support for FW dump
From: Ben Hutchings @ 2011-05-12 17:04 UTC (permalink / raw)
To: Anirban Chakraborty; +Cc: netdev, David Miller
In-Reply-To: <1305154448-9687-2-git-send-email-anirban.chakraborty@qlogic.com>
On Wed, 2011-05-11 at 15:54 -0700, Anirban Chakraborty wrote:
> Added code to take FW dump via ethtool. Dump level can be controlled via setting the
> dump flag. A get function is provided to query the current setting of the dump flag.
> Dump data is obtained from the driver via a separate get function.
>
> Changes from v2:
> Provided separate commands for get flag and data.
> Check for minimum of the two buffer length obtained via ethtool and driver and
> use that for dump buffer
> Pass up the driver return error codes up to the caller.
> Added kernel doc comments.
>
> Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
> ---
> include/linux/ethtool.h | 28 +++++++++++++++
> net/core/ethtool.c | 88 +++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 116 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
> index bd0b50b..5ac7e18 100644
> --- a/include/linux/ethtool.h
> +++ b/include/linux/ethtool.h
> @@ -601,6 +601,24 @@ struct ethtool_flash {
> char data[ETHTOOL_FLASH_MAX_FILENAME];
> };
>
> +/**
> + * struct ethtool_dump - used for retrieving, setting device dump
> + * @cmd: Command number - %ETHTOOL_GET_DUMP_FLAG, %ETHTOOL_GET_DUMP_DATA, or
> + * %ETHTOOL_SET_DUMP
> + * @version: FW version of the dump, filled in by driver
> + * @flag: driver dependent flag for dump setting, filled in by driver during
> + * get and filled in by ethtool for set operation
> + * @len: length of dump data, returned by driver for get operation
This is also used as the length of the user buffer on entry to
ETHTOOL_GET_DUMP_DATA.
> + * @data: data collected for get dump data operation
> + */
> +struct ethtool_dump {
> + __u32 cmd;
> + __u32 version;
> + __u32 flag;
> + __u32 len;
> + u8 data[0];
> +};
> +
> /* for returning and changing feature sets */
>
> /**
> @@ -853,6 +871,9 @@ bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported);
> * @get_channels: Get number of channels.
> * @set_channels: Set number of channels. Returns a negative error code or
> * zero.
> + * @get_dump_flag: Get dump flag indicating current dump settings of the device.
This operation must also provide the dump length.
> + * @get_dump_data: Get dump data.
> + * @set_dump: Set dump specific flags to the device.
> *
> * All operations are optional (i.e. the function pointer may be set
> * to %NULL) and callers must take this into account. Callers must
> @@ -927,6 +948,10 @@ struct ethtool_ops {
> const struct ethtool_rxfh_indir *);
> void (*get_channels)(struct net_device *, struct ethtool_channels *);
> int (*set_channels)(struct net_device *, struct ethtool_channels *);
> + int (*get_dump_flag)(struct net_device *, struct ethtool_dump *);
> + int (*get_dump_data)(struct net_device *,
> + struct ethtool_dump *, void *);
> + int (*set_dump)(struct net_device *, struct ethtool_dump *);
>
> };
> #endif /* __KERNEL__ */
[...]
> --- a/net/core/ethtool.c
> +++ b/net/core/ethtool.c
[...]
> +static int ethtool_get_dump_data(struct net_device *dev,
> + void __user *useraddr)
> +{
> + int ret;
> + __u32 len;
> + struct ethtool_dump dump, tmp;
> + const struct ethtool_ops *ops = dev->ethtool_ops;
> + void *data = NULL;
> +
> + if (!dev->ethtool_ops->get_dump_data ||
> + !dev->ethtool_ops->get_dump_flag)
> + return -EOPNOTSUPP;
> +
> + if (copy_from_user(&dump, useraddr, sizeof(dump)))
> + return -EFAULT;
> +
> + memset(&tmp, 0, sizeof(tmp));
> + tmp.cmd = dump.cmd;
tmp.cmd should be ETHTOOL_GET_DUMP_FLAG.
> + ret = ops->get_dump_flag(dev, &tmp);
> + if (ret)
> + return ret;
> +
> + len = (tmp.len > dump.len) ? dump.len : tmp.len;
> +
> + data = vzalloc(len);
> + if (!data)
> + return -ENOMEM;
[...]
The kernel buffer size must be tmp.len, otherwise the driver may overrun
the buffer.
'len' is the minimum of the two buffer sizes and should only be used as
the size copied to user space (which you have done).
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH net-next 1/2 RESEND v3] net: use NETIF_F_ALL_TSO for vlan features
From: Dimitris Michailidis @ 2011-05-12 17:05 UTC (permalink / raw)
To: Shan Wei; +Cc: David Miller, netdev, eilong, leedom
In-Reply-To: <4DCBAE3B.3070201@cn.fujitsu.com>
On 05/12/2011 02:54 AM, Shan Wei wrote:
> Dimitris Michailidis wrote, at 2011年05月12日 00:35:
>> On 05/10/2011 11:24 PM, Shan Wei wrote:
>>> As Dimitris Michailidis suggested, use NETIF_F_ALL_TSO for vlan_features,
>>> which is a mask, but not hw_features.
>>>
>>> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
>> While these changes aren't wrong I don't see a good reason to make them. I am also curious why you're changing only these three drivers.
>
> A personal reason to quickly know what device supports ALL TSO,
> not to search one by one. :;)
But vlan_features doesn't indicate by itself what the device supports, and it
is because of this that you can use NETIF_F_ALL_TSO in vlan_features without
much future breakage risk. There's still the potential that in the future some
additional TSO variant will be added that some of the drivers you're changing
support, but not over VLANs, and then they'll need to undo you change.
If you want to know which drivers support all TSOs you really need to look at
their features and hw_features. One could set NETIF_F_ALL_TSO in vlan_features
of a driver that doesn't support any form of TSO. The way you're checking
you'd be misled into thinking that driver supports all TSO.
^ permalink raw reply
* AAARGH bisection is hard (Re: [2.6.39 regression] X locks up hard right after logging in)
From: Andrew Lutomirski @ 2011-05-12 17:15 UTC (permalink / raw)
To: linux-kernel; +Cc: netdev, git, Linus Torvalds
On Thu, May 12, 2011 at 9:31 AM, Andrew Lutomirski <luto@mit.edu> wrote:
> I just installed 9f381a6 (-linus from yesterday) on my Sandy Bridge
> desktop, and it locks up hard within a few seconds of logging in.
> netconsole says:
>
> [ 506.629723] block group 24725422080 has an wrong amount of free space
> [ 506.629723] block group 24725422080 has an wrong amount of free space
> [ 506.808501] fuse init (API version 7.16)
> [ 506.819996] SELinux: initialized (dev fuse, type fuse), uses genfs_contexts
> [ 506.829847] SELinux: initialized (dev fusectl, type fusectl), uses
> genfs_contexts
> [ 506.808501] fuse init (API version 7.16)
> [ 506.819996] SELinux: initialized (dev fuse, type fuse), uses genfs_contexts
> [ 506.829847] SELinux: initialized (dev fusectl, type fusectl), uses
> genfs_contexts
>
> If it's any help, the system is locked so hard that the reset button
> doesn't work. It's an Intel DQ67SW board, which apparently doesn't
> have the most reliable reset button in the world :)
>
> 2.6.38.{4,5,6} are all rock-solid on this box.
>
> I've started bisecting, but I don't expect to finish today. I need to
> do some work other than kernel hacking...
OK, this sucks. In the course of bisecting this, I've hit two other
apparently unrelated bugs that prevent my from testing large numbers
of kernels. Do I have two questions:
1. Anyone have any ideas from looking at the log?
It looks like most of what's left is network code, so cc netdev.
2. The !&$#@ bisection is skipping all over the place. I've seen
2.6.37 versions and all manner of -rc's out of order. Linus, and
other people who like pontificating about git bisection: is there any
way to get the bisection to follow Linus' tree? I think that if
bisect could be persuaded to consider only changes that are reached by
following only the *first* merge parent all the way from the bad
revision to the good revision, then the bisection would build versions
that were at least good enough for Linus to pull and might have fewer
bisection-killing bugs.
(This isn't a new idea [1], and git rev-list --bisect --first-parent
isn't so bad except that it doesn't bisect.)
Here's the log.
$ git bisect log
# bad: [9f381a61f58bb6487c93ce2233bb9992f8ea9211] Merge
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
# good: [521cb40b0c44418a4fd36dc633f575813d59a43d] Linux 2.6.38
git bisect start 'HEAD' 'v2.6.38'
# skip: [6899608533410557e6698cb9d4ff6df553916e98] Merge branch
'for-linus' of git://codeaurora.org/quic/kernel/davidb/linux-msm
# ******* This revision didn't build due to PSTORE.
# ******* Fixed config for the rest but no point in retrying...
git bisect skip 6899608533410557e6698cb9d4ff6df553916e98
# bad: [d3e458d78167102cc961237cfceef6fffc80c0b3] Merge branch
'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
git bisect bad d3e458d78167102cc961237cfceef6fffc80c0b3
# good: [6445ced8670f37cfc2c5e24a9de9b413dbfc788d] Merge branch
'staging-next' of
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
git bisect good 6445ced8670f37cfc2c5e24a9de9b413dbfc788d
# bad: [40c7f2112ce18fa5eb6dc209c50dd0f046790191] Merge branch
'drm-core-next' of
git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
git bisect bad 40c7f2112ce18fa5eb6dc209c50dd0f046790191
# bad: [23b41168fc942a4a041325a04ecc1bd17d031a3e] netdevice: make
initial group visible to userspace
git bisect bad 23b41168fc942a4a041325a04ecc1bd17d031a3e
# bad: [c0c84ef5c130f8871adbdaac2ba824b9195cb6d9] Merge branch
'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
git bisect bad c0c84ef5c130f8871adbdaac2ba824b9195cb6d9
# skip: [3ad97fbcc233a295f2ccc2c6bdeb32323e360a5e] mac80211: remove
unneeded check
# ******* This revision hangs at edd=off
git bisect skip 3ad97fbcc233a295f2ccc2c6bdeb32323e360a5e
# skip: [5bec3e5ade813ee4bdbab03af1bb6f85859272ea] ath9k: fix tx queue
index confusion in debugfs code
# ******* This revision hangs at edd=off
git bisect skip 5bec3e5ade813ee4bdbab03af1bb6f85859272ea
# skip: [c210de8f88215db31cf3529c9763fc3124d6e09d] ath5k: Fix fast
channel switching
# ******* This revision hangs at edd=off
git bisect skip c210de8f88215db31cf3529c9763fc3124d6e09d
# ******* For added fun, 479600777bb588724d044815415f7d708d06644b gets
stuck in systemd initialization.
--Andy
^ permalink raw reply
* Re: [PATCHv3 net-next-2.6 2/3] qlcnic: Take FW dump via ethtool
From: Ben Hutchings @ 2011-05-12 17:27 UTC (permalink / raw)
To: Anirban Chakraborty; +Cc: netdev, David Miller
In-Reply-To: <1305154448-9687-4-git-send-email-anirban.chakraborty@qlogic.com>
On Wed, 2011-05-11 at 15:54 -0700, Anirban Chakraborty wrote:
> Driver checks if the previous dump has been cleared before taking the dump.
> It doesn't take the dump if it is not cleared.
>
> Changes from v2:
> Added lock to protect dump data structures from being mangled while
> dumping or setting them via ethtool.
Unfortunately it still seems to be possible for the dump length to
change between the ethtool core calling qlcnic_get_dump_flag() and
qlcnic_get_dump_data().
So I think qlcnic_get_dump_data() will need to double-check the length
after taking the internal lock:
[...]
> +static int
> +qlcnic_get_dump_data(struct net_device *netdev, struct ethtool_dump *dump,
> + void *buffer)
> +{
> + int i, copy_sz;
> + u32 *hdr_ptr, *data;
> + struct qlcnic_adapter *adapter = netdev_priv(netdev);
> + struct qlcnic_fw_dump *fw_dump = &adapter->ahw->fw_dump;
> +
> + if (qlcnic_api_lock(adapter))
> + return -EIO;
[...]
if (dump->len < fw_dump->tmpl_hdr->size + fw_dump->size) {
qlcnic_api_unlock(adapter);
return -EINVAL;
}
I'm not sure about the error code... and I'm really not happy about the
need to check lengths in both the ethtool core and the driver.
Can't you change the function that actually makes a dump to acquire the
RTNL lock? (You'll need to do that *before* acquiring the driver's own
lock.)
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: AAARGH bisection is hard (Re: [2.6.39 regression] X locks up hard right after logging in)
From: Linus Torvalds @ 2011-05-12 17:37 UTC (permalink / raw)
To: Andrew Lutomirski; +Cc: linux-kernel, netdev, git
In-Reply-To: <BANLkTi=kb_m-CfrpnD8qQTVYLGaDdgy_tg@mail.gmail.com>
On Thu, May 12, 2011 at 10:15 AM, Andrew Lutomirski <luto@mit.edu> wrote:
>
> OK, this sucks. In the course of bisecting this, I've hit two other
> apparently unrelated bugs that prevent my from testing large numbers
> of kernels. Do I have two questions:
>
> 1. Anyone have any ideas from looking at the log?
Nope, that doesn't look very helpful.
> 2. The !&$#@ bisection is skipping all over the place. I've seen
> 2.6.37 versions and all manner of -rc's out of order.
That's the _point_ of bisection. It jumps around. You can start off
trying to pick points on my development tree, but I only have a
hundred merges or so. You're going to start delving into the actual
development versions very quickly. And if you don't do it early,
bisection is going to be much much slower, because it's not going to
pick half-way points.
So bisection works so well exactly because it picks points that are
far away from each other, and you should just totally ignore the
version number. It's meaningless. Looking at it just confuses you.
Don't do it.
Now, "pick stable points" would obviously be nice, but that is going
to have to be manual. You can certainly make some helper scripts, and
that's where that "--first-parent" thing comes in. So if you want to,
just use "git bisect reset" to the commit you want to test.
If you think it's networking, for example, and you've bisected into
there but aren't sure, do "gitk --bisect", find the point where I
merge, and pick that (and my parent), and "git bisect reset" those
points. That way you can verify that it's the networking merge (or
verify that it isn't).
Linus
^ permalink raw reply
* Re: future developments of usbnet
From: David Miller @ 2011-05-12 17:46 UTC (permalink / raw)
To: oliver-GvhC2dPhHPQdnm+yROfE0A
Cc: shemminger-ZtmgI6mnKB3QT0dZR+AlfA,
stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz,
tom.leiming-Re5JQEeQqe8AvxtiuMwx3w, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-usb-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <201105120959.28473.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
From: Oliver Neukum <oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
Date: Thu, 12 May 2011 09:59:28 +0200
> Our problem here is that USB doesn't work sanely without
> interrupts. We can stop IO regarding rx, but we cannot stop
> interrupts if we want to do rx.
Understood.
However, I was wondering if you could do this in software. When URBs
trigger, just queue that pending work up in a software queue when NAPI
is scheduled, then when you exit NAPI polling you check that queue to
see if there are interrupt events to process.
Similarly to how we handle software interrupts.
Anyways, just an idea.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" 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 RESEND net-next] ethtool: bring back missing comma in netdev features strings
From: Ben Hutchings @ 2011-05-12 17:58 UTC (permalink / raw)
To: franco; +Cc: netdev, maheshb, mirqus
In-Reply-To: <20110512164204.EC8391220061@host64.kissl.de>
On Thu, 2011-05-12 at 18:42 +0200, franco@lastsummer.de wrote:
> The issue was introduced in commit eed2a12f1ed9aabf.
>
> Signed-off-by: Franco Fichtner <franco@lastsummer.de>
Acked-by: Ben Hutchings <bhutchings@solarflare.com>
> ---
> net/core/ethtool.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/core/ethtool.c b/net/core/ethtool.c
> index b6f4058..b8c2b10 100644
> --- a/net/core/ethtool.c
> +++ b/net/core/ethtool.c
> @@ -361,7 +361,7 @@ static const char
> netdev_features_strings[ETHTOOL_DEV_FEATURE_WORDS * 32][ETH_GS
> /* NETIF_F_NTUPLE */ "rx-ntuple-filter",
> /* NETIF_F_RXHASH */ "rx-hashing",
> /* NETIF_F_RXCSUM */ "rx-checksum",
> - /* NETIF_F_NOCACHE_COPY */ "tx-nocache-copy"
> + /* NETIF_F_NOCACHE_COPY */ "tx-nocache-copy",
> /* NETIF_F_LOOPBACK */ "loopback",
> };
>
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH RESEND net-next] ethtool: bring back missing comma in netdev features strings
From: Mahesh Bandewar @ 2011-05-12 17:59 UTC (permalink / raw)
To: Michał Mirosław; +Cc: franco, netdev
In-Reply-To: <BANLkTikW=vURi7sAQ9ZJdgy=JDv+JacTQQ@mail.gmail.com>
On Thu, May 12, 2011 at 9:45 AM, Michał Mirosław <mirqus@gmail.com> wrote:
> 2011/5/12 <franco@lastsummer.de>:
>> The issue was introduced in commit eed2a12f1ed9aabf.
>>
>> Signed-off-by: Franco Fichtner <franco@lastsummer.de>
>> ---
>> net/core/ethtool.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/net/core/ethtool.c b/net/core/ethtool.c
>> index b6f4058..b8c2b10 100644
>> --- a/net/core/ethtool.c
>> +++ b/net/core/ethtool.c
>> @@ -361,7 +361,7 @@ static const char
>> netdev_features_strings[ETHTOOL_DEV_FEATURE_WORDS * 32][ETH_GS
>> /* NETIF_F_NTUPLE */ "rx-ntuple-filter",
>> /* NETIF_F_RXHASH */ "rx-hashing",
>> /* NETIF_F_RXCSUM */ "rx-checksum",
>> - /* NETIF_F_NOCACHE_COPY */ "tx-nocache-copy"
>> + /* NETIF_F_NOCACHE_COPY */ "tx-nocache-copy",
>> /* NETIF_F_LOOPBACK */ "loopback",
>> };
>
> Acked-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
>
Acked-by: Mahesh Bandewar <maheshb@google.com>
^ permalink raw reply
* Re: [PATCHv3 net-next-2.6] ethtool: Added support for FW dump
From: Anirban Chakraborty @ 2011-05-12 18:53 UTC (permalink / raw)
To: Ben Hutchings; +Cc: netdev, David Miller
In-Reply-To: <1305219899.5214.26.camel@bwh-desktop>
On May 12, 2011, at 10:04 AM, Ben Hutchings wrote:
> On Wed, 2011-05-11 at 15:54 -0700, Anirban Chakraborty wrote:
>> <snip>
>> +/**
>> + * struct ethtool_dump - used for retrieving, setting device dump
>> + * @cmd: Command number - %ETHTOOL_GET_DUMP_FLAG, %ETHTOOL_GET_DUMP_DATA, or
>> + * %ETHTOOL_SET_DUMP
>> + * @version: FW version of the dump, filled in by driver
>> + * @flag: driver dependent flag for dump setting, filled in by driver during
>> + * get and filled in by ethtool for set operation
>> + * @len: length of dump data, returned by driver for get operation
>
> This is also used as the length of the user buffer on entry to
> ETHTOOL_GET_DUMP_DATA.
Will add that.
>
>> + * @data: data collected for get dump data operation
>> + */
>> +struct ethtool_dump {
>> + __u32 cmd;
>> + __u32 version;
>> + __u32 flag;
>> + __u32 len;
>> + u8 data[0];
>> +};
>> +
>> /* for returning and changing feature sets */
>>
>> /**
>> @@ -853,6 +871,9 @@ bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported);
>> * @get_channels: Get number of channels.
>> * @set_channels: Set number of channels. Returns a negative error code or
>> * zero.
>> + * @get_dump_flag: Get dump flag indicating current dump settings of the device.
>
> This operation must also provide the dump length.
Thats correct. WIll add that bit of info.
>
>> <snip>
>> + memset(&tmp, 0, sizeof(tmp));
>> + tmp.cmd = dump.cmd;
>
> tmp.cmd should be ETHTOOL_GET_DUMP_FLAG.
Agreed.
>
>> + ret = ops->get_dump_flag(dev, &tmp);
>> + if (ret)
>> + return ret;
>> +
>> + len = (tmp.len > dump.len) ? dump.len : tmp.len;
>> +
>> + data = vzalloc(len);
>> + if (!data)
>> + return -ENOMEM;
> [...]
>
> The kernel buffer size must be tmp.len, otherwise the driver may overrun
> the buffer.
Agreed.
Thanks,
Anirban
^ permalink raw reply
* Re: [PATCHv3 net-next-2.6 2/3] qlcnic: Take FW dump via ethtool
From: Anirban Chakraborty @ 2011-05-12 18:53 UTC (permalink / raw)
To: Ben Hutchings; +Cc: netdev, David Miller
In-Reply-To: <1305221242.5214.36.camel@bwh-desktop>
On May 12, 2011, at 10:27 AM, Ben Hutchings wrote:
> On Wed, 2011-05-11 at 15:54 -0700, Anirban Chakraborty wrote:
>> Driver checks if the previous dump has been cleared before taking the dump.
>> It doesn't take the dump if it is not cleared.
>>
>> Changes from v2:
>> Added lock to protect dump data structures from being mangled while
>> dumping or setting them via ethtool.
>
> Unfortunately it still seems to be possible for the dump length to
> change between the ethtool core calling qlcnic_get_dump_flag() and
> qlcnic_get_dump_data().
dump length is serialized via the driver lock. dump length is a static entity for a given capture mask
and it can only be changed when there is a different capture mask set in the driver (via calling
set_dump() from ethtool core).
Actual dump size is determined during the initial steps of FW dump which takes the driver lock
to start with. So, I am not sure how the dump length could be changed between the calls to
get_dump_flag and get_dump_data from within the ethtool core without a call to set_dump()
in between.
>
> So I think qlcnic_get_dump_data() will need to double-check the length
> after taking the internal lock:
>
> [...]
>> +static int
>> +qlcnic_get_dump_data(struct net_device *netdev, struct ethtool_dump *dump,
>> + void *buffer)
>> +{
>> + int i, copy_sz;
>> + u32 *hdr_ptr, *data;
>> + struct qlcnic_adapter *adapter = netdev_priv(netdev);
>> + struct qlcnic_fw_dump *fw_dump = &adapter->ahw->fw_dump;
>> +
>> + if (qlcnic_api_lock(adapter))
>> + return -EIO;
> [...]
>
> if (dump->len < fw_dump->tmpl_hdr->size + fw_dump->size) {
> qlcnic_api_unlock(adapter);
> return -EINVAL;
> }
>
> I'm not sure about the error code... and I'm really not happy about the
> need to check lengths in both the ethtool core and the driver.
I can put the check in here but don't think it is required really.
>
> Can't you change the function that actually makes a dump to acquire the
> RTNL lock? (You'll need to do that *before* acquiring the driver's own
> lock.)
We can't do that because the driver lock is taken at much higher level where it does
some hardware specific things even before attempting to take FW dump.
Thanks.
-Anirban
^ permalink raw reply
* Re: AAARGH bisection is hard (Re: [2.6.39 regression] X locks up hard right after logging in)
From: Johannes Sixt @ 2011-05-12 18:54 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Andrew Lutomirski, linux-kernel, netdev, git
In-Reply-To: <BANLkTi=YDZa+BRaG90vJsjrT9VxgySrDRQ@mail.gmail.com>
Am 12.05.2011 19:37, schrieb Linus Torvalds:
> If you think it's networking, for example, and you've bisected into
> there but aren't sure, do "gitk --bisect", find the point where I
> merge, and pick that (and my parent), and "git bisect reset" those
> points.
Except that you should git reset --hard; git bisect reset gets you out
of bisect-mode, no?
-- Hannes
^ permalink raw reply
* [PATCH 0/3] Fix 8390 regressions
From: Geert Uytterhoeven @ 2011-05-12 19:11 UTC (permalink / raw)
To: David S. Miller, Stephen Hemminger, Yoshinori Sato
Cc: Russell King, Finn Thain, netdev, linux-kernel, linux-m68k
These patches fix regressions in 3 8390-based network drivers:
[1/3] zorro8390: Fix regression caused during net_device_ops conversion
[2/3] hydra: Fix regression caused during net_device_ops conversion
[3/3] ne-h8300: Fix regression caused during net_device_ops conversion
The first one, for zorro8390, has been tested.
The second one, for hydra, has been compile-tested only.
Based on commits 8cfd9e923be54ef66ce174a93f4592b444b96407 ("[ARM] RiscPC: Fix
etherh oops") and 217cbfa856dc1cbc2890781626c4032d9e3ec59f ("mac8390: fix
regression caused during net_device_ops conversion"), and the patch for
zorro8390, we have good reasons to believe hydra and ne-h8300 are affected
as well, as they all include lib8390.c.
Hence patches for those are also included, although I could not test them.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* [PATCH 1/3] zorro8390: Fix regression caused during net_device_ops conversion
From: Geert Uytterhoeven @ 2011-05-12 19:11 UTC (permalink / raw)
To: David S. Miller, Stephen Hemminger, Yoshinori Sato
Cc: linux-m68k, Russell King, netdev, linux-kernel, Finn Thain,
Geert Uytterhoeven, stable
In-Reply-To: <1305227500-15595-1-git-send-email-geert@linux-m68k.org>
Changeset b6114794a1c394534659f4a17420e48cf23aa922 ("zorro8390: convert to
net_device_ops") broke zorro8390 by adding 8390.o to the link. That
meant that lib8390.c was included twice, once in zorro8390.c and once in
8390.c, subject to different macros. This patch reverts that by
avoiding the wrappers in 8390.c.
Fix based on commits 217cbfa856dc1cbc2890781626c4032d9e3ec59f ("mac8390:
fix regression caused during net_device_ops conversion") and
4e0168fa4842e27795a75b205a510f25b62181d9 ("mac8390: fix build with
NET_POLL_CONTROLLER").
Reported-by: Christian T. Steigies <cts@debian.org>
Suggested-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Tested-by: Christian T. Steigies <cts@debian.org>
Cc: stable@kernel.org
---
drivers/net/Makefile | 2 +-
drivers/net/zorro8390.c | 12 ++++++------
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 01b604a..c64675f 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -219,7 +219,7 @@ obj-$(CONFIG_SC92031) += sc92031.o
obj-$(CONFIG_LP486E) += lp486e.o
obj-$(CONFIG_ETH16I) += eth16i.o
-obj-$(CONFIG_ZORRO8390) += zorro8390.o 8390.o
+obj-$(CONFIG_ZORRO8390) += zorro8390.o
obj-$(CONFIG_HPLANCE) += hplance.o 7990.o
obj-$(CONFIG_MVME147_NET) += mvme147.o 7990.o
obj-$(CONFIG_EQUALIZER) += eql.o
diff --git a/drivers/net/zorro8390.c b/drivers/net/zorro8390.c
index b78a38d..8c7c522 100644
--- a/drivers/net/zorro8390.c
+++ b/drivers/net/zorro8390.c
@@ -126,7 +126,7 @@ static int __devinit zorro8390_init_one(struct zorro_dev *z,
board = z->resource.start;
ioaddr = board+cards[i].offset;
- dev = alloc_ei_netdev();
+ dev = ____alloc_ei_netdev(0);
if (!dev)
return -ENOMEM;
if (!request_mem_region(ioaddr, NE_IO_EXTENT*2, DRV_NAME)) {
@@ -146,15 +146,15 @@ static int __devinit zorro8390_init_one(struct zorro_dev *z,
static const struct net_device_ops zorro8390_netdev_ops = {
.ndo_open = zorro8390_open,
.ndo_stop = zorro8390_close,
- .ndo_start_xmit = ei_start_xmit,
- .ndo_tx_timeout = ei_tx_timeout,
- .ndo_get_stats = ei_get_stats,
- .ndo_set_multicast_list = ei_set_multicast_list,
+ .ndo_start_xmit = __ei_start_xmit,
+ .ndo_tx_timeout = __ei_tx_timeout,
+ .ndo_get_stats = __ei_get_stats,
+ .ndo_set_multicast_list = __ei_set_multicast_list,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = eth_mac_addr,
.ndo_change_mtu = eth_change_mtu,
#ifdef CONFIG_NET_POLL_CONTROLLER
- .ndo_poll_controller = ei_poll,
+ .ndo_poll_controller = __ei_poll,
#endif
};
--
1.7.0.4
_______________________________________________
stable mailing list
stable@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/stable
^ permalink raw reply related
* [PATCH 2/3] hydra: Fix regression caused during net_device_ops conversion
From: Geert Uytterhoeven @ 2011-05-12 19:11 UTC (permalink / raw)
To: David S. Miller, Stephen Hemminger, Yoshinori Sato
Cc: linux-m68k, Russell King, netdev, linux-kernel, Finn Thain,
stable, Geert Uytterhoeven, Geert Uytterhoeven
In-Reply-To: <1305227500-15595-1-git-send-email-geert@linux-m68k.org>
From: Geert Uytterhoeven <geert@chicken.sonytel.be>
Changeset 5618f0d1193d6b051da9b59b0e32ad24397f06a4 ("hydra: convert to
net_device_ops") broke hydra by adding 8390.o to the link. That
meant that lib8390.c was included twice, once in hydra.c and once in
8390.c, subject to different macros. This patch reverts that by
avoiding the wrappers in 8390.c.
Fix based on commits 217cbfa856dc1cbc2890781626c4032d9e3ec59f ("mac8390:
fix regression caused during net_device_ops conversion") and
4e0168fa4842e27795a75b205a510f25b62181d9 ("mac8390: fix build with
NET_POLL_CONTROLLER").
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: stable@kernel.org
---
drivers/net/Makefile | 2 +-
drivers/net/hydra.c | 14 +++++++-------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index c64675f..4d2f094 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -231,7 +231,7 @@ obj-$(CONFIG_SGI_IOC3_ETH) += ioc3-eth.o
obj-$(CONFIG_DECLANCE) += declance.o
obj-$(CONFIG_ATARILANCE) += atarilance.o
obj-$(CONFIG_A2065) += a2065.o
-obj-$(CONFIG_HYDRA) += hydra.o 8390.o
+obj-$(CONFIG_HYDRA) += hydra.o
obj-$(CONFIG_ARIADNE) += ariadne.o
obj-$(CONFIG_CS89x0) += cs89x0.o
obj-$(CONFIG_MACSONIC) += macsonic.o
diff --git a/drivers/net/hydra.c b/drivers/net/hydra.c
index c5ef62c..1cd481c 100644
--- a/drivers/net/hydra.c
+++ b/drivers/net/hydra.c
@@ -98,15 +98,15 @@ static const struct net_device_ops hydra_netdev_ops = {
.ndo_open = hydra_open,
.ndo_stop = hydra_close,
- .ndo_start_xmit = ei_start_xmit,
- .ndo_tx_timeout = ei_tx_timeout,
- .ndo_get_stats = ei_get_stats,
- .ndo_set_multicast_list = ei_set_multicast_list,
+ .ndo_start_xmit = __ei_start_xmit,
+ .ndo_tx_timeout = __ei_tx_timeout,
+ .ndo_get_stats = __ei_get_stats,
+ .ndo_set_multicast_list = __ei_set_multicast_list,
.ndo_validate_addr = eth_validate_addr,
- .ndo_set_mac_address = eth_mac_addr,
+ .ndo_set_mac_address = eth_mac_addr,
.ndo_change_mtu = eth_change_mtu,
#ifdef CONFIG_NET_POLL_CONTROLLER
- .ndo_poll_controller = ei_poll,
+ .ndo_poll_controller = __ei_poll,
#endif
};
@@ -125,7 +125,7 @@ static int __devinit hydra_init(struct zorro_dev *z)
0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e,
};
- dev = alloc_ei_netdev();
+ dev = ____alloc_ei_netdev(0);
if (!dev)
return -ENOMEM;
--
1.7.0.4
_______________________________________________
stable mailing list
stable@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/stable
^ permalink raw reply related
* [PATCH 3/3] ne-h8300: Fix regression caused during net_device_ops conversion
From: Geert Uytterhoeven @ 2011-05-12 19:11 UTC (permalink / raw)
To: David S. Miller, Stephen Hemminger, Yoshinori Sato
Cc: linux-m68k, Russell King, netdev, linux-kernel, Finn Thain,
stable, Geert Uytterhoeven, Geert Uytterhoeven
In-Reply-To: <1305227500-15595-1-git-send-email-geert@linux-m68k.org>
From: Geert Uytterhoeven <geert@chicken.sonytel.be>
Changeset dcd39c90290297f6e6ed8a04bb20da7ac2b043c5 ("ne-h8300: convert to
net_device_ops") broke ne-h8300 by adding 8390.o to the link. That
meant that lib8390.c was included twice, once in ne-h8300.c and once in
8390.c, subject to different macros. This patch reverts that by
avoiding the wrappers in 8390.c.
Fix based on commits 217cbfa856dc1cbc2890781626c4032d9e3ec59f ("mac8390:
fix regression caused during net_device_ops conversion") and
4e0168fa4842e27795a75b205a510f25b62181d9 ("mac8390: fix build with
NET_POLL_CONTROLLER").
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: stable@kernel.org
---
drivers/net/Makefile | 2 +-
drivers/net/ne-h8300.c | 16 ++++++++--------
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 4d2f094..e5a7375 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -144,7 +144,7 @@ obj-$(CONFIG_NE3210) += ne3210.o 8390.o
obj-$(CONFIG_SB1250_MAC) += sb1250-mac.o
obj-$(CONFIG_B44) += b44.o
obj-$(CONFIG_FORCEDETH) += forcedeth.o
-obj-$(CONFIG_NE_H8300) += ne-h8300.o 8390.o
+obj-$(CONFIG_NE_H8300) += ne-h8300.o
obj-$(CONFIG_AX88796) += ax88796.o
obj-$(CONFIG_BCM63XX_ENET) += bcm63xx_enet.o
obj-$(CONFIG_FTMAC100) += ftmac100.o
diff --git a/drivers/net/ne-h8300.c b/drivers/net/ne-h8300.c
index 30be8c6..7298a34 100644
--- a/drivers/net/ne-h8300.c
+++ b/drivers/net/ne-h8300.c
@@ -167,7 +167,7 @@ static void cleanup_card(struct net_device *dev)
#ifndef MODULE
struct net_device * __init ne_probe(int unit)
{
- struct net_device *dev = alloc_ei_netdev();
+ struct net_device *dev = ____alloc_ei_netdev(0);
int err;
if (!dev)
@@ -197,15 +197,15 @@ static const struct net_device_ops ne_netdev_ops = {
.ndo_open = ne_open,
.ndo_stop = ne_close,
- .ndo_start_xmit = ei_start_xmit,
- .ndo_tx_timeout = ei_tx_timeout,
- .ndo_get_stats = ei_get_stats,
- .ndo_set_multicast_list = ei_set_multicast_list,
+ .ndo_start_xmit = __ei_start_xmit,
+ .ndo_tx_timeout = __ei_tx_timeout,
+ .ndo_get_stats = __ei_get_stats,
+ .ndo_set_multicast_list = __ei_set_multicast_list,
.ndo_validate_addr = eth_validate_addr,
- .ndo_set_mac_address = eth_mac_addr,
+ .ndo_set_mac_address = eth_mac_addr,
.ndo_change_mtu = eth_change_mtu,
#ifdef CONFIG_NET_POLL_CONTROLLER
- .ndo_poll_controller = ei_poll,
+ .ndo_poll_controller = __ei_poll,
#endif
};
@@ -637,7 +637,7 @@ int init_module(void)
int err;
for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) {
- struct net_device *dev = alloc_ei_netdev();
+ struct net_device *dev = ____alloc_ei_netdev(0);
if (!dev)
break;
if (io[this_dev]) {
--
1.7.0.4
_______________________________________________
stable mailing list
stable@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/stable
^ permalink raw reply related
* Re: [PATCH 2/3] hydra: Fix regression caused during net_device_ops conversion
From: Geert Uytterhoeven @ 2011-05-12 19:15 UTC (permalink / raw)
To: David S. Miller, Stephen Hemminger, Yoshinori Sato
Cc: Russell King, Finn Thain, netdev, linux-kernel, linux-m68k,
Geert Uytterhoeven, Geert Uytterhoeven, stable
In-Reply-To: <1305227500-15595-3-git-send-email-geert@linux-m68k.org>
On Thu, May 12, 2011 at 21:11, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> From: Geert Uytterhoeven <geert@chicken.sonytel.be>
Sorry, the above line is bogus. Please remove it.
> Changeset 5618f0d1193d6b051da9b59b0e32ad24397f06a4 ("hydra: convert to
> net_device_ops") broke hydra by adding 8390.o to the link. That
> meant that lib8390.c was included twice, once in hydra.c and once in
> 8390.c, subject to different macros. This patch reverts that by
> avoiding the wrappers in 8390.c.
>
> Fix based on commits 217cbfa856dc1cbc2890781626c4032d9e3ec59f ("mac8390:
> fix regression caused during net_device_ops conversion") and
> 4e0168fa4842e27795a75b205a510f25b62181d9 ("mac8390: fix build with
> NET_POLL_CONTROLLER").
>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: stable@kernel.org
> ---
> drivers/net/Makefile | 2 +-
> drivers/net/hydra.c | 14 +++++++-------
> 2 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/Makefile b/drivers/net/Makefile
> index c64675f..4d2f094 100644
> --- a/drivers/net/Makefile
> +++ b/drivers/net/Makefile
> @@ -231,7 +231,7 @@ obj-$(CONFIG_SGI_IOC3_ETH) += ioc3-eth.o
> obj-$(CONFIG_DECLANCE) += declance.o
> obj-$(CONFIG_ATARILANCE) += atarilance.o
> obj-$(CONFIG_A2065) += a2065.o
> -obj-$(CONFIG_HYDRA) += hydra.o 8390.o
> +obj-$(CONFIG_HYDRA) += hydra.o
> obj-$(CONFIG_ARIADNE) += ariadne.o
> obj-$(CONFIG_CS89x0) += cs89x0.o
> obj-$(CONFIG_MACSONIC) += macsonic.o
> diff --git a/drivers/net/hydra.c b/drivers/net/hydra.c
> index c5ef62c..1cd481c 100644
> --- a/drivers/net/hydra.c
> +++ b/drivers/net/hydra.c
> @@ -98,15 +98,15 @@ static const struct net_device_ops hydra_netdev_ops = {
> .ndo_open = hydra_open,
> .ndo_stop = hydra_close,
>
> - .ndo_start_xmit = ei_start_xmit,
> - .ndo_tx_timeout = ei_tx_timeout,
> - .ndo_get_stats = ei_get_stats,
> - .ndo_set_multicast_list = ei_set_multicast_list,
> + .ndo_start_xmit = __ei_start_xmit,
> + .ndo_tx_timeout = __ei_tx_timeout,
> + .ndo_get_stats = __ei_get_stats,
> + .ndo_set_multicast_list = __ei_set_multicast_list,
> .ndo_validate_addr = eth_validate_addr,
> - .ndo_set_mac_address = eth_mac_addr,
> + .ndo_set_mac_address = eth_mac_addr,
> .ndo_change_mtu = eth_change_mtu,
> #ifdef CONFIG_NET_POLL_CONTROLLER
> - .ndo_poll_controller = ei_poll,
> + .ndo_poll_controller = __ei_poll,
> #endif
> };
>
> @@ -125,7 +125,7 @@ static int __devinit hydra_init(struct zorro_dev *z)
> 0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e,
> };
>
> - dev = alloc_ei_netdev();
> + dev = ____alloc_ei_netdev(0);
> if (!dev)
> return -ENOMEM;
>
> --
> 1.7.0.4
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* Re: [PATCH 3/3] ne-h8300: Fix regression caused during net_device_ops conversion
From: Geert Uytterhoeven @ 2011-05-12 19:16 UTC (permalink / raw)
To: David S. Miller, Stephen Hemminger, Yoshinori Sato
Cc: Russell King, Finn Thain, netdev, linux-kernel, linux-m68k,
Geert Uytterhoeven, stable
In-Reply-To: <1305227500-15595-4-git-send-email-geert@linux-m68k.org>
On Thu, May 12, 2011 at 21:11, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> From: Geert Uytterhoeven <geert@chicken.sonytel.be>
Sorry, the above line is bogus. Please remove it.
> Changeset dcd39c90290297f6e6ed8a04bb20da7ac2b043c5 ("ne-h8300: convert to
> net_device_ops") broke ne-h8300 by adding 8390.o to the link. That
> meant that lib8390.c was included twice, once in ne-h8300.c and once in
> 8390.c, subject to different macros. This patch reverts that by
> avoiding the wrappers in 8390.c.
>
> Fix based on commits 217cbfa856dc1cbc2890781626c4032d9e3ec59f ("mac8390:
> fix regression caused during net_device_ops conversion") and
> 4e0168fa4842e27795a75b205a510f25b62181d9 ("mac8390: fix build with
> NET_POLL_CONTROLLER").
>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: stable@kernel.org
> ---
> drivers/net/Makefile | 2 +-
> drivers/net/ne-h8300.c | 16 ++++++++--------
> 2 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/Makefile b/drivers/net/Makefile
> index 4d2f094..e5a7375 100644
> --- a/drivers/net/Makefile
> +++ b/drivers/net/Makefile
> @@ -144,7 +144,7 @@ obj-$(CONFIG_NE3210) += ne3210.o 8390.o
> obj-$(CONFIG_SB1250_MAC) += sb1250-mac.o
> obj-$(CONFIG_B44) += b44.o
> obj-$(CONFIG_FORCEDETH) += forcedeth.o
> -obj-$(CONFIG_NE_H8300) += ne-h8300.o 8390.o
> +obj-$(CONFIG_NE_H8300) += ne-h8300.o
> obj-$(CONFIG_AX88796) += ax88796.o
> obj-$(CONFIG_BCM63XX_ENET) += bcm63xx_enet.o
> obj-$(CONFIG_FTMAC100) += ftmac100.o
> diff --git a/drivers/net/ne-h8300.c b/drivers/net/ne-h8300.c
> index 30be8c6..7298a34 100644
> --- a/drivers/net/ne-h8300.c
> +++ b/drivers/net/ne-h8300.c
> @@ -167,7 +167,7 @@ static void cleanup_card(struct net_device *dev)
> #ifndef MODULE
> struct net_device * __init ne_probe(int unit)
> {
> - struct net_device *dev = alloc_ei_netdev();
> + struct net_device *dev = ____alloc_ei_netdev(0);
> int err;
>
> if (!dev)
> @@ -197,15 +197,15 @@ static const struct net_device_ops ne_netdev_ops = {
> .ndo_open = ne_open,
> .ndo_stop = ne_close,
>
> - .ndo_start_xmit = ei_start_xmit,
> - .ndo_tx_timeout = ei_tx_timeout,
> - .ndo_get_stats = ei_get_stats,
> - .ndo_set_multicast_list = ei_set_multicast_list,
> + .ndo_start_xmit = __ei_start_xmit,
> + .ndo_tx_timeout = __ei_tx_timeout,
> + .ndo_get_stats = __ei_get_stats,
> + .ndo_set_multicast_list = __ei_set_multicast_list,
> .ndo_validate_addr = eth_validate_addr,
> - .ndo_set_mac_address = eth_mac_addr,
> + .ndo_set_mac_address = eth_mac_addr,
> .ndo_change_mtu = eth_change_mtu,
> #ifdef CONFIG_NET_POLL_CONTROLLER
> - .ndo_poll_controller = ei_poll,
> + .ndo_poll_controller = __ei_poll,
> #endif
> };
>
> @@ -637,7 +637,7 @@ int init_module(void)
> int err;
>
> for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) {
> - struct net_device *dev = alloc_ei_netdev();
> + struct net_device *dev = ____alloc_ei_netdev(0);
> if (!dev)
> break;
> if (io[this_dev]) {
> --
> 1.7.0.4
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* Re: AAARGH bisection is hard (Re: [2.6.39 regression] X locks up hard right after logging in)
From: Linus Torvalds @ 2011-05-12 19:17 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Andrew Lutomirski, linux-kernel, netdev, git
In-Reply-To: <4DCC2CFD.4010807@kdbg.org>
On Thu, May 12, 2011 at 11:54 AM, Johannes Sixt <j6t@kdbg.org> wrote:
>
> Except that you should git reset --hard; git bisect reset gets you out
> of bisect-mode, no?
Yeah, sorry, my bad.
Linus
^ permalink raw reply
* Re: [PATCHv3 net-next-2.6 2/3] qlcnic: Take FW dump via ethtool
From: Ben Hutchings @ 2011-05-12 19:18 UTC (permalink / raw)
To: Anirban Chakraborty; +Cc: netdev, David Miller
In-Reply-To: <F9877D83-226B-4C7A-AD01-E9AA441AD1CD@qlogic.com>
On Thu, 2011-05-12 at 11:53 -0700, Anirban Chakraborty wrote:
> On May 12, 2011, at 10:27 AM, Ben Hutchings wrote:
>
> > On Wed, 2011-05-11 at 15:54 -0700, Anirban Chakraborty wrote:
> >> Driver checks if the previous dump has been cleared before taking the dump.
> >> It doesn't take the dump if it is not cleared.
> >>
> >> Changes from v2:
> >> Added lock to protect dump data structures from being mangled while
> >> dumping or setting them via ethtool.
> >
> > Unfortunately it still seems to be possible for the dump length to
> > change between the ethtool core calling qlcnic_get_dump_flag() and
> > qlcnic_get_dump_data().
>
> dump length is serialized via the driver lock. dump length is a static
> entity for a given capture mask and it can only be changed when there
> is a different capture mask set in the driver (via calling set_dump()
> from ethtool core).
OK.
> Actual dump size is determined during the initial steps of FW dump
> which takes the driver lock to start with. So, I am not sure how the
> dump length could be changed between the calls to get_dump_flag and
> get_dump_data from within the ethtool core without a call to
> set_dump() in between.
[...]
What prevents this sequence:
1. Driver detects firmware dump is required, and creates the dump
(length L1).
2. User changes firmware dump flags through ethtool.
3. User starts to save firmware dump through ethtool:
a. ethtool utility reads dump length (= L1) and allocates user buffer
b. ethtool utility reads dump:
c. ethtool core reads dump length (L1) and allocates kernel buffer
4. Meanwhile, driver detects firmware dump is required again, and
creates a new dump (length L2, since dump flags changed)
5. (Continuation of 3)
d. ethtool core calls driver to read firmware dump
e. Driver copies new dump (length L2) into buffer of length L1
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* [PATCH 0/2] sctp: socket cleanups
From: Joe Perches @ 2011-05-12 19:19 UTC (permalink / raw)
To: linux-sctp; +Cc: netdev, linux-kernel
Size trivially reduced as well.
$ size net/sctp/socket.o
text data bss dec hex filename
55720 442 14988 71150 115ee net/sctp/socket.o.new
55730 442 14996 71168 11600 net/sctp/socket.o.old
Joe Perches (2):
sctp: sctp_sendmsg: Don't initialize default_sinfo
sctp: sctp_sendmsg: Don't test known non-null sinfo
net/sctp/socket.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
--
1.7.5.rc3.dirty
^ permalink raw reply
* [PATCH 1/2] sctp: sctp_sendmsg: Don't initialize default_sinfo
From: Joe Perches @ 2011-05-12 19:19 UTC (permalink / raw)
To: Vlad Yasevich, Sridhar Samudrala
Cc: David S. Miller, linux-sctp, netdev, linux-kernel
In-Reply-To: <cover.1305227620.git.joe@perches.com>
This variable only needs initialization when cmsgs.info
is NULL.
Don't use memset, just initialize every struct member.
Signed-off-by: Joe Perches <joe@perches.com>
---
net/sctp/socket.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 33d9ee6..a5d3560 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -1496,8 +1496,8 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
struct sctp_chunk *chunk;
union sctp_addr to;
struct sockaddr *msg_name = NULL;
- struct sctp_sndrcvinfo default_sinfo = { 0 };
struct sctp_sndrcvinfo *sinfo;
+ struct sctp_sndrcvinfo default_sinfo;
struct sctp_initmsg *sinit;
sctp_assoc_t associd = 0;
sctp_cmsgs_t cmsgs = { NULL };
@@ -1761,10 +1761,13 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
* some defaults.
*/
default_sinfo.sinfo_stream = asoc->default_stream;
+ default_sinfo.sinfo_ssn = 0;
default_sinfo.sinfo_flags = asoc->default_flags;
default_sinfo.sinfo_ppid = asoc->default_ppid;
default_sinfo.sinfo_context = asoc->default_context;
default_sinfo.sinfo_timetolive = asoc->default_timetolive;
+ default_sinfo.sinfo_tsn = 0;
+ default_sinfo.sinfo_cumtsn = 0;
default_sinfo.sinfo_assoc_id = sctp_assoc2id(asoc);
sinfo = &default_sinfo;
}
--
1.7.5.rc3.dirty
^ permalink raw reply related
* [PATCH 2/2] sctp: sctp_sendmsg: Don't test known non-null sinfo
From: Joe Perches @ 2011-05-12 19:19 UTC (permalink / raw)
To: Vlad Yasevich, Sridhar Samudrala
Cc: David S. Miller, linux-sctp, netdev, linux-kernel
In-Reply-To: <cover.1305227620.git.joe@perches.com>
It's already known non-null above.
Signed-off-by: Joe Perches <joe@perches.com>
---
net/sctp/socket.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index a5d3560..10ebcd7 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -1793,12 +1793,10 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
goto out_free;
}
- if (sinfo) {
- /* Check for invalid stream. */
- if (sinfo->sinfo_stream >= asoc->c.sinit_num_ostreams) {
- err = -EINVAL;
- goto out_free;
- }
+ /* Check for invalid stream. */
+ if (sinfo->sinfo_stream >= asoc->c.sinit_num_ostreams) {
+ err = -EINVAL;
+ goto out_free;
}
timeo = sock_sndtimeo(sk, msg->msg_flags & MSG_DONTWAIT);
--
1.7.5.rc3.dirty
^ permalink raw reply related
* Re: pull request: sfc-2.6 2011-05-12
From: David Miller @ 2011-05-12 20:30 UTC (permalink / raw)
To: bhutchings; +Cc: netdev, linux-net-drivers
In-Reply-To: <1305216428.5214.13.camel@bwh-desktop>
From: Ben Hutchings <bhutchings@solarflare.com>
Date: Thu, 12 May 2011 17:07:08 +0100
> The following changes since commit ff538818f4a82c4cf02d2d6bd6ac5c7360b9d41d:
>
> sysctl: net: call unregister_net_sysctl_table where needed (2011-05-02 16:12:14 -0700)
>
> are available in the git repository at:
> git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-2.6.git sfc-2.6.39
>
> Ben Hutchings (1):
> sfc: Always map MCDI shared memory as uncacheable
>
> Sorry for sending this so late. I was really hoping to get to the
> bottom of this issue and find a simple fix.
Pulled, thanks Ben.
^ permalink raw reply
* [PATCH] net: af_packet: Don't initialize vnet_hdr
From: Joe Perches @ 2011-05-12 20:36 UTC (permalink / raw)
To: linux-kernel; +Cc: David S. Miller, netdev
Save a memset, initialize only the portion necessary.
packet_snd either gets this structure completely from
memcpy_fromiovec or uses only the hdr_len set to 0,
so don't always initialize the structure to 0.
Signed-off-by: Joe Perches <joe@perches.com>
---
net/packet/af_packet.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 549527b..ac88df9 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -1123,7 +1123,7 @@ static int packet_snd(struct socket *sock,
__be16 proto;
unsigned char *addr;
int ifindex, err, reserve = 0;
- struct virtio_net_hdr vnet_hdr = { 0 };
+ struct virtio_net_hdr vnet_hdr;
int offset = 0;
int vnet_hdr_len;
struct packet_sock *po = pkt_sk(sk);
@@ -1206,7 +1206,9 @@ static int packet_snd(struct socket *sock,
goto out_unlock;
}
- }
+ } else
+ vnet_hdr.hdr_len = 0;
+
err = -EMSGSIZE;
if (!gso_type && (len > dev->mtu + reserve + VLAN_HLEN))
--
1.7.5.rc3.dirty
^ permalink raw reply related
* Re: [PATCHv3 net-next-2.6 2/3] qlcnic: Take FW dump via ethtool
From: Anirban Chakraborty @ 2011-05-12 20:54 UTC (permalink / raw)
To: Ben Hutchings; +Cc: netdev, David Miller
In-Reply-To: <1305227938.5214.48.camel@bwh-desktop>
On May 12, 2011, at 12:18 PM, Ben Hutchings wrote:
> On Thu, 2011-05-12 at 11:53 -0700, Anirban Chakraborty wrote:
>> On May 12, 2011, at 10:27 AM, Ben Hutchings wrote:
>>
>>> On Wed, 2011-05-11 at 15:54 -0700, Anirban Chakraborty wrote:
>>>> Driver checks if the previous dump has been cleared before taking the dump.
>>>> It doesn't take the dump if it is not cleared.
>>>>
>>>> Changes from v2:
>>>> Added lock to protect dump data structures from being mangled while
>>>> dumping or setting them via ethtool.
>>>
>>> Unfortunately it still seems to be possible for the dump length to
>>> change between the ethtool core calling qlcnic_get_dump_flag() and
>>> qlcnic_get_dump_data().
>>
>> dump length is serialized via the driver lock. dump length is a static
>> entity for a given capture mask and it can only be changed when there
>> is a different capture mask set in the driver (via calling set_dump()
>> from ethtool core).
>
> OK.
>
>> Actual dump size is determined during the initial steps of FW dump
>> which takes the driver lock to start with. So, I am not sure how the
>> dump length could be changed between the calls to get_dump_flag and
>> get_dump_data from within the ethtool core without a call to
>> set_dump() in between.
> [...]
>
> What prevents this sequence:
>
> 1. Driver detects firmware dump is required, and creates the dump
> (length L1).
> 2. User changes firmware dump flags through ethtool.
> 3. User starts to save firmware dump through ethtool:
> a. ethtool utility reads dump length (= L1) and allocates user buffer
> b. ethtool utility reads dump:
> c. ethtool core reads dump length (L1) and allocates kernel buffer
> 4. Meanwhile, driver detects firmware dump is required again, and
> creates a new dump (length L2, since dump flags changed)
This step won't happen as driver ensures that if a dump is taken that is not
cleared yet by ethtool utility, it is not going to take any further dump. So, until
the get_dump_data() has been called to fetch the dump data, changing dump
flag (and hence dump size) will not have any effect.
In 3 above, ethtool core created a buffer of L1 size but hasn't yet called
get_dump_data() of the driver, so driver is still holding onto its previously
dumped data even though capture mask has been changed and the driver
encountered a situation where it ought to take the dump.
-Anirban
^ 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