* Re: [PATCH] vmxnet3: fix compilation when RSS is disabled
From: David Miller @ 2010-11-29 2:26 UTC (permalink / raw)
To: scottjg; +Cc: netdev, linux-kernel, linux-next, pv-drivers, randy.dunlap
In-Reply-To: <1290890035-32285-2-git-send-email-scottjg@vmware.com>
From: "Scott J. Goldman" <scottjg@vmware.com>
Date: Sat, 27 Nov 2010 12:33:55 -0800
> If RSS is disabled, we can ifdef out some RSS specific code. This fixes
> the compile error found by Randy Dunlap.
>
> Signed-off-by: Scott J. Goldman <scottjg@vmware.com>
Applied.
^ permalink raw reply
* Re: [PATCH] ucc_geth: fix ucc halt problem in half duplex mode
From: David Miller @ 2010-11-29 2:37 UTC (permalink / raw)
To: leoli; +Cc: linuxppc-dev, netdev, jdboyer, Andreas.Schmitz, avorontsov
In-Reply-To: <1290763798-22844-1-git-send-email-leoli@freescale.com>
From: Li Yang <leoli@freescale.com>
Date: Fri, 26 Nov 2010 17:29:58 +0800
> In commit 58933c64(ucc_geth: Fix the wrong the Rx/Tx FIFO size),
> the UCC_GETH_UTFTT_INIT is set to 512 based on the recommendation
> of the QE Reference Manual. But that will sometimes cause tx halt
> while working in half duplex mode.
>
> According to errata draft QE_GENERAL-A003(High Tx Virtual FIFO
> threshold size can cause UCC to halt), setting UTFTT less than
> [(UTFS x (M - 8)/M) - 128] will prevent this from happening
> (M is the minimum buffer size).
>
> The patch changes UTFTT back to 256.
>
> Signed-off-by: Li Yang <leoli@freescale.com>
> Cc: Jean-Denis Boyer <jdboyer@media5corp.com>
> Cc: Andreas Schmitz <Andreas.Schmitz@riedel.net>
> Cc: Anton Vorontsov <avorontsov@ru.mvista.com>
Applied, thank you.
^ permalink raw reply
* RE: atl1e error messages in syslog
From: Cloud Ren @ 2010-11-29 3:05 UTC (permalink / raw)
To: Jack Byer, Xiong Huang
Cc: jcliburn@gmail.com, chris.snook@gmail.com, netdev@vger.kernel.org
In-Reply-To: <AANLkTik8gh8=wBCoTELchFAQih-+_b7sUJ4p2z1ojSeh@mail.gmail.com>
Hi,
Can you give us driver version information?
You can use " ethtool -i eth0" get it. thanks
Best Regards
Cloud Ren
-----Original Message-----
From: Jack Byer [mailto:ftn768@gmail.com]
Sent: 2010年11月29日 8:44
To: Xiong Huang
Cc: jcliburn@gmail.com; chris.snook@gmail.com; Cloud Ren; netdev@vger.kernel.org
Subject: Re: atl1e error messages in syslog
On Sun, Nov 28, 2010 at 6:32 PM, Xiong Huang <Xiong.Huang@atheros.com> wrote:
> Sorry, I can't recognize it unless you give me the PCI device ID.
I forgot to use -n
The ID is 1969:1026
^ permalink raw reply
* Re: [PATCH] vmxnet3: fix compilation when RSS is disabled
From: Randy Dunlap @ 2010-11-29 3:07 UTC (permalink / raw)
To: Scott J. Goldman; +Cc: netdev, linux-kernel, linux-next, pv-drivers
In-Reply-To: <1290890035-32285-2-git-send-email-scottjg@vmware.com>
On 11/27/10 12:33, Scott J. Goldman wrote:
> If RSS is disabled, we can ifdef out some RSS specific code. This fixes
> the compile error found by Randy Dunlap.
>
> Signed-off-by: Scott J. Goldman <scottjg@vmware.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Thanks.
> ---
> drivers/net/vmxnet3/vmxnet3_ethtool.c | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/vmxnet3/vmxnet3_ethtool.c b/drivers/net/vmxnet3/vmxnet3_ethtool.c
> index 9ddaea6..8e17fc8 100644
> --- a/drivers/net/vmxnet3/vmxnet3_ethtool.c
> +++ b/drivers/net/vmxnet3/vmxnet3_ethtool.c
> @@ -553,7 +553,7 @@ vmxnet3_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *info,
> return -EOPNOTSUPP;
> }
>
> -
> +#ifdef VMXNET3_RSS
> static int
> vmxnet3_get_rss_indir(struct net_device *netdev,
> struct ethtool_rxfh_indir *p)
> @@ -598,6 +598,7 @@ vmxnet3_set_rss_indir(struct net_device *netdev,
> return 0;
>
> }
> +#endif
>
> static struct ethtool_ops vmxnet3_ethtool_ops = {
> .get_settings = vmxnet3_get_settings,
> @@ -623,8 +624,10 @@ static struct ethtool_ops vmxnet3_ethtool_ops = {
> .get_ringparam = vmxnet3_get_ringparam,
> .set_ringparam = vmxnet3_set_ringparam,
> .get_rxnfc = vmxnet3_get_rxnfc,
> +#ifdef VMXNET3_RSS
> .get_rxfh_indir = vmxnet3_get_rss_indir,
> .set_rxfh_indir = vmxnet3_set_rss_indir,
> +#endif
> };
>
> void vmxnet3_set_ethtool_ops(struct net_device *netdev)
--
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
^ permalink raw reply
* Re: atl1e error messages in syslog
From: Jack Byer @ 2010-11-29 3:15 UTC (permalink / raw)
To: Cloud Ren
Cc: Xiong Huang, jcliburn@gmail.com, chris.snook@gmail.com,
netdev@vger.kernel.org
In-Reply-To: <CDAFEDABF718A54BABD0DA54766953070141EF3233@SHEXMB-01.global.atheros.com>
On Sun, Nov 28, 2010 at 9:05 PM, Cloud Ren <Cloud.Ren@atheros.com> wrote:
> Hi,
>
> Can you give us driver version information?
>
> You can use " ethtool -i eth0" get it. thanks
>
This is the driver from kernel 2.6.38.1
driver: ATL1E
version: 1.0.0.7-NAPI
firmware-version: L1e
bus-info: 0000:02:00.0
^ permalink raw reply
* RE: [PATCH] net/r8169: Correct the ram code for RTL8111D(L)
From: hayeswang @ 2010-11-29 3:47 UTC (permalink / raw)
To: 'Ben Hutchings', 'Francois Romieu'
Cc: netdev, linux-kernel, 'David Miller', 564628
In-Reply-To: <1290813146.3051.58.camel@localhost>
Excuse me, I have some questions about the firmware patch.
1. I should convert the data into the binary files (.bin). Is it right?
2. Where should I update the firmware files? Is the path the
linux-2.6/firmeware?
However, according to linux-2.6/firmeware/README.AddingFirmware, I
should
update they to another repository:
git://git.kernel.org/pub/scm/linux/kernel/git/dwmw2/linux-firmware.git
Then, how the firmware merge with kernel-2.6? Or, where could I find the
firmware
in the kernel-2.6 repository?
Best Regards,
Hayes
> -----Original Message-----
> From: Ben Hutchings [mailto:benh@debian.org]
> Sent: Saturday, November 27, 2010 7:12 AM
> To: Francois Romieu; Hayeswang
> Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org;
> David Miller; 564628@bugs.debian.org
> Subject: Re: [PATCH] net/r8169: Correct the ram code for RTL8111D(L)
>
> On Fri, 2010-11-26 at 23:49 +0100, Francois Romieu wrote:
> > Ben Hutchings <benh@debian.org> :
> > > On Fri, 2010-11-26 at 19:54 +0800, Hayes Wang wrote:
> > > > Correct the binary code (Low pass filter & DLY_CAP fine
> tune from uC).
> > > > The incorrect ram code would make the nic working abnormally.
> > > [...]
> > >
> > > I'm glad you finally acknowledge that this is code rather than
> > > simple register initialisation.
> >
> > I am not sure that Hayes is a native english speaker.
> >
> > I am glad to see him posting here.
>
> Right.
>
> Hayes, by 'you' I meant Realtek, not you personally. If my
> reply seemed aggressive, I apologise.
>
> > [...]
> > > Below are the changes Debian currently applies in preparation for
> > > proper licencing of the firmware.
> >
> > Do you have some scripts to convert the data at hand ?
> [...]
>
> No, it's easy enough to convert a single array by copying it
> into a C file that dumps it to stdout (assuming the file's
> byte order is defined to match your own machine).
>
> It might be worth adding some sort of header with a version
> and checksum. Your choice, really.
>
> Ben.
>
> --
> Ben Hutchings, Debian Developer and kernel team member
>
>
^ permalink raw reply
* B43 on Inspiron 1545 w/Ubuntu
From: David Brownell @ 2010-11-29 4:27 UTC (permalink / raw)
To: netdev
Briefly, it's never worked well and I'm hoping someone can help.
The OS is currently Ubuntu 10.04.1 ... recent updates included B43
from wireless-backports, I think; I saw One positive change,
but it still doesn't work. (Yeah, 2.6.32 isn't recent, but I'm not
much trusting the non-existent account backup here. so an upgrade
to 10.10.x isn't yet in the cards. And this is supposed to work
already, in any case...
History: Didn't work at first, the driver had a DMA bug. Based
on a forum post I installed the backports using Ethernet. After
more setup and a few days, WLAN began working relatively well ...
for a period of maybe five days, then completely stopped working
in the middle of a webpage access (last summer).
NetworkManager kept saying wireless was disabled (and rejected all
attempts to re-enable. 10+ months passed (Ethernet works fine).
NOTE to "NetworkManager" folk ... please fix it so that
when you select "enable wireless" it either does so, or says why it
didn't. This "Ignore user commands" crap is garbage. and for
that matter -- instead of saying "disabled", try saying why/how;
I certainly never disabled WLAN. or "Networking" as a whole either,
so in that sense it's just a bug. In particular, there was never
any explicit user "disable" action (to parallel the "enable" menu
option provided) by NM).
To my surprise and pleasure, the WLAN worked for about two
hours of web browsing in a hotel lobby, after disconnecting from
a wired connection; no odd behaviors at all, beyond trying at first
to connect as wired, when there was no wire available.
Hasn't worked from various coffee shops either. As if maybe something
in NetworkManager transferred state from wired to WLAN, sufficient to
make it work ... but coffee shops wouldn't support such state transfer
between my home LAN and the coffee WLAN. (That hotel had one network
provider for both wired and WLAN/lobby).
The only other time this came close to working was on an airplane,
where it saw "gogoinflight" but crapped out after a few minutes.
(Sorry no details on how/why; maybe it would have been happier if
I'd finished signing up before it crapped out
A recent Ubuntu update changed behavior in a positive way: when
I looked at "dmesg" (as few normal users would try to do), it
changed behavior and complained about a hardware RFKILL button.
Let it be noted that there is no such button ... but BIOS F2 is
probably what it means. Unfortunately I can't figure out how to
make that button work ... the manual is not at best weak. (Suggests
just press F2, not FN-F2, forums say the latter, but neither one has
worked for me . (Plus there is no visual rfkill indication (LED
or otherwise) as I'm used to on other hardware. I guess on this
hardware Dell cheaped out past the point usability was affected.
The undocumented "rfkill" command says WLAN is "hard blocked".
Puzzling, considering I've never tried to block WLAN access, and
it appears to have decided to spontaneously off itself.
I'm moderately hopeful that if I could make F2 work, then I'd
have WLAN. Hope does spring eternal, as they say... Can someone
please offer some hints for me?
While I'm writing here, I'll just comment that NetworkManager has
seemed to make this whole thing maximally painful/mysterious.
Recent dmesg output below.
[ 680.493965] b43-phy0: Broadcom 4312 WLAN found (core revision 15)
[ 680.660736] phy0: Selected rate control algorithm 'minstrel'
[ 680.661406] Registered led device: b43-phy0::tx
[ 680.661423] Registered led device: b43-phy0::rx
[ 680.661437] Registered led device: b43-phy0::radio
[ 680.661519] Broadcom 43xx driver loaded [ Features: PMNLS,
Firmware-ID: FW13 ]
[ 680.960280] b43-phy0: Loading firmware version 410.2160 (2007-05-26
15:32:10)
[ 681.700410] b43-phy0: Radio hardware status changed to DISABLED
[ 681.730361] b43-phy0: Radio turned on by software
[ 681.730368] b43-phy0: The hardware RF-kill button still turns the
radio physically off. Press the button to turn it on.
[ 681.731490] ADDRCONF(NETDEV_UP): wlan0: link is not ready
^ permalink raw reply
* biosdevname v0.3.1
From: Matt Domsch @ 2010-11-29 4:48 UTC (permalink / raw)
To: linux-hotplug, netdev, K, Narendra, Hargrave, Jordan,
Rose, Charles, Co
I've published biosdevname v0.3.1. This has quite a few changes since
the 0.2.4 version published over 3 years ago. Grab it here:
http://linux.dell.com/files/biosdevname/permalink/biosdevname-0.3.1.tar.gz
http://linux.dell.com/files/biosdevname/permalink/biosdevname-0.3.1.tar.gz.sign
GIT: http://linux.dell.com/cgi-bin/gitweb/gitweb.cgi?p=biosdevname.git;a=summary
Highlights:
- uses sysfs index and SMBIOS information if available.
- The only policies that remain are the new default 'physical' policy
that uses sysfs index (SMBIOS), and the historic all_ethN policy
that is only usable in non-hotplug environments.
- works on SR-IOV devices as well as traditional NICs
The naming policy it suggests are as follows:
Embedded devices: em<port>
Add-in PCI cards: pci<slot>#<port>_<virtual function instance>
My goal is to get this into Fedora 15, RHEL 6.x (x TBD), Debian, Ubuntu Natty,
openSUSE, and any other distribution that will have it.
git shortlog:
Gabriel C (1):
add make uninstall target
Jordan Hargrave (2):
fix mmap() return check
bump version
Matt Domsch (72):
Fix 'make deb' so it works.
add 'make sdeb' for source debian packages for review
include pkg/debian/ in tarball
rpm specs: manpages are sometimes automatically compressed
rpm spec: fix manpage in %files, add udev version requirement for Fedora
update Makefile.in
add chassis_label field
add smbios_names naming policy
ensure display buffer is long enough and zeroed before use
bug fix: s/sprintf/snprintf/ leading to SEGV
dmidecode: get proper chassis label string
naming_policy: fix smbios_names reporting
exit with error code if --policy=smbios_names but BIOS doesn't have the info
make dev->bios_name[] a pointer
udev rules: don't rename, create symlinks in net/by-slot-name and net/by-chassis-label instead
strip trailing whitespace from SMBIOS strings
remove extra spaces in udev rules, to work around udev bug
add intermediary program /lib/udev/netdevice to cycle through biosdevname policies
finish fixing up configure/Makefiles
start netdevnames at 71; make netdevice exectuable
s/chassis_label/smbios_label/
move sysfs reading function from pcmcia to its own file
read sysfs label and index files for PCI devices
minor cleanups; dead code removal
remove generated files from source control
configure: note requires pciutils-devel
read label and index from sysfs if present
add policy=loms, make it default
add .gitignore
silently handle running in virtualization, bug fix storing sysfs label
better configure messages on missing zlib-devel and pciutils-devel
fix buglet in add_interface, with thanks to gcc 4.4.5 -Wall
don't use perror() to print meaningless warnings to users
don't print error opening /dev/mem, as fails on KVM guests
bugfixes in reading sysfs files
invoke biosdevname directly from udev rule, --policy=loms
remove the netdevice script from install
add policy=loms to manpage
fix Makefile uninstall-local failure
fix udev rules typo
finish removing netdevice script
update changelogs, bump version
rename policy=loms to =embedded, use enX instead of lomX
make embedded NIC name configurable, default ='en'
add --prefix to manpage
Use sysfs to find parent devices and slot
add --policy=pony (to be renamed later) naming of PCI devices
attach VFs to PFs, unparse the lists when debugging
assign names to PCI VFs as pci1#0_2 for slot 1, port 0, VF 2
change default embedded prefix to "em"
allow all combinations of embedded/add-in, PF or VF, in naming
don't use #port nomenclature for embedded devices
mark HP embedded NICs as being embedded
remove unused function
s/pony/physical/
fix udev rule policy name
change udev rule to set NAME=, so stateful names persistent names aren't written to 70-persistent-net.rules
add additional checks and define _GNU_SOURCE in configure.ac
get VF index from sysfs
fix getting VF indices from sysfs
more fixes for SRIOV detection
move setting slot_index into pci.c, fixes failures with SR-IOV devices; other cleanups.
don't print to stderr on SIOCGIFHWADDR failure
note that index_in_slot is only valid for physical slot PF devices
POLICY DELETIONS: delete all policies but all_ethN and physical (default)
only print Index in slot where it's valid
fix manpage for policy deletions
clean up manpage and help text
fix use of uses_smbios
update manpage with the naming policies in use now
document return codes in manpage
bump version string to 0.3.1
Thanks,
Matt
--
Matt Domsch
Technology Strategist
Dell | Office of the CTO
^ permalink raw reply
* Re: [PATCH 2/2] pch_gbe driver: The wrong of initializer entry
From: Toshiharu Okada @ 2010-11-29 5:06 UTC (permalink / raw)
To: David Miller
Cc: linux, randy.dunlap, john.linn, ralf, kristoffer, mbizon,
gregory.v.rose, netdev, linux-kernel, masa-korg, qi.wang,
yong.y.wang, andrew.chih.howe.khor, joel.clark, margie.foster,
kok.howg.ewe
In-Reply-To: <20101127.174103.104047424.davem@davemloft.net>
Hi David Miller
Date: Sat, 27 Nov 2010 17:41:03 -0800 (PST)
From: "David Miller" <davem@davemloft.net>
>
> > The wrong of initializer entry was modified.
> >
> > Signed-off-by: Toshiharu Okada <toshiharu-linux@dsn.okisemi.com>
>
> How about you give some credit to David Alan Gilbert who made
> you aware of this issue?
Credit?
Does this mean that I add "Singed of by: Dr. David Alan Gilbert
<linux@trebig.org>" ?
Is my understanding correct?
Best regards
Toshiharu Okada (OKI SEMICONDUCTOR)
^ permalink raw reply
* [PATCH] vhost: correctly set bits of dirty pages
From: Jason Wang @ 2010-11-29 5:48 UTC (permalink / raw)
To: virtualization, netdev, linux-kernel, kvm, mst
When counting pages we should increase it by 1 instead of VHOST_PAGE_SIZE,
and also make log_write() can correctly process the request across
pages with write_address not start at page boundary.
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
drivers/vhost/vhost.c | 20 +++++++++-----------
1 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index a29d91c..576300b 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -884,23 +884,21 @@ static int set_bit_to_user(int nr, void __user *addr)
static int log_write(void __user *log_base,
u64 write_address, u64 write_length)
{
- int r;
- if (!write_length)
- return 0;
- write_address /= VHOST_PAGE_SIZE;
- for (;;) {
+ int r = 0;
+ while (write_length > 0) {
+ u64 l = VHOST_PAGE_SIZE - write_address % VHOST_PAGE_SIZE;
+ u64 write_page = write_address / VHOST_PAGE_SIZE;
u64 base = (u64)(unsigned long)log_base;
- u64 log = base + write_address / 8;
- int bit = write_address % 8;
+ u64 log = base + write_page / 8;
+ int bit = write_page % 8;
if ((u64)(unsigned long)log != log)
return -EFAULT;
r = set_bit_to_user(bit, (void __user *)(unsigned long)log);
if (r < 0)
return r;
- if (write_length <= VHOST_PAGE_SIZE)
- break;
- write_length -= VHOST_PAGE_SIZE;
- write_address += VHOST_PAGE_SIZE;
+ l = min(l, write_length);
+ write_length -= l;
+ write_address += l;
}
return r;
}
^ permalink raw reply related
* [PATCH] vhost: fix typos in comment
From: Jason Wang @ 2010-11-29 5:48 UTC (permalink / raw)
To: virtualization, netdev, linux-kernel, kvm, mst
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
drivers/vhost/net.c | 2 +-
drivers/vhost/vhost.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index d10da28..14fc189 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -452,7 +452,7 @@ static void handle_rx_mergeable(struct vhost_net *net)
move_iovec_hdr(vq->iov, vq->hdr, vhost_hlen, in);
else
/* Copy the header for use in VIRTIO_NET_F_MRG_RXBUF:
- * needed because sendmsg can modify msg_iov. */
+ * needed because recvmsg can modify msg_iov. */
copy_iovec_hdr(vq->iov, vq->hdr, sock_hlen, in);
msg.msg_iovlen = in;
err = sock->ops->recvmsg(NULL, sock, &msg,
diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h
index 073d06a..2af44b7 100644
--- a/drivers/vhost/vhost.h
+++ b/drivers/vhost/vhost.h
@@ -102,7 +102,7 @@ struct vhost_virtqueue {
* flush the vhost_work instead of synchronize_rcu. Therefore readers do
* not need to call rcu_read_lock/rcu_read_unlock: the beginning of
* vhost_work execution acts instead of rcu_read_lock() and the end of
- * vhost_work execution acts instead of rcu_read_lock().
+ * vhost_work execution acts instead of rcu_read_unlock().
* Writers use virtqueue mutex. */
void __rcu *private_data;
/* Log write descriptors */
^ permalink raw reply related
* Re: [PATCH 2/2] pch_gbe driver: The wrong of initializer entry
From: David Miller @ 2010-11-29 5:59 UTC (permalink / raw)
To: toshiharu-linux
Cc: linux, randy.dunlap, john.linn, ralf, kristoffer, mbizon,
gregory.v.rose, netdev, linux-kernel, masa-korg, qi.wang,
yong.y.wang, andrew.chih.howe.khor, joel.clark, margie.foster,
kok.howg.ewe
In-Reply-To: <001e01cb8f83$31ade9c0$66f8800a@maildom.okisemi.com>
From: "Toshiharu Okada" <toshiharu-linux@dsn.okisemi.com>
Date: Mon, 29 Nov 2010 14:06:23 +0900
> Hi David Miller
>
>
> Date: Sat, 27 Nov 2010 17:41:03 -0800 (PST)
> From: "David Miller" <davem@davemloft.net>
>>
>> > The wrong of initializer entry was modified.
>> >
>> > Signed-off-by: Toshiharu Okada <toshiharu-linux@dsn.okisemi.com>
>>
>> How about you give some credit to David Alan Gilbert who made
>> you aware of this issue?
>
> Credit?
> Does this mean that I add "Singed of by: Dr. David Alan Gilbert
> <linux@trebig.org>" ?
> Is my understanding correct?
You should use "Reported-by: ..."
^ permalink raw reply
* Re: [PATCH net-next] bnx2x: Add Nic partitioning mode (57712 devices)
From: Matt Domsch @ 2010-11-29 6:01 UTC (permalink / raw)
To: Dmitry Kravkov
Cc: davem, netdev, Eilon Greenstein, narendra_k, jordan_hargrave
In-Reply-To: <1290982177.6066.3.camel@lb-tlvb-dmitry>
On Mon, Nov 29, 2010 at 12:09:37AM +0200, Dmitry Kravkov wrote:
> NIC partitioning is another flavor of multi function - having few
> PCI functions share the same physical port. Unlike the currently
> supported mode of multi-function which depends on the switch
> configuration and uses outer-VLAN, the NPAR mode is switch independent
> and uses the MAC addresses to distribute incoming packets to the different
> functions. This patch adds the specific HW setting of the NPAR mode
> and some distinctions between switch dependent (SD) and
> switch independent (SI) multi-function (MF) modes where the configuration
> is not the same.
Just as SR-IOV introduced sysfs pointers between VF and PF devices:
/sys/bus/pci/devices/pci0000:00/0000:00:09.0/0000:05:00.0/virtfn0 -> ../0000:05:10.0/
/sys/bus/pci/devices/pci0000:00/0000:00:09.0/0000:05:10.0/physfn -> ../0000:05:00.0/
I would like to see a similar relationship exposed in sysfs for NPAR
partitions and their respective ports. This will let biosdevname
accurately name NPAR devices according to the scheme:
pci<slot>#<port>_<virtual function>
just as it does for SR-IOV devices. Is there one parent partition
that the child partitions could point back to, or other way to group
all the partitions of a single port?
Thanks,
Matt
--
Matt Domsch
Technology Strategist
Dell | Office of the CTO
^ permalink raw reply
* [PATCH 1/3] net: kill unused macros in head file
From: Shan Wei @ 2010-11-29 6:53 UTC (permalink / raw)
To: David Miller
Cc: Network-Maillist, kuznet, pekkas, jmorris,
yoshfuji@linux-ipv6.org >> YOSHIFUJI Hideaki,
Patrick McHardy, Shan Wei
These macros have been defined for several years since v2.6.12-rc2(tracing by git),
but never be used. So remove them.
Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
---
include/net/addrconf.h | 2 --
include/net/ip6_route.h | 1 -
include/net/ndisc.h | 6 ------
include/net/snmp.h | 1 -
include/net/sock.h | 3 ---
include/net/tcp.h | 6 ------
6 files changed, 0 insertions(+), 19 deletions(-)
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index a944124..23710aa 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -1,8 +1,6 @@
#ifndef _ADDRCONF_H
#define _ADDRCONF_H
-#define RETRANS_TIMER HZ
-
#define MAX_RTR_SOLICITATIONS 3
#define RTR_SOLICITATION_INTERVAL (4*HZ)
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 278312c..52c0550 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -3,7 +3,6 @@
#define IP6_RT_PRIO_USER 1024
#define IP6_RT_PRIO_ADDRCONF 256
-#define IP6_RT_PRIO_KERN 512
struct route_info {
__u8 type;
diff --git a/include/net/ndisc.h b/include/net/ndisc.h
index 895997b..f134987 100644
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -39,12 +39,6 @@ enum {
#define MAX_RTR_SOLICITATION_DELAY HZ
-#define ND_REACHABLE_TIME (30*HZ)
-#define ND_RETRANS_TIMER HZ
-
-#define ND_MIN_RANDOM_FACTOR (1/2)
-#define ND_MAX_RANDOM_FACTOR (3/2)
-
#ifdef __KERNEL__
#include <linux/compiler.h>
diff --git a/include/net/snmp.h b/include/net/snmp.h
index a0e6180..835c587 100644
--- a/include/net/snmp.h
+++ b/include/net/snmp.h
@@ -60,7 +60,6 @@ struct ipstats_mib {
};
/* ICMP */
-#define ICMP_MIB_DUMMY __ICMP_MIB_MAX
#define ICMP_MIB_MAX (__ICMP_MIB_MAX + 1)
struct icmp_mib {
diff --git a/include/net/sock.h b/include/net/sock.h
index 5557dfb..717cfbf 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -516,9 +516,6 @@ static __inline__ void sk_add_bind_node(struct sock *sk,
#define sk_nulls_for_each_from(__sk, node) \
if (__sk && ({ node = &(__sk)->sk_nulls_node; 1; })) \
hlist_nulls_for_each_entry_from(__sk, node, sk_nulls_node)
-#define sk_for_each_continue(__sk, node) \
- if (__sk && ({ node = &(__sk)->sk_node; 1; })) \
- hlist_for_each_entry_continue(__sk, node, sk_node)
#define sk_for_each_safe(__sk, node, tmp, list) \
hlist_for_each_entry_safe(__sk, node, tmp, list, sk_node)
#define sk_for_each_bound(__sk, node, list) \
diff --git a/include/net/tcp.h b/include/net/tcp.h
index e36c874..ea819cc 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -100,12 +100,6 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo);
#define TCP_SYNACK_RETRIES 5 /* number of times to retry passive opening a
* connection: ~180sec is RFC minimum */
-
-#define TCP_ORPHAN_RETRIES 7 /* number of times to retry on an orphaned
- * socket. 7 is ~50sec-16min.
- */
-
-
#define TCP_TIMEWAIT_LEN (60*HZ) /* how long to wait to destroy TIME-WAIT
* state, about 60 seconds */
#define TCP_FIN_TIMEOUT TCP_TIMEWAIT_LEN
--
1.6.3.3
^ permalink raw reply related
* [PATCH 2/3] net: snmp: fix the wrong ICMP_MIB_MAX value
From: Shan Wei @ 2010-11-29 6:53 UTC (permalink / raw)
To: David Miller; +Cc: Network-Maillist, Shan Wei
__ICMP_MIB_MAX is equal to the total number of icmp mib,
So no need to add 1. This wastes 4/8 bytes memory.
Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
---
include/net/snmp.h | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/include/net/snmp.h b/include/net/snmp.h
index 835c587..762e2ab 100644
--- a/include/net/snmp.h
+++ b/include/net/snmp.h
@@ -60,8 +60,7 @@ struct ipstats_mib {
};
/* ICMP */
-#define ICMP_MIB_MAX (__ICMP_MIB_MAX + 1)
-
+#define ICMP_MIB_MAX __ICMP_MIB_MAX
struct icmp_mib {
unsigned long mibs[ICMP_MIB_MAX];
};
--
1.6.3.3
^ permalink raw reply related
* [PATCH 3/3] tcp: use TCP_BASE_MSS to set basic mss value
From: Shan Wei @ 2010-11-29 6:54 UTC (permalink / raw)
To: David Miller, jheffner; +Cc: Network-Maillist, Shan Wei
TCP_BASE_MSS initroduced by commit 5d424d5a is defined, but never be used.
So use it to initialise sysctl_tcp_base_mss.
commit 5d424d5a674f782d0659a3b66d951f412901faee
Author: John Heffner <jheffner@psc.edu>
Date: Mon Mar 20 17:53:41 2006 -0800
[TCP]: MTU probing
Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
---
net/ipv4/tcp_output.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index bb8f547..7f65ce6 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -55,7 +55,7 @@ int sysctl_tcp_workaround_signed_windows __read_mostly = 0;
int sysctl_tcp_tso_win_divisor __read_mostly = 3;
int sysctl_tcp_mtu_probing __read_mostly = 0;
-int sysctl_tcp_base_mss __read_mostly = 512;
+int sysctl_tcp_base_mss __read_mostly = TCP_BASE_MSS;
/* By default, RFC2861 behavior. */
int sysctl_tcp_slow_start_after_idle __read_mostly = 1;
--
1.6.3.3
^ permalink raw reply related
* Re: linux-next: build failure after merge of the net tree
From: Peppe CAVALLARO @ 2010-11-29 7:25 UTC (permalink / raw)
To: David Miller
Cc: sfr@canb.auug.org.au, netdev@vger.kernel.org,
linux-next@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <20101128.181134.104049260.davem@davemloft.net>
On 11/29/2010 3:11 AM, David Miller wrote:
>
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Mon, 29 Nov 2010 11:08:24 +1100
>
> > Hi all,
> >
> > After merging the net tree, today's linux-next build (x86_64
> allmodconfig)
> > failed like this:
> >
> > drivers/net/stmmac/stmmac_main.c: In function 'stmmac_resume':
> > drivers/net/stmmac/stmmac_main.c:1849: error: 'struct stmmac_priv'
> has no member named 'shutdown'
> >
> > Caused by commit 874bd42d24c2a74f5dbd65e81e175982240fecd8 ("stmmac:
> > convert to dev_pm_ops").
> >
>
Yes, this was my fault.
> > I have used the net tree from next-20101126 for today.
>
> I have pushed the following fix which should cure this:
>
> --------------------
> stmmac: fix stmmac_resume removing not yet used shutdown flag
>
The patch, David already applied, fixes this problem.
Peppe
> The commit to convert to use the dev_pm_ops struct
> introduces a bug. The shutdown flag is not yet used
> because the hibernation on memory is done by using
> the freeze callback.
> Thanks to Vlad for having reported it.
>
> Reported-by: Vlad Lungu <vlad.lungu@windriver.com>
> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> ---
> drivers/net/stmmac/stmmac_main.c | 7 -------
> 1 files changed, 0 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/stmmac/stmmac_main.c
> b/drivers/net/stmmac/stmmac_main.c
> index f1dbc18..730a6fd 100644
> --- a/drivers/net/stmmac/stmmac_main.c
> +++ b/drivers/net/stmmac/stmmac_main.c
> @@ -1846,13 +1846,6 @@ static int stmmac_resume(struct device *dev)
> if (!netif_running(ndev))
> return 0;
>
> - if (priv->shutdown) {
> - /* Re-open the interface and re-init the MAC/DMA
> - and the rings (i.e. on hibernation stage) */
> - stmmac_open(dev);
> - return 0;
> - }
> -
> spin_lock(&priv->lock);
>
> /* Power Down bit, into the PM register, is cleared
> --
> 1.7.3.2
>
^ permalink raw reply
* [PATCH net-next-2.6] xps: add __rcu annotations
From: Eric Dumazet @ 2010-11-29 7:43 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Tom Herbert
Avoid sparse warnings : add __rcu annotations and use
rcu_dereference_protected() where necessary.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Tom Herbert <therbert@google.com>
---
include/linux/netdevice.h | 4 ++--
net/core/net-sysfs.c | 24 +++++++++++++++---------
2 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 9ae4544..4b0c7f3 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -622,7 +622,7 @@ struct xps_map {
*/
struct xps_dev_maps {
struct rcu_head rcu;
- struct xps_map *cpu_map[0];
+ struct xps_map __rcu *cpu_map[0];
};
#define XPS_DEV_MAPS_SIZE (sizeof(struct xps_dev_maps) + \
(nr_cpu_ids * sizeof(struct xps_map *)))
@@ -1049,7 +1049,7 @@ struct net_device {
spinlock_t tx_global_lock;
#ifdef CONFIG_XPS
- struct xps_dev_maps *xps_maps;
+ struct xps_dev_maps __rcu *xps_maps;
#endif
/* These may be needed for future network-power-down code. */
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 99c1129..3ba2103 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -899,6 +899,8 @@ static void xps_dev_maps_release(struct rcu_head *rcu)
}
static DEFINE_MUTEX(xps_map_mutex);
+#define xmap_dereference(P) \
+ rcu_dereference_protected((P), lockdep_is_held(&xps_map_mutex))
static ssize_t store_xps_map(struct netdev_queue *queue,
struct netdev_queue_attribute *attribute,
@@ -935,11 +937,12 @@ static ssize_t store_xps_map(struct netdev_queue *queue,
mutex_lock(&xps_map_mutex);
- dev_maps = dev->xps_maps;
+ dev_maps = xmap_dereference(dev->xps_maps);
for_each_possible_cpu(cpu) {
- new_map = map = dev_maps ? dev_maps->cpu_map[cpu] : NULL;
-
+ map = dev_maps ?
+ xmap_dereference(dev_maps->cpu_map[cpu]) : NULL;
+ new_map = map;
if (map) {
for (pos = 0; pos < map->len; pos++)
if (map->queues[pos] == index)
@@ -974,13 +977,14 @@ static ssize_t store_xps_map(struct netdev_queue *queue,
else
new_map = NULL;
}
- new_dev_maps->cpu_map[cpu] = new_map;
+ RCU_INIT_POINTER(new_dev_maps->cpu_map[cpu], new_map);
}
/* Cleanup old maps */
for_each_possible_cpu(cpu) {
- map = dev_maps ? dev_maps->cpu_map[cpu] : NULL;
- if (map && new_dev_maps->cpu_map[cpu] != map)
+ map = dev_maps ?
+ xmap_dereference(dev_maps->cpu_map[cpu]) : NULL;
+ if (map && xmap_dereference(new_dev_maps->cpu_map[cpu]) != map)
call_rcu(&map->rcu, xps_map_release);
if (new_dev_maps->cpu_map[cpu])
nonempty = 1;
@@ -1006,7 +1010,9 @@ error:
if (new_dev_maps)
for_each_possible_cpu(i)
- kfree(new_dev_maps->cpu_map[i]);
+ kfree(rcu_dereference_protected(
+ new_dev_maps->cpu_map[i],
+ 1));
kfree(new_dev_maps);
free_cpumask_var(mask);
return -ENOMEM;
@@ -1032,11 +1038,11 @@ static void netdev_queue_release(struct kobject *kobj)
index = get_netdev_queue_index(queue);
mutex_lock(&xps_map_mutex);
- dev_maps = dev->xps_maps;
+ dev_maps = xmap_dereference(dev->xps_maps);
if (dev_maps) {
for_each_possible_cpu(i) {
- map = dev_maps->cpu_map[i];
+ map = xmap_dereference(dev_maps->cpu_map[i]);
if (!map)
continue;
^ permalink raw reply related
* Re: [PATCH 1/3] net: kill unused macros in head file
From: YOSHIFUJI Hideaki @ 2010-11-29 7:42 UTC (permalink / raw)
To: Shan Wei
Cc: David Miller, Network-Maillist, kuznet, pekkas, jmorris,
Patrick McHardy, yoshfuji
In-Reply-To: <4CF34DEC.6090907@cn.fujitsu.com>
2010-11-29 14:53 +0800, Shan Wei wrote:
> These macros have been defined for several years since v2.6.12-rc2(tracing by git),
> but never be used. So remove them.
>
>
> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
> ---
> include/net/addrconf.h | 2 --
> include/net/ip6_route.h | 1 -
> include/net/ndisc.h | 6 ------
> include/net/snmp.h | 1 -
> include/net/sock.h | 3 ---
> include/net/tcp.h | 6 ------
> 6 files changed, 0 insertions(+), 19 deletions(-)
>
> diff --git a/include/net/addrconf.h b/include/net/addrconf.h
> index a944124..23710aa 100644
> --- a/include/net/addrconf.h
> +++ b/include/net/addrconf.h
> @@ -1,8 +1,6 @@
> #ifndef _ADDRCONF_H
> #define _ADDRCONF_H
>
> -#define RETRANS_TIMER HZ
> -
> #define MAX_RTR_SOLICITATIONS 3
> #define RTR_SOLICITATION_INTERVAL (4*HZ)
>
I think we should use it in net/ipv6/addrconf.c,
instead of magic number.
> diff --git a/include/net/ndisc.h b/include/net/ndisc.h
> index 895997b..f134987 100644
> --- a/include/net/ndisc.h
> +++ b/include/net/ndisc.h
> @@ -39,12 +39,6 @@ enum {
>
> #define MAX_RTR_SOLICITATION_DELAY HZ
>
> -#define ND_REACHABLE_TIME (30*HZ)
> -#define ND_RETRANS_TIMER HZ
ditto (in net/ipv6/ndisc.c)
--yoshfuji
^ permalink raw reply
* RE: linux-next: Tree for November 26
From: Shreyas Bhatewara @ 2010-11-29 8:03 UTC (permalink / raw)
To: Zimny Lech, Stephen Rothwell
Cc: linux-next@vger.kernel.org, LKML, VMware, Inc.,
netdev@vger.kernel.org, Scott Goldman
In-Reply-To: <AANLkTinJUT=j_P9FSB=GWTLy4Bkr68iWmB2O=5Q3gcT-@mail.gmail.com>
Thanks for reporting.
Thanks to Scott, the fix went in net-next tree, commit number : e9248fbd6b6f7ef1917bfffe998654e40dfb4cfd
->Shreyas
________________________________________
From: Zimny Lech [napohybelskurwysynom2010@gmail.com]
Sent: Saturday, November 27, 2010 12:38 AM
To: Stephen Rothwell
Cc: linux-next@vger.kernel.org; LKML; Shreyas Bhatewara; VMware, Inc.; netdev@vger.kernel.org
Subject: Re: linux-next: Tree for November 26
Ave
2010/11/26 Stephen Rothwell <sfr@canb.auug.org.au>:
> Hi all,
>
> Changes since 20101125:
CC drivers/net/vmxnet3/vmxnet3_drv.o
CC drivers/net/vmxnet3/vmxnet3_ethtool.o
/home/test/linux-2.6/drivers/net/vmxnet3/vmxnet3_ethtool.c: In
function 'vmxnet3_get_rss_indir':
/home/test/linux-2.6/drivers/net/vmxnet3/vmxnet3_ethtool.c:562:40:
error: 'struct vmxnet3_adapter' has no member named 'rss_conf'
/home/test/linux-2.6/drivers/net/vmxnet3/vmxnet3_ethtool.c: In
function 'vmxnet3_set_rss_indir':
/home/test/linux-2.6/drivers/net/vmxnet3/vmxnet3_ethtool.c:578:40:
error: 'struct vmxnet3_adapter' has no member named 'rss_conf'
make[4]: *** [drivers/net/vmxnet3/vmxnet3_ethtool.o] Error 1
make[3]: *** [drivers/net/vmxnet3] Error 2
make[2]: *** [drivers/net] Error 2
make[1]: *** [drivers] Error 2
make: *** [sub-make] Error 2
^ permalink raw reply
* Re: [PATCH] vhost: fix typos in comment
From: Michael S. Tsirkin @ 2010-11-29 8:05 UTC (permalink / raw)
To: Jason Wang; +Cc: virtualization, netdev, linux-kernel, kvm
In-Reply-To: <20101129054840.24951.29849.stgit@dhcp-91-7.nay.redhat.com.englab.nay.redhat.com>
On Mon, Nov 29, 2010 at 01:48:40PM +0800, Jason Wang wrote:
> Signed-off-by: Jason Wang <jasowang@redhat.com>
Applied, thanks.
> ---
> drivers/vhost/net.c | 2 +-
> drivers/vhost/vhost.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
> index d10da28..14fc189 100644
> --- a/drivers/vhost/net.c
> +++ b/drivers/vhost/net.c
> @@ -452,7 +452,7 @@ static void handle_rx_mergeable(struct vhost_net *net)
> move_iovec_hdr(vq->iov, vq->hdr, vhost_hlen, in);
> else
> /* Copy the header for use in VIRTIO_NET_F_MRG_RXBUF:
> - * needed because sendmsg can modify msg_iov. */
> + * needed because recvmsg can modify msg_iov. */
> copy_iovec_hdr(vq->iov, vq->hdr, sock_hlen, in);
> msg.msg_iovlen = in;
> err = sock->ops->recvmsg(NULL, sock, &msg,
> diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h
> index 073d06a..2af44b7 100644
> --- a/drivers/vhost/vhost.h
> +++ b/drivers/vhost/vhost.h
> @@ -102,7 +102,7 @@ struct vhost_virtqueue {
> * flush the vhost_work instead of synchronize_rcu. Therefore readers do
> * not need to call rcu_read_lock/rcu_read_unlock: the beginning of
> * vhost_work execution acts instead of rcu_read_lock() and the end of
> - * vhost_work execution acts instead of rcu_read_lock().
> + * vhost_work execution acts instead of rcu_read_unlock().
> * Writers use virtqueue mutex. */
> void __rcu *private_data;
> /* Log write descriptors */
^ permalink raw reply
* Re: [PATCH] vhost: correctly set bits of dirty pages
From: Michael S. Tsirkin @ 2010-11-29 8:18 UTC (permalink / raw)
To: Jason Wang; +Cc: virtualization, netdev, linux-kernel, kvm
In-Reply-To: <20101129054819.24923.26439.stgit@dhcp-91-7.nay.redhat.com.englab.nay.redhat.com>
On Mon, Nov 29, 2010 at 01:48:20PM +0800, Jason Wang wrote:
> When counting pages we should increase it by 1 instead of VHOST_PAGE_SIZE,
> and also make log_write() can correctly process the request across
> pages with write_address not start at page boundary.
>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
Thanks, good catch!
But let's to it in small steps: first, a small patch to fix the bug:
I think this is equivalent, right?
Subject: vhost: correctly set bits of dirty pages
When counting pages we should increase address by 1 instead of
VHOST_PAGE_SIZE, and also make log_write() can correctly process the
request across pages with write_address not starting at page boundary.
Reported-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 568eb70..d0a3552 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -887,6 +887,7 @@ static int log_write(void __user *log_base,
int r;
if (!write_length)
return 0;
+ write_length += write_address % VHOST_PAGE_SIZE;
write_address /= VHOST_PAGE_SIZE;
for (;;) {
u64 base = (u64)(unsigned long)log_base;
@@ -900,7 +901,7 @@ static int log_write(void __user *log_base,
if (write_length <= VHOST_PAGE_SIZE)
break;
write_length -= VHOST_PAGE_SIZE;
- write_address += VHOST_PAGE_SIZE;
+ write_address += 1;
}
return r;
}
^ permalink raw reply related
* Re: [PATCH 1/3] net: kill unused macros in head file
From: Shan Wei @ 2010-11-29 8:21 UTC (permalink / raw)
To: YOSHIFUJI Hideaki
Cc: David Miller, Network-Maillist, kuznet, pekkas, jmorris,
Patrick McHardy
In-Reply-To: <1291016563.7802.2.camel@takos>
Hi yoshifuji-san:
YOSHIFUJI Hideaki wrote, at 11/29/2010 03:42 PM:
>>
>> -#define RETRANS_TIMER HZ
>> -
>> #define MAX_RTR_SOLICITATIONS 3
>> #define RTR_SOLICITATION_INTERVAL (4*HZ)
>>
>
> I think we should use it in net/ipv6/addrconf.c,
> instead of magic number.
Do you mean to replace all HZ in net/ipv6/addrconf.c with RETRANS_TIMER?
HZ is also a macro. And I think HZ is more easier to read than RETRANS_TIMER.
--
Best Regards
-----
Shan Wei
^ permalink raw reply
* Re: [PATCH] vhost: correctly set bits of dirty pages
From: Michael S. Tsirkin @ 2010-11-29 8:25 UTC (permalink / raw)
To: Jason Wang; +Cc: virtualization, netdev, linux-kernel, kvm
In-Reply-To: <20101129081840.GB25496@redhat.com>
On Mon, Nov 29, 2010 at 10:18:40AM +0200, Michael S. Tsirkin wrote:
> On Mon, Nov 29, 2010 at 01:48:20PM +0800, Jason Wang wrote:
> > When counting pages we should increase it by 1 instead of VHOST_PAGE_SIZE,
> > and also make log_write() can correctly process the request across
> > pages with write_address not start at page boundary.
> >
> > Signed-off-by: Jason Wang <jasowang@redhat.com>
>
>
> Thanks, good catch!
> But let's to it in small steps: first, a small patch to fix the bug:
> I think this is equivalent, right?
>
> Subject: vhost: correctly set bits of dirty pages
>
> When counting pages we should increase address by 1 instead of
> VHOST_PAGE_SIZE, and also make log_write() can correctly process the
> request across pages with write_address not starting at page boundary.
>
> Reported-by: Jason Wang <jasowang@redhat.com>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
And then this on top:
vhost: better variable name in logging
We really store a page offset in write_address,
so rename it write_page to avoid confusion.
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index d0a3552..1a3d3ed 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -884,15 +884,15 @@ static int set_bit_to_user(int nr, void __user *addr)
static int log_write(void __user *log_base,
u64 write_address, u64 write_length)
{
+ u64 write_page = write_address / VHOST_PAGE_SIZE
int r;
if (!write_length)
return 0;
write_length += write_address % VHOST_PAGE_SIZE;
- write_address /= VHOST_PAGE_SIZE;
for (;;) {
u64 base = (u64)(unsigned long)log_base;
- u64 log = base + write_address / 8;
- int bit = write_address % 8;
+ u64 log = base + write_page / 8;
+ int bit = write_page % 8;
if ((u64)(unsigned long)log != log)
return -EFAULT;
r = set_bit_to_user(bit, (void __user *)(unsigned long)log);
@@ -901,7 +901,7 @@ static int log_write(void __user *log_base,
if (write_length <= VHOST_PAGE_SIZE)
break;
write_length -= VHOST_PAGE_SIZE;
- write_address += 1;
+ write_page += 1;
}
return r;
}
^ permalink raw reply related
* Re: [PATCH] kthread: NUMA aware kthread_create_on_cpu()
From: Américo Wang @ 2010-11-29 9:03 UTC (permalink / raw)
To: Andi Kleen
Cc: Eric Dumazet, Andrew Morton, linux-kernel, netdev, David Miller,
Tejun Heo, Rusty Russell
In-Reply-To: <20101128230146.GB12300@basil.fritz.box>
On Mon, Nov 29, 2010 at 12:01:47AM +0100, Andi Kleen wrote:
>
>task_struct is always allocated from slab.
>
IA64 is an exception, it has its own alloc_task_struct()
which is simply __get_free_pages().
^ 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