* [U-Boot] Nokia Notification
From: Nokia Anniversary @ 2011-10-24 12:32 UTC (permalink / raw)
To: u-boot
--
--
In celebration of nokia 146th Year Anniversary we wished to inform you
that
your E-mail have won a prize Amount of Seven Hundred And Fifty
Thousand,
Great Britain Pounds Sterling £750,000.00 on our 146th year
Anniversary.
Thus, all legal documentations for the remittance of your prize amount
has been processed successfully and send to courier for immediate
delivery
to your residence, kindly contact Fastway Courier Company who has been
authorized and given the mandate to administer and deliver your prize.
Fill details below to process your immediate delivery.
Prize Claims Detials: Full Name: Address: Age: Mobile Number:
Sex/Gender: Winning Email ID: Occupation: Country: Nationality:
CONTACT FASTWAY COURIER COMPANY.
Mr. Nelson Brown Dispatch Manager
Tell: +447017606046
E-mail: ccunit011 at hotmail.co.uk
On behalf of the entire staff of Nokia Mobile Company We
congratulateyou on this note.
Best Wishes!!,
Miss. Amanda O'Brian
^ permalink raw reply
* Re: A question on IOCTL interface for MMC
From: Shashidhar Hiremath @ 2011-10-24 12:32 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: Chris Ball, J Freyensee, John Calixto, linux-mmc
In-Reply-To: <5263525.D4yqBTjgWh@wuerfel>
Hi Arnd,
As explained in previous mail, the IOCTL is actually an inteface to
block layer and it is only expecting read/write commands to be sent
through the interface.The prrof of it can be seen in write_flag
present in the IOCTL structure which indicates the either the command
can be read or a write command.
So, can I submit a linux module to the kernel which uses the same
mmc_ioc_cmd structure and do all the required processing in my module.
To be clear on my requirement:
it is To test ALL SD/MMC Commands and NOT just the Read/Write Commands.
or should I extend the mmc_test module present in kernel to support
testing of individual commands as well ?
Can I get some suggestions on what approach to take ?
On Thu, Oct 20, 2011 at 12:48 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Thursday 20 October 2011 10:39:00 Shashidhar Hiremath wrote:
> > I am planning to use the existing IOCTL interface for SD/MMC present
> > in the kernel.
> > Since, the IOCTL interface expects a read/write flag , and the MMC
> > IOCTL is actually an interface to block layer I feel without modifying
> > the block layer for the support of non-read write commands ,I may not
> > be able to test the non-read/write commands through the IOCTL
> > interface .
> > Is there a way of doing this without modifying block layer ?
>
> Hi Shashidhar,
>
> I think there is actually no problem here at all. The block layer simply
> passes the ioctl command number and argument to the driver, which can
> do anything with it.
>
> What functionality are you actually looking for?
>
> Arnd
--
regards,
Shashidhar Hiremath
^ permalink raw reply
* Re: [PATCH] sparse, llvm: Fix 'void *' pointer code generation
From: Pekka Enberg @ 2011-10-24 12:33 UTC (permalink / raw)
To: Jonathan Neuschäfer
Cc: Linus Torvalds, Pekka Enberg, linux-sparse, Christopher Li,
Jeff Garzik
In-Reply-To: <20111024121426.GA2021@debian.debian>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1939 bytes --]
> On Mon, Oct 24, 2011 at 02:56:41PM +0300, Pekka Enberg wrote:
>> Fix the issue by switching to LLVMIntType(bits_per_pointer) in
>> sym_basetype_type().
On Mon, 24 Oct 2011, Jonathan Neuschäfer wrote:
> You didn't update the commit message.
Thanks for pointing that out. Jeff, does this look OK?
Pekka
From e6981551345b7284f6995556398b3564d02afc42 Mon Sep 17 00:00:00 2001
From: Pekka Enberg <penberg@kernel.org>
Date: Mon, 24 Oct 2011 14:11:13 +0300
Subject: [PATCH] sparse, llvm: Fix 'void *' pointer code generation
Sparse front-end generates SYM_PTR with SYM_BASETYPE with bit_size set to -1
for "void *" pointers. We currently map that to LLVMVoidType() but that no
longer works with LLVM Subversion trunk:
$ ./sparse-llvm validation/backend/struct.c
sparse-llvm: Type.cpp:676: static llvm::PointerType* llvm::PointerType::get(llvm::Type*, unsigned int): Assertion `isValidElementType(EltTy) && "Invalid type for pointer element!"' failed.
Aborted
Fix the issue by treating 'void *' as 'char *' as suggested by Linus:
On Mon, 24 Oct 2011, Linus Torvalds wrote:
> Why bits_per_pointer? Isn't this the "base type" of void *? A more
> logical choice would seem to be to make it equivalent to "char *", and
> just make it fall through to the "case 8" case?
Cc: Christopher Li <sparse@chrisli.org>
Cc: Jeff Garzik <jgarzik@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
---
sparse-llvm.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/sparse-llvm.c b/sparse-llvm.c
index a85dfea..fc0c2e9 100644
--- a/sparse-llvm.c
+++ b/sparse-llvm.c
@@ -79,9 +79,7 @@ static LLVMTypeRef sym_basetype_type(struct symbol *sym)
}
} else {
switch (sym->bit_size) {
- case -1:
- ret = LLVMVoidType();
- break;
+ case -1: /* 'void *' is treated like 'char *' */
case 8:
ret = LLVMInt8Type();
break;
--
1.7.6.4
^ permalink raw reply related
* [U-Boot] [RFC] [PATCH 00/39] Rework of the debug() macro
From: Marek Vasut @ 2011-10-24 12:33 UTC (permalink / raw)
To: u-boot
In-Reply-To: <m2ehy2mwt1.fsf@ohwell.denx.de>
> Hi Marek,
Hi Detlev,
>
> [...]
>
> > I certainly see your point. Btw. do you feel like help reviewing the PPC
> > portion of the patches? That'd be greatly appreciated as I'm not a PPC
> > expert. I wanted to avoid resubmission, so I only pushed the new set to
> > git://git.denx.de/u-boot- marex.git / debug branch. There is over 50
> > patches now.
>
> I fear that we have the possibility to loose efforts in communicating
> our distrubuted efforts here. If want to ack only a subset of the
> patches only available on a git tree, I don't know how to give my
> "Acked-By" through the patchwork magic and _not_ add even more work on
> your shoulders. On the other hand, the majority of fixes are printf
> fixes, so if the compiler does not complain on a MAKEALL any more, I
> don't see what other aspect I can evaluate on a "dry review".
More like a superset actually.
>
> Effectively I was hoping that your large patch set stabilizes and
> produces no more warnings on a MAKEALL - in this case you have my
>
> Acked-by: Detlev Zundel <dzu@denx.de>
There are a few patches that are not only printf() format patches. And even
those printf() format patches deserve proper review.
Cheers
^ permalink raw reply
* Re: [PATCH tip/core/rcu 54/55] rcu: Make srcu_read_lock_held() call common lockdep-enabled function
From: Paul E. McKenney @ 2011-10-24 12:34 UTC (permalink / raw)
To: Josh Triplett
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, Valdis.Kletnieks, dhowells,
eric.dumazet, darren, patches
In-Reply-To: <20111017020309.GI19421@leaf>
On Sun, Oct 16, 2011 at 07:03:10PM -0700, Josh Triplett wrote:
> On Tue, Sep 06, 2011 at 11:00:48AM -0700, Paul E. McKenney wrote:
> > A common debug_lockdep_rcu_enabled() function is used to check whether
> > RCU lockdep splats should be reported, but srcu_read_lock() does not
> > use it. This commit therefore brings srcu_read_lock_held() up to date.
>
> Should this patch go before 53, or merge into 53, to prevent the issues
> you describe from occuring in a tree which has 53 applied but not 54?
It is OK as is because the SRCU code does something reasonably sane
as is. This is more about code cleanliness than about functionality.
Thanx, Paul
^ permalink raw reply
* [drm:radeon_dp_i2c_aux_ch] *ERROR* aux i2c too many retries, giving up
From: Andrew Benton @ 2011-10-24 12:35 UTC (permalink / raw)
To: Linux Kernel mailing list
Hello
When I boot up my computer with a 3.1 kernel I get a scary error
message just bellow the penguins:
[drm:radeon_dp_i2c_aux_ch] *ERROR* aux i2c too many retries, giving up
On a dual core it's printed twice, on a quad core it's printed 4 times.
I compile my kernels without modules and with the Radeon firmware
compiled into the kernel. As far as I can see the computers are working
perfectly but I'd like to understand this error message. It seems a bit
strange that it's printed to the screen even if I boot the kernel with
the quiet command line option. If someone could tell me what the error
message means I would be grateful (please CC me as I'm not subscribed).
I emailed this list asking about this last Wednesday but got no replies
so I've had to simply fall back on removing this kernel "feature":
sed -i 's#\tDRM_ERROR("aux i2c#//&#' \
drivers/gpu/drm/radeon/atombios_dp.c
This makes the error message go away but it's not ideal, I'd rather
understand what it means.
Andy
^ permalink raw reply
* Kdump/kexec for mpc83xx
From: radha krishna @ 2011-10-24 12:35 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 273 bytes --]
Hi Team,
I am using Linux-3.0 on mpc8379 RDB. I have downloaded kexec-tools-2.0.2
package from open source and cross compiled for ppc_6xx.
But, the kexec is not booting with kernel loaded with "kexec -l".
If one of you already tried, please help me ...
Regards,
RamAmru
[-- Attachment #2: Type: text/html, Size: 316 bytes --]
^ permalink raw reply
* Re: how stable are snapshots at the block level?
From: Stephane CHAZELAS @ 2011-10-24 12:36 UTC (permalink / raw)
To: linux-btrfs
In-Reply-To: <CAKvOHKCjxxKTahivOuRBPBB89JBrTwndQ6cCEuFaPbJr8PYtpA@mail.gmail.com>
2011-10-23, 17:19(+02), Mathijs Kwik:
[...]
> For this case (my laptop) I can stick to file-based rsync, but I think
> some guarantees should exist at the block level. Many virtual machines
> and cloud hosting services (like ec2) provide block-level snapshots.
> With xfs, I can freeze the filesystem for a short amount of time
> (<100ms), snapshot, unfreeze. I don't think such a lock/freeze feature
> exists for btrfs
[...]
That FS-freeze feature has been moved to the vfs layer so is
available to any filesystem now.
You can either use xfs_io (see -F option to "freeze" for foreign
FS) like for xfs FS or use fsfreeze from util-linux.
Note that you can thaw file systems with a sysrq combination
now. (for instance with xen using "xm sysrq vm j").
For block level snapshots, see also ddsnap (device mapper target
unfortunately no longer maintained) and lvm of course (but
doesn't scale well with several snapshots).
--
Stephane
^ permalink raw reply
* Re: [PATCH tip/core/rcu 0/55] Preview of RCU changes for 3.2
From: Paul E. McKenney @ 2011-10-24 12:35 UTC (permalink / raw)
To: Josh Triplett
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, Valdis.Kletnieks, dhowells,
eric.dumazet, darren, patches
In-Reply-To: <20111017020613.GJ19421@leaf>
On Sun, Oct 16, 2011 at 07:06:13PM -0700, Josh Triplett wrote:
> On Tue, Sep 06, 2011 at 11:00:15AM -0700, Paul E. McKenney wrote:
> > Hello!
> >
> > This patchset adds RCU event tracing, improved diagnostics and
> > documentation, and fixes a number of bugs, including several from an
> > ongoing top-to-bottom inspection of RCU. The patches are as follows:
> >
> > 1. Place per-CPU kthreads' stack and task struct on the corresponding
> > node on NUMA systems (courtesy of Eric Dumazet).
> > 2. Avoid unnecessary self-wakeups for per-CPU kthreads
> > (courtesy of Shaohua Li).
> > 3,6,10,12,25,28,33.
> > Documentations updates (some courtesy Wanlong Gao).
> > 4. Add replacement checks for blocking within an RCU read-side
> > critical section.
> > 5. Header-file untangling part 1 of N: move rcu_head to types.h.
> > 7. Fix mismatched variable declaration (courtesy of Andi Kleen).
> > 8. Abstract out common grace-period-primitive code.
> > 9. Update rcutorture to test newish RCU API members.
> > 11. Drive RCU algorithm selection directly from SMP and PREEMPT.
> > 13. Make rcu_torture_boost() wait for callbacks before telling
> > debug-objects that they are done.
> > 14-17,20,22.
> > Add event tracing for RCU.
> > 18. Update comments to reflect kthreads being used only when
> > RCU priority boosting is enabled.
> > 19. Move RCU_BOOSt data declarations to alow compiler to detect
> > mismatches.
> > 20. Make TINY_RCU use softirqs for RCU_BOOST=n.
> > 23. Simplify quiescent-state accounting.
> > 24. Stop passing rcu_read_lock_held() to rcu_dereference_protected()
> > (courtesy of Michal Hocko).
> > 26. Remove unused and redundant RCU API members.
> > 27. Allow rcutorture's stat_interval parameter to be changed at runtime
> > to make it easier to test RCU in guest OSes.
> > 28. Removed unused nohz_cpu_mask (courtesy of Alex Shi).
> > 30. Eliminate in_irq() checks in rcu_enter_nohz().
> > 31. Fix rcu_implicit_dynticks_qs() local-variable size mismatches.
> > 32. Make rcu_assign_pointer() unconditionally emit memory barrier
> > to silence new gcc warnings (courtesy of Eric Dumazet).
> > 34. Move __rcu_read_lock()'s barrier within if-statement.
> > 35. Dump local stack for CPU stall warnings if cannot dump all stacks.
> > 36. Prevent early-boot set_need_resched() from __rcu_pending().
> > 37. Simplify unboosting checks.
> > 38. Prohibit RCU grace periods during early boot.
> > 39. Suppress NMI backtraces when CPU stall ends before dump.
> > 40. Avoid just-online CPU needlessly rescheding itself.
> > 41. Permit rt_mutex_unlock() with irqs disabled.
> > 42-43. Prevent end-of-test rcutorture hangs.
> > 44. Wire up RCU_BOOST_PRIO, use conventional kthread naming scheme
> > (courtesy of Mike Galbraith).
> > 45. Check for entering dyntick-idle in RCU read-side critical section.
> > 46. Adjust RCU_FAST_NO_HZ to avoid false quiescent states.
> > 47. Avoid concurrent end of old GP with start of new GP.
> > 48. Strengthen powerpc value-returning atomic memory ordering.
> > 49-51. Detect illegal RCU use from dyntick-idle mode (courtesy of
> > Frederic Weisbecker).
> > 52. Remove an unnecessary layer of abstraction from PROVE_RCU checking.
> > 53. Detect illegal SRCU use from dyntick-idle mode.
> > 54. Make SRCU use common lockdep-splat code.
> > 55. Placeholder patch that disables illegal tracing from dyntick-idle
> > mode (illegal because tracing uses RCU).
>
> I responded to a few of the patches with comments and potential issues.
> I also don't consider myself qualified to review patch 48/55, "powerpc:
> strengthen value-returning-atomics memory barriers". For the rest:
>
> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Thank you very much for your review and comments!!!
Thanx, Paul
^ permalink raw reply
* RE: [PATCHv4] DMAEngine: Define interleaved transfer request api
From: Bounine, Alexandre @ 2011-10-24 12:36 UTC (permalink / raw)
To: Vinod Koul
Cc: Jassi Brar, Russell King, Williams, Dan J, Barry Song,
linux-kernel, DL-SHA-WorkGroupLinux, Dave Jiang
In-Reply-To: <1319428149.9355.60.camel@vkoul-udesk3>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 2133 bytes --]
On Sun, Oct 23, 2011 at 11:49 PM, Vinod Koul <vinod.koul@intel.com> wrote:
>
> On Tue, 2011-10-18 at 10:57 -0700, Bounine, Alexandre wrote:
>
> > I would like to put a simple example of RIO based system that may
> help to
> > understand our DMA requirements.
> >
> > Consider a platform with one host CPU and several DSP cards connected
> > to it through a switched backplane (transparent for purpose of this
> example).
> >
> > The host CPU has one or more RIO-capable DMA channel and runs device
> > drivers for connected DSP cards. Each device driver is required to
> load
> > an individual program code into corresponding DSP(s). Directly
> addressed
> > writes have a lot of sense.
> >
> > After DSP code is loaded device drivers start DSP program and may
> > participate in data transfers between DSP cards and host CPU. Again
> > messaging type transfers may add unnecessary overhead here compared
> > to direct data reads/writes.
> >
> > Configuration of each DSP card may be different but from host's
> > POV is RIO spec compliant.
>
> I think we all agree that this fits the dma_slave case :)
>
> As for changing in dmaengine to u64, if we are thinking this as slave
> usage, then ideally we should not make assumption of the address type
> of
> peripheral so we should only move the dma_slave_config address fields
> to
> u64, if that helps in RIO case. Moving other usages would be insane.
>
> At this point we have two proposals
> a) to make RIO exceptional case and add RIO specific stuff.
> b) make dmaengine transparent and add additional argument
> in .device_prep_slave_sg() callback which is subsystem dependent.
> Current dmacs and those who don't need it will ignore it.
>
> ATM, I am leaning towards the latter, for the main reason to keep
> dmaengine away from subsystem details.
>
Both proposals will work for RapidIO but second option looks more
universal and may be used by another subsystem in the future.
My vote goes to the option b).
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply
* Re: [RFC] mac80211: Fix STA supported rate configuration with dummy entry
From: Arik Nemtsov @ 2011-10-24 12:37 UTC (permalink / raw)
To: Jouni Malinen; +Cc: Johannes Berg, Felix Fietkau, linux-wireless
In-Reply-To: <20111024121559.GA4821@jm.kir.nu>
On Mon, Oct 24, 2011 at 14:15, Jouni Malinen <j@w1.fi> wrote:
> On Mon, Oct 24, 2011 at 01:59:45PM +0200, Arik Nemtsov wrote:
>> Note that the sta-rates are not really required before second addition
>> (which also sets them). Initially the STA is not authorized for direct
>> Tx (as determined by the WLAN_STA_TDLS_PEER_AUTH bit).
>> We don't expect direct frames during link setup.
>
> OK.. Though, there can still be some direct frames like TDLS Discovery
> Response.
You have a point there - this one is not related to link setup. At
this point we really have no idea about peer supported rates (and no
STA entry).
I just tested this with hwsim and it seems to work. The rate chosen is
the the smallest non-basic rate (haven't looked at why that happens).
With cards that use HW rate control (like wl12xx), this will of course
be implementation defined.
>
>> The STA is added to let us know we should drop all non-setup packets
>> between TDLS peers currently in link setup. We could have used a
>> different indication, but the STA entry is make the most sense here
>> since it is automatically cleaned up when we are disconnected from the
>> AP (as all TDLS state should be).
>
> When you say "drop", I hope you mean "buffer for later delivery" and
> when you say "non-setup packets", I hope you mean "non-setup Data
> frames" ;-).
No I mean "drop". Initially a buffer was planned, but in reality the
setup process is extremely fast. I setup iperf between two regular
stations (about 15mb/s) and proceeded to setup TDLS. I managed to lose
only about 3-4 frames each time.
Of course there may be anomalies (bad link quality etc.), but IMHO for
real-world situations the extra complexity of a buffering mechanism is
not warranted. Also higher level protocols (like TCP) will generally
make up for any loss.
I'll change the second one to "non-setup Data frames" :)
>
>> How about this one instead (tested hwsim with it):
>> Subject: [RFC] mac80211: init rate-control for TDLS sta when supp-rates are
>> known
>>
>> Initialize rate control algorithms only when supported rates are known
>> for a TDLS peer sta. Direct Tx between peers is not allowed before the
>> link is enabled. In turn, this only occurs after a change_station()
>> call that sets supported rates.
>
> I guess this could be fine, too, assuming TDLS is the only use case for
> this type of changing of STA supported rates.
Currently it is - we even check this explicitly higher up in
nl80211_set_station().
Arik
^ permalink raw reply
* [PATCH] ath9k_hw: Update AR9485 initvals to fix system hang issue
From: Rajkumar Manoharan @ 2011-10-24 12:43 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, Rajkumar Manoharan, stable
This patch fixes system hang when resuming from S3 state
and lower rate sens failure issue.
Cc: stable@kernel.org
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath9k/ar9485_initvals.h | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/ar9485_initvals.h b/drivers/net/wireless/ath/ath9k/ar9485_initvals.h
index 611ea6c..d16d029 100644
--- a/drivers/net/wireless/ath/ath9k/ar9485_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar9485_initvals.h
@@ -521,7 +521,7 @@ static const u32 ar9485_1_1_radio_postamble[][2] = {
{0x000160ac, 0x24611800},
{0x000160b0, 0x03284f3e},
{0x0001610c, 0x00170000},
- {0x00016140, 0x10804008},
+ {0x00016140, 0x50804008},
};
static const u32 ar9485_1_1_mac_postamble[][5] = {
@@ -603,7 +603,7 @@ static const u32 ar9485_1_1_radio_core[][2] = {
static const u32 ar9485_1_1_pcie_phy_pll_on_clkreq_enable_L1[][2] = {
/* Addr allmodes */
- {0x00018c00, 0x10052e5e},
+ {0x00018c00, 0x18052e5e},
{0x00018c04, 0x000801d8},
{0x00018c08, 0x0000080c},
};
@@ -776,7 +776,7 @@ static const u32 ar9485_modes_green_ob_db_tx_gain_1_1[][5] = {
static const u32 ar9485_1_1_pcie_phy_clkreq_disable_L1[][2] = {
/* Addr allmodes */
- {0x00018c00, 0x10013e5e},
+ {0x00018c00, 0x18013e5e},
{0x00018c04, 0x000801d8},
{0x00018c08, 0x0000080c},
};
@@ -882,7 +882,7 @@ static const u32 ar9485_fast_clock_1_1_baseband_postamble[][3] = {
static const u32 ar9485_1_1_pcie_phy_pll_on_clkreq_disable_L1[][2] = {
/* Addr allmodes */
- {0x00018c00, 0x10012e5e},
+ {0x00018c00, 0x18012e5e},
{0x00018c04, 0x000801d8},
{0x00018c08, 0x0000080c},
};
@@ -1021,7 +1021,7 @@ static const u32 ar9485_common_rx_gain_1_1[][2] = {
static const u32 ar9485_1_1_pcie_phy_clkreq_enable_L1[][2] = {
/* Addr allmodes */
- {0x00018c00, 0x10053e5e},
+ {0x00018c00, 0x18053e5e},
{0x00018c04, 0x000801d8},
{0x00018c08, 0x0000080c},
};
--
1.7.7
^ permalink raw reply related
* Re: [RFC][PATCH] KVM: Introduce direct MSI message injection for in-kernel irqchips
From: Michael S. Tsirkin @ 2011-10-24 12:43 UTC (permalink / raw)
To: Jan Kiszka; +Cc: Avi Kivity, Marcelo Tosatti, kvm
In-Reply-To: <4EA554B0.7030808@siemens.com>
On Mon, Oct 24, 2011 at 02:06:08PM +0200, Jan Kiszka wrote:
> On 2011-10-24 13:09, Avi Kivity wrote:
> > On 10/24/2011 12:19 PM, Jan Kiszka wrote:
> >>>
> >>> With the new feature it may be worthwhile, but I'd like to see the whole
> >>> thing, with numbers attached.
> >>
> >> It's not a performance issue, it's a resource limitation issue: With the
> >> new API we can stop worrying about user space device models consuming
> >> limited IRQ routes of the KVM subsystem.
> >>
> >
> > Only if those devices are in the same process (or have access to the
> > vmfd). Interrupt routing together with irqfd allows you to disaggregate
> > the device model. Instead of providing a competing implementation with
> > new limitations, we need to remove the limitations of the old
> > implementation.
>
> That depends on where we do the cut. Currently we let the IRQ source
> signal an abstract edge on a pre-allocated pseudo IRQ line. But we
> cannot build correct MSI-X on top of the current irqfd model as we lack
> the level information (for PBA emulation). *)
I don't agree here. IMO PBA emulation would need to
clear pending bits on interrupt status register read.
So clearing pending bits could be done by ioctl from qemu
while setting them would be done from irqfd.
> So we either need to
> extend the existing model anyway -- or push per-vector masking back to
> the IRQ source. In the latter case, it would be a very good chance to
> give up on limited pseudo GSIs with static routes and do MSI messaging
> from external IRQ sources to KVM directly.
> But all those considerations affect different APIs than what I'm
> proposing here. We will always need a way to inject MSIs in the context
> of the VM as there will always be scenarios where devices are better run
> in that very same context, for performance or simplicity or whatever
> reasons. E.g., I could imagine that one would like to execute an
> emulated IRQ remapper rather in the hypervisor context than
> "over-microkernelized" in a separate process.
>
> Jan
>
> *) Realized this while trying to generalize the proposed MSI-X MMIO
> acceleration for assigned devices to arbitrary device models, vhost-net,
I'm actually working on a qemu patch to get pba emulation working correctly.
I think it's doable with existing irqfd.
> and specifically vfio.
Interesting. How would you clear the pseudo interrupt level?
> --
> Siemens AG, Corporate Technology, CT T DE IT 1
> Corporate Competence Center Embedded Linux
^ permalink raw reply
* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: directly write tt entries without buffering
From: Marek Lindner @ 2011-10-24 12:43 UTC (permalink / raw)
To: The list for a Better Approach To Mobile Ad-hoc Networking
In-Reply-To: <1319300126-17640-1-git-send-email-siwu@hrz.tu-chemnitz.de>
On Saturday, October 22, 2011 18:15:26 Simon Wunderlich wrote:
> When the translation tables (global and local) are written for debugfs,
> it is not neccesary to allocate a buffer, we can directly use
> seq_printf() to print them out.
>
> This might actually be safer if the table changes between size
> calculation and traversal, and we can't estimate the required size
> wrong.
Patch was applied in revision 52d3db8.
Thanks,
Marek
^ permalink raw reply
* [PATCH] ath9k_hw: Update CCK spur mitigation for AR9462
From: Rajkumar Manoharan @ 2011-10-24 12:44 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, Rajkumar Manoharan
To improve CCK sensitivity for AR9462 chips, performing
spur mitigation at 2440, 2464 frequencies alone is sufficient.
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath9k/ar9003_phy.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
index fe96997..04b060a 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
@@ -198,12 +198,14 @@ static void ar9003_hw_spur_mitigate_mrc_cck(struct ath_hw *ah,
synth_freq = chan->channel;
}
} else {
- range = 10;
+ range = AR_SREV_9462(ah) ? 5 : 10;
max_spur_cnts = 4;
synth_freq = chan->channel;
}
for (i = 0; i < max_spur_cnts; i++) {
+ if (AR_SREV_9462(ah) && (i == 0 || i == 3))
+ continue;
negative = 0;
if (AR_SREV_9485(ah) || AR_SREV_9340(ah) || AR_SREV_9330(ah))
cur_bb_spur = FBIN2FREQ(spur_fbin_ptr[i],
--
1.7.7
^ permalink raw reply related
* [PATCH net-next 0/4] be2net: fixes
From: Sathya Perla @ 2011-10-24 12:44 UTC (permalink / raw)
To: netdev
Pls apply.
Sathya Perla (4):
be2net: add vlan/rx-mode/flow-control config to be_setup()
be2net: refactor VF setup/teardown code into be_vf_setup/clear()
be2net: don't create multiple TXQs in BE2
be2net: don't create multiple RX/TX rings in multi channel mode
drivers/net/ethernet/emulex/benet/be_cmds.c | 66 +++--
drivers/net/ethernet/emulex/benet/be_cmds.h | 10 +-
drivers/net/ethernet/emulex/benet/be_main.c | 362 +++++++++++++--------------
3 files changed, 222 insertions(+), 216 deletions(-)
--
1.7.4
^ permalink raw reply
* [PATCH net-next 1/4] be2net: add vlan/rx-mode/flow-control config to be_setup()
From: Sathya Perla @ 2011-10-24 12:45 UTC (permalink / raw)
To: netdev
In-Reply-To: <1319460303-25560-1-git-send-email-sathya.perla@emulex.com>
When a card is reset due to EEH error recovery or due to a suspend, rx-mode config (promisc/mc) is not being sent to the FW. be_setup() is called in these flows and is the best place for such config/re-config cmds. Hence include rx-mode, vlan and flow-control config in be_setup().
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
drivers/net/ethernet/emulex/benet/be_main.c | 121 ++++++++++++--------------
1 files changed, 56 insertions(+), 65 deletions(-)
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 706fc59..88c9dca 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -796,7 +796,7 @@ static void be_vlan_rem_vid(struct net_device *netdev, u16 vid)
be_vid_config(adapter, false, 0);
}
-static void be_set_multicast_list(struct net_device *netdev)
+static void be_set_rx_mode(struct net_device *netdev)
{
struct be_adapter *adapter = netdev_priv(netdev);
@@ -2352,17 +2352,6 @@ static int be_open(struct net_device *netdev)
/* Now that interrupts are on we can process async mcc */
be_async_mcc_enable(adapter);
- if (be_physfn(adapter)) {
- status = be_vid_config(adapter, false, 0);
- if (status)
- goto err;
-
- status = be_cmd_set_flow_control(adapter,
- adapter->tx_fc, adapter->rx_fc);
- if (status)
- goto err;
- }
-
return 0;
err:
be_close(adapter->netdev);
@@ -2450,10 +2439,40 @@ static inline void be_vf_eth_addr_rem(struct be_adapter *adapter)
}
}
+static int be_clear(struct be_adapter *adapter)
+{
+ int vf;
+
+ if (be_physfn(adapter) && adapter->sriov_enabled)
+ be_vf_eth_addr_rem(adapter);
+
+ be_mcc_queues_destroy(adapter);
+ be_rx_queues_destroy(adapter);
+ be_tx_queues_destroy(adapter);
+ adapter->eq_next_idx = 0;
+
+ if (be_physfn(adapter) && adapter->sriov_enabled)
+ for (vf = 0; vf < num_vfs; vf++)
+ if (adapter->vf_cfg[vf].vf_if_handle)
+ be_cmd_if_destroy(adapter,
+ adapter->vf_cfg[vf].vf_if_handle,
+ vf + 1);
+
+ be_cmd_if_destroy(adapter, adapter->if_handle, 0);
+
+ adapter->be3_native = false;
+ adapter->promiscuous = false;
+
+ /* tell fw we're done with firing cmds */
+ be_cmd_fw_clean(adapter);
+ return 0;
+}
+
static int be_setup(struct be_adapter *adapter)
{
struct net_device *netdev = adapter->netdev;
u32 cap_flags, en_flags, vf = 0;
+ u32 tx_fc, rx_fc;
int status;
u8 mac[ETH_ALEN];
@@ -2479,7 +2498,7 @@ static int be_setup(struct be_adapter *adapter)
netdev->dev_addr, false/* pmac_invalid */,
&adapter->if_handle, &adapter->pmac_id, 0);
if (status != 0)
- goto do_none;
+ goto err;
if (be_physfn(adapter)) {
if (adapter->sriov_enabled) {
@@ -2494,7 +2513,7 @@ static int be_setup(struct be_adapter *adapter)
dev_err(&adapter->pdev->dev,
"Interface Create failed for VF %d\n",
vf);
- goto if_destroy;
+ goto err;
}
adapter->vf_cfg[vf].vf_pmac_id =
BE_INVALID_PMAC_ID;
@@ -2512,71 +2531,47 @@ static int be_setup(struct be_adapter *adapter)
status = be_tx_queues_create(adapter);
if (status != 0)
- goto if_destroy;
+ goto err;
status = be_rx_queues_create(adapter);
if (status != 0)
- goto tx_qs_destroy;
+ goto err;
/* Allow all priorities by default. A GRP5 evt may modify this */
adapter->vlan_prio_bmap = 0xff;
status = be_mcc_queues_create(adapter);
if (status != 0)
- goto rx_qs_destroy;
+ goto err;
adapter->link_speed = -1;
be_cmd_get_fw_ver(adapter, adapter->fw_ver, NULL);
+ status = be_vid_config(adapter, false, 0);
+ if (status)
+ goto err;
+
+ be_set_rx_mode(adapter->netdev);
+
+ status = be_cmd_get_flow_control(adapter, &tx_fc, &rx_fc);
+ if (status)
+ goto err;
+ if (rx_fc != adapter->rx_fc || tx_fc != adapter->tx_fc) {
+ status = be_cmd_set_flow_control(adapter, adapter->tx_fc,
+ adapter->rx_fc);
+ if (status)
+ goto err;
+ }
+
pcie_set_readrq(adapter->pdev, 4096);
return 0;
-rx_qs_destroy:
- be_rx_queues_destroy(adapter);
-tx_qs_destroy:
- be_tx_queues_destroy(adapter);
-if_destroy:
- if (be_physfn(adapter) && adapter->sriov_enabled)
- for (vf = 0; vf < num_vfs; vf++)
- if (adapter->vf_cfg[vf].vf_if_handle)
- be_cmd_if_destroy(adapter,
- adapter->vf_cfg[vf].vf_if_handle,
- vf + 1);
- be_cmd_if_destroy(adapter, adapter->if_handle, 0);
-do_none:
+err:
+ be_clear(adapter);
return status;
}
-static int be_clear(struct be_adapter *adapter)
-{
- int vf;
-
- if (be_physfn(adapter) && adapter->sriov_enabled)
- be_vf_eth_addr_rem(adapter);
-
- be_mcc_queues_destroy(adapter);
- be_rx_queues_destroy(adapter);
- be_tx_queues_destroy(adapter);
- adapter->eq_next_idx = 0;
-
- if (be_physfn(adapter) && adapter->sriov_enabled)
- for (vf = 0; vf < num_vfs; vf++)
- if (adapter->vf_cfg[vf].vf_if_handle)
- be_cmd_if_destroy(adapter,
- adapter->vf_cfg[vf].vf_if_handle,
- vf + 1);
-
- be_cmd_if_destroy(adapter, adapter->if_handle, 0);
-
- adapter->be3_native = 0;
-
- /* tell fw we're done with firing cmds */
- be_cmd_fw_clean(adapter);
- return 0;
-}
-
-
#define FW_FILE_HDR_SIGN "ServerEngines Corp. "
static bool be_flash_redboot(struct be_adapter *adapter,
const u8 *p, u32 img_start, int image_size,
@@ -2915,7 +2910,7 @@ static struct net_device_ops be_netdev_ops = {
.ndo_open = be_open,
.ndo_stop = be_close,
.ndo_start_xmit = be_xmit,
- .ndo_set_rx_mode = be_set_multicast_list,
+ .ndo_set_rx_mode = be_set_rx_mode,
.ndo_set_mac_address = be_mac_addr_set,
.ndo_change_mtu = be_change_mtu,
.ndo_get_stats64 = be_get_stats64,
@@ -2948,10 +2943,6 @@ static void be_netdev_init(struct net_device *netdev)
netdev->flags |= IFF_MULTICAST;
- /* Default settings for Rx and Tx flow control */
- adapter->rx_fc = true;
- adapter->tx_fc = true;
-
netif_set_gso_max_size(netdev, 65535);
BE_SET_NETDEV_OPS(netdev, &be_netdev_ops);
@@ -3373,6 +3364,7 @@ static int __devinit be_probe(struct pci_dev *pdev,
be_msix_enable(adapter);
INIT_DELAYED_WORK(&adapter->work, be_worker);
+ adapter->rx_fc = adapter->tx_fc = true;
status = be_setup(adapter);
if (status)
@@ -3448,7 +3440,6 @@ static int be_suspend(struct pci_dev *pdev, pm_message_t state)
be_close(netdev);
rtnl_unlock();
}
- be_cmd_get_flow_control(adapter, &adapter->tx_fc, &adapter->rx_fc);
be_clear(adapter);
be_msix_disable(adapter);
--
1.7.4
^ permalink raw reply related
* [PATCH net-next 2/4] be2net: refactor VF setup/teardown code into be_vf_setup/clear()
From: Sathya Perla @ 2011-10-24 12:45 UTC (permalink / raw)
To: netdev
In-Reply-To: <1319460303-25560-1-git-send-email-sathya.perla@emulex.com>
Currently the code for VF setup/teardown done by a PF (if_create, mac_add_config, link_status_query etc) is scattered; this patch refactors this code into be_vf_setup() and be_vf_clear().
The if_create/if_destroy/mac_addr_query cmds are now called after the MCCQ is created; so these cmds are now modified to use the MCCQ instead of MBOX.
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
drivers/net/ethernet/emulex/benet/be_cmds.c | 66 +++++---
drivers/net/ethernet/emulex/benet/be_cmds.h | 4 +-
drivers/net/ethernet/emulex/benet/be_main.c | 233 ++++++++++++---------------
3 files changed, 149 insertions(+), 154 deletions(-)
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c
index 6e7b521..8ae5a4c 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.c
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.c
@@ -615,7 +615,7 @@ int be_cmd_eq_create(struct be_adapter *adapter,
return status;
}
-/* Uses mbox */
+/* Use MCC */
int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr,
u8 type, bool permanent, u32 if_handle)
{
@@ -623,10 +623,13 @@ int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr,
struct be_cmd_req_mac_query *req;
int status;
- if (mutex_lock_interruptible(&adapter->mbox_lock))
- return -1;
+ spin_lock_bh(&adapter->mcc_lock);
- wrb = wrb_from_mbox(adapter);
+ wrb = wrb_from_mccq(adapter);
+ if (!wrb) {
+ status = -EBUSY;
+ goto err;
+ }
req = embedded_payload(wrb);
be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0,
@@ -643,13 +646,14 @@ int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr,
req->permanent = 0;
}
- status = be_mbox_notify_wait(adapter);
+ status = be_mcc_notify_wait(adapter);
if (!status) {
struct be_cmd_resp_mac_query *resp = embedded_payload(wrb);
memcpy(mac_addr, resp->mac.addr, ETH_ALEN);
}
- mutex_unlock(&adapter->mbox_lock);
+err:
+ spin_unlock_bh(&adapter->mcc_lock);
return status;
}
@@ -1111,20 +1115,22 @@ err:
}
/* Create an rx filtering policy configuration on an i/f
- * Uses mbox
+ * Uses MCCQ
*/
int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags, u32 en_flags,
- u8 *mac, bool pmac_invalid, u32 *if_handle, u32 *pmac_id,
- u32 domain)
+ u8 *mac, u32 *if_handle, u32 *pmac_id, u32 domain)
{
struct be_mcc_wrb *wrb;
struct be_cmd_req_if_create *req;
int status;
- if (mutex_lock_interruptible(&adapter->mbox_lock))
- return -1;
+ spin_lock_bh(&adapter->mcc_lock);
- wrb = wrb_from_mbox(adapter);
+ wrb = wrb_from_mccq(adapter);
+ if (!wrb) {
+ status = -EBUSY;
+ goto err;
+ }
req = embedded_payload(wrb);
be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0,
@@ -1136,23 +1142,25 @@ int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags, u32 en_flags,
req->hdr.domain = domain;
req->capability_flags = cpu_to_le32(cap_flags);
req->enable_flags = cpu_to_le32(en_flags);
- req->pmac_invalid = pmac_invalid;
- if (!pmac_invalid)
+ if (mac)
memcpy(req->mac_addr, mac, ETH_ALEN);
+ else
+ req->pmac_invalid = true;
- status = be_mbox_notify_wait(adapter);
+ status = be_mcc_notify_wait(adapter);
if (!status) {
struct be_cmd_resp_if_create *resp = embedded_payload(wrb);
*if_handle = le32_to_cpu(resp->interface_id);
- if (!pmac_invalid)
+ if (mac)
*pmac_id = le32_to_cpu(resp->pmac_id);
}
- mutex_unlock(&adapter->mbox_lock);
+err:
+ spin_unlock_bh(&adapter->mcc_lock);
return status;
}
-/* Uses mbox */
+/* Uses MCCQ */
int be_cmd_if_destroy(struct be_adapter *adapter, u32 interface_id, u32 domain)
{
struct be_mcc_wrb *wrb;
@@ -1162,10 +1170,16 @@ int be_cmd_if_destroy(struct be_adapter *adapter, u32 interface_id, u32 domain)
if (adapter->eeh_err)
return -EIO;
- if (mutex_lock_interruptible(&adapter->mbox_lock))
- return -1;
+ if (!interface_id)
+ return 0;
- wrb = wrb_from_mbox(adapter);
+ spin_lock_bh(&adapter->mcc_lock);
+
+ wrb = wrb_from_mccq(adapter);
+ if (!wrb) {
+ status = -EBUSY;
+ goto err;
+ }
req = embedded_payload(wrb);
be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0,
@@ -1177,10 +1191,9 @@ int be_cmd_if_destroy(struct be_adapter *adapter, u32 interface_id, u32 domain)
req->hdr.domain = domain;
req->interface_id = cpu_to_le32(interface_id);
- status = be_mbox_notify_wait(adapter);
-
- mutex_unlock(&adapter->mbox_lock);
-
+ status = be_mcc_notify_wait(adapter);
+err:
+ spin_unlock_bh(&adapter->mcc_lock);
return status;
}
@@ -1301,7 +1314,8 @@ int be_cmd_link_status_query(struct be_adapter *adapter, u8 *mac_speed,
struct be_cmd_resp_link_status *resp = embedded_payload(wrb);
if (resp->mac_speed != PHY_LINK_SPEED_ZERO) {
*link_speed = le16_to_cpu(resp->link_speed);
- *mac_speed = resp->mac_speed;
+ if (mac_speed)
+ *mac_speed = resp->mac_speed;
}
}
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.h b/drivers/net/ethernet/emulex/benet/be_cmds.h
index abaa90c..75b7574 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.h
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.h
@@ -1413,8 +1413,8 @@ extern int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr,
extern int be_cmd_pmac_del(struct be_adapter *adapter, u32 if_id,
u32 pmac_id, u32 domain);
extern int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags,
- u32 en_flags, u8 *mac, bool pmac_invalid,
- u32 *if_handle, u32 *pmac_id, u32 domain);
+ u32 en_flags, u8 *mac, u32 *if_handle, u32 *pmac_id,
+ u32 domain);
extern int be_cmd_if_destroy(struct be_adapter *adapter, u32 if_handle,
u32 domain);
extern int be_cmd_eq_create(struct be_adapter *adapter,
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 88c9dca..4ab182f 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -2069,7 +2069,7 @@ done:
return;
}
-static void be_sriov_enable(struct be_adapter *adapter)
+static int be_sriov_enable(struct be_adapter *adapter)
{
be_check_sriov_fn_type(adapter);
#ifdef CONFIG_PCI_IOV
@@ -2091,8 +2091,17 @@ static void be_sriov_enable(struct be_adapter *adapter)
status = pci_enable_sriov(adapter->pdev, num_vfs);
adapter->sriov_enabled = status ? false : true;
+
+ if (adapter->sriov_enabled) {
+ adapter->vf_cfg = kcalloc(num_vfs,
+ sizeof(struct be_vf_cfg),
+ GFP_KERNEL);
+ if (!adapter->vf_cfg)
+ return -ENOMEM;
+ }
}
#endif
+ return 0;
}
static void be_sriov_disable(struct be_adapter *adapter)
@@ -2100,6 +2109,7 @@ static void be_sriov_disable(struct be_adapter *adapter)
#ifdef CONFIG_PCI_IOV
if (adapter->sriov_enabled) {
pci_disable_sriov(adapter->pdev);
+ kfree(adapter->vf_cfg);
adapter->sriov_enabled = false;
}
#endif
@@ -2405,7 +2415,7 @@ static int be_setup_wol(struct be_adapter *adapter, bool enable)
*/
static inline int be_vf_eth_addr_config(struct be_adapter *adapter)
{
- u32 vf = 0;
+ u32 vf;
int status = 0;
u8 mac[ETH_ALEN];
@@ -2427,7 +2437,7 @@ static inline int be_vf_eth_addr_config(struct be_adapter *adapter)
return status;
}
-static inline void be_vf_eth_addr_rem(struct be_adapter *adapter)
+static void be_vf_clear(struct be_adapter *adapter)
{
u32 vf;
@@ -2437,29 +2447,25 @@ static inline void be_vf_eth_addr_rem(struct be_adapter *adapter)
adapter->vf_cfg[vf].vf_if_handle,
adapter->vf_cfg[vf].vf_pmac_id, vf + 1);
}
+
+ for (vf = 0; vf < num_vfs; vf++)
+ if (adapter->vf_cfg[vf].vf_if_handle)
+ be_cmd_if_destroy(adapter,
+ adapter->vf_cfg[vf].vf_if_handle, vf + 1);
}
static int be_clear(struct be_adapter *adapter)
{
- int vf;
-
if (be_physfn(adapter) && adapter->sriov_enabled)
- be_vf_eth_addr_rem(adapter);
+ be_vf_clear(adapter);
+
+ be_cmd_if_destroy(adapter, adapter->if_handle, 0);
be_mcc_queues_destroy(adapter);
be_rx_queues_destroy(adapter);
be_tx_queues_destroy(adapter);
adapter->eq_next_idx = 0;
- if (be_physfn(adapter) && adapter->sriov_enabled)
- for (vf = 0; vf < num_vfs; vf++)
- if (adapter->vf_cfg[vf].vf_if_handle)
- be_cmd_if_destroy(adapter,
- adapter->vf_cfg[vf].vf_if_handle,
- vf + 1);
-
- be_cmd_if_destroy(adapter, adapter->if_handle, 0);
-
adapter->be3_native = false;
adapter->promiscuous = false;
@@ -2468,59 +2474,92 @@ static int be_clear(struct be_adapter *adapter)
return 0;
}
+static int be_vf_setup(struct be_adapter *adapter)
+{
+ u32 cap_flags, en_flags, vf;
+ u16 lnk_speed;
+ int status;
+
+ cap_flags = en_flags = BE_IF_FLAGS_UNTAGGED | BE_IF_FLAGS_BROADCAST;
+ for (vf = 0; vf < num_vfs; vf++) {
+ status = be_cmd_if_create(adapter, cap_flags, en_flags, NULL,
+ &adapter->vf_cfg[vf].vf_if_handle,
+ NULL, vf+1);
+ if (status)
+ goto err;
+ adapter->vf_cfg[vf].vf_pmac_id = BE_INVALID_PMAC_ID;
+ }
+
+ if (!lancer_chip(adapter)) {
+ status = be_vf_eth_addr_config(adapter);
+ if (status)
+ goto err;
+ }
+
+ for (vf = 0; vf < num_vfs; vf++) {
+ status = be_cmd_link_status_query(adapter, NULL, &lnk_speed,
+ vf + 1);
+ if (status)
+ goto err;
+ adapter->vf_cfg[vf].vf_tx_rate = lnk_speed * 10;
+ }
+ return 0;
+err:
+ return status;
+}
+
static int be_setup(struct be_adapter *adapter)
{
struct net_device *netdev = adapter->netdev;
- u32 cap_flags, en_flags, vf = 0;
+ u32 cap_flags, en_flags;
u32 tx_fc, rx_fc;
int status;
u8 mac[ETH_ALEN];
+ /* Allow all priorities by default. A GRP5 evt may modify this */
+ adapter->vlan_prio_bmap = 0xff;
+ adapter->link_speed = -1;
+
be_cmd_req_native_mode(adapter);
- cap_flags = en_flags = BE_IF_FLAGS_UNTAGGED |
- BE_IF_FLAGS_BROADCAST |
- BE_IF_FLAGS_MULTICAST;
-
- if (be_physfn(adapter)) {
- cap_flags |= BE_IF_FLAGS_MCAST_PROMISCUOUS |
- BE_IF_FLAGS_PROMISCUOUS |
- BE_IF_FLAGS_PASS_L3L4_ERRORS;
- en_flags |= BE_IF_FLAGS_PASS_L3L4_ERRORS;
-
- if (adapter->function_caps & BE_FUNCTION_CAPS_RSS) {
- cap_flags |= BE_IF_FLAGS_RSS;
- en_flags |= BE_IF_FLAGS_RSS;
- }
+ status = be_tx_queues_create(adapter);
+ if (status != 0)
+ goto err;
+
+ status = be_rx_queues_create(adapter);
+ if (status != 0)
+ goto err;
+
+ status = be_mcc_queues_create(adapter);
+ if (status != 0)
+ goto err;
+
+ memset(mac, 0, ETH_ALEN);
+ status = be_cmd_mac_addr_query(adapter, mac, MAC_ADDRESS_TYPE_NETWORK,
+ true /*permanent */, 0);
+ if (status)
+ return status;
+ memcpy(adapter->netdev->dev_addr, mac, ETH_ALEN);
+ memcpy(adapter->netdev->perm_addr, mac, ETH_ALEN);
+
+ en_flags = BE_IF_FLAGS_UNTAGGED | BE_IF_FLAGS_BROADCAST |
+ BE_IF_FLAGS_MULTICAST | BE_IF_FLAGS_PASS_L3L4_ERRORS;
+ cap_flags = en_flags | BE_IF_FLAGS_MCAST_PROMISCUOUS |
+ BE_IF_FLAGS_PROMISCUOUS;
+ if (adapter->function_caps & BE_FUNCTION_CAPS_RSS) {
+ cap_flags |= BE_IF_FLAGS_RSS;
+ en_flags |= BE_IF_FLAGS_RSS;
}
-
status = be_cmd_if_create(adapter, cap_flags, en_flags,
- netdev->dev_addr, false/* pmac_invalid */,
- &adapter->if_handle, &adapter->pmac_id, 0);
+ netdev->dev_addr, &adapter->if_handle,
+ &adapter->pmac_id, 0);
if (status != 0)
goto err;
-
- if (be_physfn(adapter)) {
- if (adapter->sriov_enabled) {
- while (vf < num_vfs) {
- cap_flags = en_flags = BE_IF_FLAGS_UNTAGGED |
- BE_IF_FLAGS_BROADCAST;
- status = be_cmd_if_create(adapter, cap_flags,
- en_flags, mac, true,
- &adapter->vf_cfg[vf].vf_if_handle,
- NULL, vf+1);
- if (status) {
- dev_err(&adapter->pdev->dev,
- "Interface Create failed for VF %d\n",
- vf);
- goto err;
- }
- adapter->vf_cfg[vf].vf_pmac_id =
- BE_INVALID_PMAC_ID;
- vf++;
- }
- }
- } else {
+
+ /* For BEx, the VF's permanent mac queried from card is incorrect.
+ * Query the mac configued by the PF using if_handle
+ */
+ if (!be_physfn(adapter) && !lancer_chip(adapter)) {
status = be_cmd_mac_addr_query(adapter, mac,
MAC_ADDRESS_TYPE_NETWORK, false, adapter->if_handle);
if (!status) {
@@ -2529,23 +2568,6 @@ static int be_setup(struct be_adapter *adapter)
}
}
- status = be_tx_queues_create(adapter);
- if (status != 0)
- goto err;
-
- status = be_rx_queues_create(adapter);
- if (status != 0)
- goto err;
-
- /* Allow all priorities by default. A GRP5 evt may modify this */
- adapter->vlan_prio_bmap = 0xff;
-
- status = be_mcc_queues_create(adapter);
- if (status != 0)
- goto err;
-
- adapter->link_speed = -1;
-
be_cmd_get_fw_ver(adapter, adapter->fw_ver, NULL);
status = be_vid_config(adapter, false, 0);
@@ -2565,8 +2587,14 @@ static int be_setup(struct be_adapter *adapter)
}
pcie_set_readrq(adapter->pdev, 4096);
- return 0;
+ if (be_physfn(adapter) && adapter->sriov_enabled) {
+ status = be_vf_setup(adapter);
+ if (status)
+ goto err;
+ }
+
+ return 0;
err:
be_clear(adapter);
return status;
@@ -3123,7 +3151,6 @@ static void __devexit be_remove(struct pci_dev *pdev)
be_ctrl_cleanup(adapter);
- kfree(adapter->vf_cfg);
be_sriov_disable(adapter);
be_msix_disable(adapter);
@@ -3138,30 +3165,12 @@ static void __devexit be_remove(struct pci_dev *pdev)
static int be_get_config(struct be_adapter *adapter)
{
int status;
- u8 mac[ETH_ALEN];
status = be_cmd_query_fw_cfg(adapter, &adapter->port_num,
&adapter->function_mode, &adapter->function_caps);
if (status)
return status;
- memset(mac, 0, ETH_ALEN);
-
- /* A default permanent address is given to each VF for Lancer*/
- if (be_physfn(adapter) || lancer_chip(adapter)) {
- status = be_cmd_mac_addr_query(adapter, mac,
- MAC_ADDRESS_TYPE_NETWORK, true /*permanent */, 0);
-
- if (status)
- return status;
-
- if (!is_valid_ether_addr(mac))
- return -EADDRNOTAVAIL;
-
- memcpy(adapter->netdev->dev_addr, mac, ETH_ALEN);
- memcpy(adapter->netdev->perm_addr, mac, ETH_ALEN);
- }
-
if (adapter->function_mode & 0x400)
adapter->max_vlans = BE_NUM_VLANS_SUPPORTED/4;
else
@@ -3310,18 +3319,13 @@ static int __devinit be_probe(struct pci_dev *pdev,
}
}
- be_sriov_enable(adapter);
- if (adapter->sriov_enabled) {
- adapter->vf_cfg = kcalloc(num_vfs,
- sizeof(struct be_vf_cfg), GFP_KERNEL);
-
- if (!adapter->vf_cfg)
- goto free_netdev;
- }
+ status = be_sriov_enable(adapter);
+ if (status)
+ goto free_netdev;
status = be_ctrl_init(adapter);
if (status)
- goto free_vf_cfg;
+ goto disable_sriov;
if (lancer_chip(adapter)) {
status = lancer_test_and_set_rdy_state(adapter);
@@ -3375,33 +3379,11 @@ static int __devinit be_probe(struct pci_dev *pdev,
if (status != 0)
goto unsetup;
- if (be_physfn(adapter) && adapter->sriov_enabled) {
- u8 mac_speed;
- u16 vf, lnk_speed;
-
- if (!lancer_chip(adapter)) {
- status = be_vf_eth_addr_config(adapter);
- if (status)
- goto unreg_netdev;
- }
-
- for (vf = 0; vf < num_vfs; vf++) {
- status = be_cmd_link_status_query(adapter, &mac_speed,
- &lnk_speed, vf + 1);
- if (!status)
- adapter->vf_cfg[vf].vf_tx_rate = lnk_speed * 10;
- else
- goto unreg_netdev;
- }
- }
-
dev_info(&pdev->dev, "%s port %d\n", nic_name(pdev), adapter->port_num);
schedule_delayed_work(&adapter->work, msecs_to_jiffies(100));
return 0;
-unreg_netdev:
- unregister_netdev(netdev);
unsetup:
be_clear(adapter);
msix_disable:
@@ -3410,10 +3392,9 @@ stats_clean:
be_stats_cleanup(adapter);
ctrl_clean:
be_ctrl_cleanup(adapter);
-free_vf_cfg:
- kfree(adapter->vf_cfg);
+disable_sriov:
+ be_sriov_disable(adapter);
free_netdev:
- be_sriov_disable(adapter);
free_netdev(netdev);
pci_set_drvdata(pdev, NULL);
rel_reg:
--
1.7.4
^ permalink raw reply related
* [PATCH net-next 3/4] be2net: don't create multiple TXQs in BE2
From: Sathya Perla @ 2011-10-24 12:45 UTC (permalink / raw)
To: netdev; +Cc: Vasundhara Volam
In-Reply-To: <1319460303-25560-1-git-send-email-sathya.perla@emulex.com>
Multiple TXQ support is partially broken in BE2. It is fully
supported BE3 onwards and in Lancer.
Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
drivers/net/ethernet/emulex/benet/be_main.c | 26 ++++++++++++++++----------
1 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 4ab182f..77ce24b 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -1633,6 +1633,17 @@ static void be_tx_queues_destroy(struct be_adapter *adapter)
be_queue_free(adapter, q);
}
+static int be_num_txqs_want(struct be_adapter *adapter)
+{
+ if ((num_vfs && adapter->sriov_enabled) ||
+ (adapter->function_mode & 0x400) ||
+ lancer_chip(adapter) || !be_physfn(adapter) ||
+ adapter->generation == BE_GEN2)
+ return 1;
+ else
+ return MAX_TX_QS;
+}
+
/* One TX event queue is shared by all TX compl qs */
static int be_tx_queues_create(struct be_adapter *adapter)
{
@@ -1640,6 +1651,11 @@ static int be_tx_queues_create(struct be_adapter *adapter)
struct be_tx_obj *txo;
u8 i;
+ adapter->num_tx_qs = be_num_txqs_want(adapter);
+ if (adapter->num_tx_qs != MAX_TX_QS)
+ netif_set_real_num_tx_queues(adapter->netdev,
+ adapter->num_tx_qs);
+
adapter->tx_eq.max_eqd = 0;
adapter->tx_eq.min_eqd = 0;
adapter->tx_eq.cur_eqd = 96;
@@ -3180,16 +3196,6 @@ static int be_get_config(struct be_adapter *adapter)
if (status)
return status;
- if ((num_vfs && adapter->sriov_enabled) ||
- (adapter->function_mode & 0x400) ||
- lancer_chip(adapter) || !be_physfn(adapter)) {
- adapter->num_tx_qs = 1;
- netif_set_real_num_tx_queues(adapter->netdev,
- adapter->num_tx_qs);
- } else {
- adapter->num_tx_qs = MAX_TX_QS;
- }
-
return 0;
}
--
1.7.4
^ permalink raw reply related
* [PATCH net-next 4/4] be2net: don't create multiple RX/TX rings in multi channel mode
From: Sathya Perla @ 2011-10-24 12:45 UTC (permalink / raw)
To: netdev; +Cc: Suresh Reddy
In-Reply-To: <1319460303-25560-1-git-send-email-sathya.perla@emulex.com>
When the HW is in multi-channel mode based on the skew/IPL, there are 4 functions per port and so not enough resources to create multiple RX/TX rings for each function.
Signed-off-by: Suresh Reddy <suresh.reddy@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
drivers/net/ethernet/emulex/benet/be_cmds.h | 6 ++++++
drivers/net/ethernet/emulex/benet/be_main.c | 16 ++++++++++++----
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.h b/drivers/net/ethernet/emulex/benet/be_cmds.h
index 75b7574..a35cd03 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.h
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.h
@@ -1046,6 +1046,12 @@ struct be_cmd_resp_modify_eq_delay {
/******************** Get FW Config *******************/
#define BE_FUNCTION_CAPS_RSS 0x2
+/* The HW can come up in either of the following multi-channel modes
+ * based on the skew/IPL.
+ */
+#define FLEX10_MODE 0x400
+#define VNIC_MODE 0x20000
+#define UMC_ENABLED 0x1000000
struct be_cmd_req_query_fw_cfg {
struct be_cmd_req_hdr hdr;
u32 rsvd[31];
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 77ce24b..91fe12a 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -114,6 +114,13 @@ static const char * const ue_status_hi_desc[] = {
"Unknown"
};
+/* Is BE in a multi-channel mode */
+static inline bool be_is_mc(struct be_adapter *adapter) {
+ return (adapter->function_mode & FLEX10_MODE ||
+ adapter->function_mode & VNIC_MODE ||
+ adapter->function_mode & UMC_ENABLED);
+}
+
static void be_queue_free(struct be_adapter *adapter, struct be_queue_info *q)
{
struct be_dma_mem *mem = &q->dma_mem;
@@ -1289,7 +1296,7 @@ static struct be_rx_compl_info *be_rx_compl_get(struct be_rx_obj *rxo)
if (rxcp->vlanf) {
/* vlanf could be wrongly set in some cards.
* ignore if vtm is not set */
- if ((adapter->function_mode & 0x400) && !rxcp->vtm)
+ if ((adapter->function_mode & FLEX10_MODE) && !rxcp->vtm)
rxcp->vlanf = 0;
if (!lancer_chip(adapter))
@@ -1636,7 +1643,7 @@ static void be_tx_queues_destroy(struct be_adapter *adapter)
static int be_num_txqs_want(struct be_adapter *adapter)
{
if ((num_vfs && adapter->sriov_enabled) ||
- (adapter->function_mode & 0x400) ||
+ be_is_mc(adapter) ||
lancer_chip(adapter) || !be_physfn(adapter) ||
adapter->generation == BE_GEN2)
return 1;
@@ -1718,7 +1725,8 @@ static void be_rx_queues_destroy(struct be_adapter *adapter)
static u32 be_num_rxqs_want(struct be_adapter *adapter)
{
if ((adapter->function_caps & BE_FUNCTION_CAPS_RSS) &&
- !adapter->sriov_enabled && !(adapter->function_mode & 0x400)) {
+ !adapter->sriov_enabled && be_physfn(adapter) &&
+ !be_is_mc(adapter)) {
return 1 + MAX_RSS_QS; /* one default non-RSS queue */
} else {
dev_warn(&adapter->pdev->dev,
@@ -3187,7 +3195,7 @@ static int be_get_config(struct be_adapter *adapter)
if (status)
return status;
- if (adapter->function_mode & 0x400)
+ if (adapter->function_mode & FLEX10_MODE)
adapter->max_vlans = BE_NUM_VLANS_SUPPORTED/4;
else
adapter->max_vlans = BE_NUM_VLANS_SUPPORTED;
--
1.7.4
^ permalink raw reply related
* [PATCH] [kvm-autotest]client.tests.kvm.tests.cgroup: Add TestDeviceAccess subtest
From: Lukas Doktor @ 2011-10-24 12:46 UTC (permalink / raw)
To: autotest, kvm, kvm-autotest, akong, lmr, ldoktor, jzupka
In-Reply-To: <1319460365-11819-1-git-send-email-ldoktor@redhat.com>
This subtest tries to attach scsi_debug disk with different cgroup
devices.list setting.
* subtests the devices.{allow, deny, list} cgroup functionality
* new function get_maj_min(dev) which returns (major, minor) numbers
of dev
* rm_drive: support for rm_device without drive (only remove the host
file)
* improved logging
Signed-off-by: Lukas Doktor <ldoktor@redhat.com>
---
client/tests/kvm/tests/cgroup.py | 234 +++++++++++++++++++++++++++++++++-----
1 files changed, 203 insertions(+), 31 deletions(-)
diff --git a/client/tests/kvm/tests/cgroup.py b/client/tests/kvm/tests/cgroup.py
index 6c64532..c83f91a 100644
--- a/client/tests/kvm/tests/cgroup.py
+++ b/client/tests/kvm/tests/cgroup.py
@@ -50,7 +50,7 @@ def run_cgroup(test, params, env):
return abs(float(actual-reference) / reference)
- def get_dd_cmd(direction, dev='vd?', count=None, bs=None):
+ def get_dd_cmd(direction, dev=None, count=None, bs=None):
"""
Generates dd_cmd string
@param direction: {read,write,bi} dd direction
@@ -59,6 +59,11 @@ def run_cgroup(test, params, env):
@param bs: bs parameter of dd
@return: dd command string
"""
+ if dev is None:
+ if get_device_driver() == "virtio":
+ dev = 'vd?'
+ else:
+ dev = '[sh]d?'
if direction == "read":
params = "if=$FILE of=/dev/null iflag=direct"
elif direction == "write":
@@ -82,6 +87,21 @@ def run_cgroup(test, params, env):
return params.get('drive_format', 'virtio')
+ def get_maj_min(dev):
+ """
+ Returns the major and minor numbers of the dev device
+ @return: Tupple(major, minor) numbers of the dev device
+ """
+ try:
+ ret = utils.system_output("ls -l %s" % dev)
+ ret = re.match(r'[bc][rwx-]{9} \d+ \w+ \w+ (\d+), (\d+)',
+ ret).groups()
+ except Exception, details:
+ raise error.TestFail("Couldn't get %s maj and min numbers: %s" %
+ (dev, details))
+ return ret
+
+
def add_file_drive(vm, driver=get_device_driver(), host_file=None):
"""
Hot-add a drive based on file to a vm
@@ -173,14 +193,17 @@ def run_cgroup(test, params, env):
"""
err = False
# TODO: Implement also via QMP
- vm.monitor.cmd("pci_del %s" % device)
- time.sleep(3)
- qtree = vm.monitor.info('qtree', debug=False)
- if qtree.count('addr %s.0' % device) != 0:
- err = True
- vm.destroy()
-
- if isinstance(host_file, str): # scsi device
+ if device:
+ vm.monitor.cmd("pci_del %s" % device)
+ time.sleep(3)
+ qtree = vm.monitor.info('qtree', debug=False)
+ if qtree.count('addr %s.0' % device) != 0:
+ err = True
+ vm.destroy()
+
+ if host_file is None: # Do not remove
+ pass
+ elif isinstance(host_file, str): # scsi device
utils.system("echo -1> /sys/bus/pseudo/drivers/scsi_debug/add_host")
else: # file
host_file.close()
@@ -334,7 +357,7 @@ def run_cgroup(test, params, env):
_TestBlkioBandwidth.__init__(self, vms, modules)
# Read from the last vd* in a loop until test removes the
# /tmp/cgroup_lock file (and kills us)
- self.dd_cmd = get_dd_cmd("read", bs="100K")
+ self.dd_cmd = get_dd_cmd("read", dev='vd?', bs="100K")
class TestBlkioBandwidthWeigthWrite(_TestBlkioBandwidth):
@@ -350,7 +373,7 @@ def run_cgroup(test, params, env):
# Write on the last vd* in a loop until test removes the
# /tmp/cgroup_lock file (and kills us)
_TestBlkioBandwidth.__init__(self, vms, modules)
- self.dd_cmd = get_dd_cmd("write", bs="100K")
+ self.dd_cmd = get_dd_cmd("write", dev='vd?', bs="100K")
class _TestBlkioThrottle:
@@ -376,10 +399,6 @@ def run_cgroup(test, params, env):
self.devices = None # Temporary virt devices (PCI drive 1 per vm)
self.dd_cmd = None # DD command used to test the throughput
self.speeds = None # cgroup throughput
- if get_device_driver() == "virtio":
- self.dev = "vd?"
- else:
- self.dev = "[sh]d?"
def cleanup(self):
"""
@@ -417,13 +436,8 @@ def run_cgroup(test, params, env):
driver="virtio")
else:
(self.files, self.devices) = add_scsi_drive(self.vm)
- try:
- dev = utils.system_output("ls -l %s" % self.files).split()[4:6]
- dev[0] = dev[0][:-1] # Remove tailing ','
- except:
- time.sleep(5)
- raise error.TestFail("Couldn't get %s maj and min numbers"
- % self.files)
+ time.sleep(3)
+ dev = get_maj_min(self.files)
cgroup = self.cgroup
cgroup.initialize(self.modules)
@@ -548,7 +562,7 @@ def run_cgroup(test, params, env):
@param modules: initialized cgroup module class
"""
_TestBlkioThrottle.__init__(self, vms, modules)
- self.dd_cmd = get_dd_cmd("read", dev=self.dev, count=1)
+ self.dd_cmd = get_dd_cmd("read", count=1)
self.speeds = [1024]
@@ -561,7 +575,7 @@ def run_cgroup(test, params, env):
@param modules: initialized cgroup module class
"""
_TestBlkioThrottle.__init__(self, vms, modules)
- self.dd_cmd = get_dd_cmd("write", dev=self.dev, count=1)
+ self.dd_cmd = get_dd_cmd("write", count=1)
self.speeds = [1024]
@@ -577,7 +591,7 @@ def run_cgroup(test, params, env):
@param modules: initialized cgroup module class
"""
_TestBlkioThrottle.__init__(self, vms, modules)
- self.dd_cmd = get_dd_cmd("read", dev=self.dev, count=1)
+ self.dd_cmd = get_dd_cmd("read", count=1)
self.speeds = [0, 1024, 0, 2048, 0, 4096]
@@ -593,10 +607,166 @@ def run_cgroup(test, params, env):
@param modules: initialized cgroup module class
"""
_TestBlkioThrottle.__init__(self, vms, modules)
- self.dd_cmd = get_dd_cmd("write", dev=self.dev, count=1)
+ self.dd_cmd = get_dd_cmd("write", count=1)
self.speeds = [0, 1024, 0, 2048, 0, 4096]
+ class TestDevicesAccess:
+ """
+ It tries to attach scsi_debug disk with different cgroup devices.list
+ setting.
+ * self.permitions are defined as a list of dictionaries:
+ {'property': control property, 'value': permition value,
+ 'check_value': check value (from devices.list property),
+ 'read_results': excepced read results T/F,
+ 'write_results': expected write results T/F}
+ """
+ def __init__(self, vms, modules):
+ """
+ Initialization
+ @param vms: list of vms
+ @param modules: initialized cgroup module class
+ """
+ self.vm = vms[0] # Virt machines
+ self.modules = modules # cgroup module handler
+ self.cgroup = Cgroup('devices', '') # cgroup blkio handler
+ self.files = None # Temporary files (files of virt disks)
+ self.devices = None # Temporary virt devices
+ self.permitions = None # Test dictionary, see init for details
+
+
+ def cleanup(self):
+ """ Cleanup """
+ err = ""
+ try:
+ rm_drive(self.vm, self.files, self.devices)
+ except Exception, failure_detail:
+ err += "\nCan't remove PCI drive: %s" % failure_detail
+ try:
+ del(self.cgroup)
+ except Exception, failure_detail:
+ err += "\nCan't remove Cgroup: %s" % failure_detail
+
+ if err:
+ logging.error("Some cleanup operations failed: %s", err)
+ raise error.TestError("Some cleanup operations failed: %s"
+ % err)
+
+
+ def init(self):
+ """
+ Initialization
+ * creates a new scsi_debug device
+ * prepares one cgroup and assign vm to it
+ """
+ # Only create the host /dev/sd? device
+ (self.files, self.devices) = add_scsi_drive(self.vm)
+ rm_drive(self.vm, host_file=None, device=self.devices)
+ self.devices = None # We don't want to mess cleanup
+
+ time.sleep(3)
+ dev = "%s:%s" % get_maj_min(self.files)
+
+ self.cgroup.initialize(self.modules)
+ self.cgroup.mk_cgroup()
+ self.cgroup.set_cgroup(self.vm.get_shell_pid(),
+ self.cgroup.cgroups[0])
+ for pid in utils.get_children_pids(self.vm.get_shell_pid()):
+ self.cgroup.set_cgroup(int(pid), self.cgroup.cgroups[0])
+
+ # Test dictionary
+ # Beware of persistence of some setting to another round!!!
+ self.permitions = [
+ {'property' : 'deny',
+ 'value' : 'a',
+ 'check_value' : '',
+ 'result' : False},
+ {'property' : 'allow',
+ 'value' : 'b %s rm' % dev,
+ 'check_value' : True,
+ 'result' : False},
+ {'property' : 'allow',
+ 'value' : 'b %s w' % dev,
+ 'check_value' : 'b %s rwm' % dev,
+ 'result' : True},
+ {'property' : 'deny',
+ 'value' : 'b %s r' % dev,
+ 'check_value' : 'b %s wm' % dev,
+ 'result' : False},
+ {'property' : 'deny',
+ 'value' : 'b %s wm' % dev,
+ 'check_value' : '',
+ 'result' : False},
+ {'property' : 'allow',
+ 'value' : 'a',
+ 'check_value' : 'a *:* rwm',
+ 'result' : True},
+ ]
+
+
+
+ def run(self):
+ """
+ Actual test:
+ * For each self.permitions sets the cgroup devices permition
+ and tries attach the disk. Checks the results with prescription.
+ """
+ def set_permitions(cgroup, permitions):
+ """
+ Wrapper for setting permitions to first cgroup
+ @param self.permitions: is defined as a list of dictionaries:
+ {'property': control property, 'value': permition value,
+ 'check_value': check value (from devices.list property),
+ 'read_results': excepced read results T/F,
+ 'write_results': expected write results T/F}
+ """
+ cgroup.set_property('devices.'+permitions['property'],
+ permitions['value'],
+ cgroup.cgroups[0],
+ check=permitions['check_value'],
+ checkprop='devices.list')
+
+
+ session = self.vm.wait_for_login(timeout=30)
+
+ cgroup = self.cgroup
+ results = ""
+ for i in range(len(self.permitions)):
+ perm = self.permitions[i]
+ set_permitions(cgroup, perm)
+ logging.debug("Setting permitions: {%s: %s}, value: %s",
+ perm['property'], perm['value'],
+ cgroup.get_property('devices.list',
+ cgroup.cgroups[0]))
+
+ try:
+ (_, self.devices) = add_scsi_drive(self.vm,
+ host_file=self.files)
+ except Exception, details:
+ if perm['result']:
+ logging.error("Perm: {%s: %s}: drive was not attached:"
+ " %s", perm['property'], perm['value'],
+ details)
+ results += ("{%s: %s => NotAttached}, " %
+ (perm['property'], perm['value']))
+ else:
+ if not perm['result']:
+ logging.error("Perm: {%s: %s}: drive was attached",
+ perm['property'], perm['value'])
+ results += ("{%s: %s => Attached}, " %
+ (perm['property'], perm['value']))
+ rm_drive(self.vm, host_file=None, device=self.devices)
+ self.devices = None
+
+ session.close()
+ if results:
+ raise error.TestFail("Some restrictions were broken: {%s}" %
+ results[:-2])
+
+ time.sleep(10)
+
+ return ("All restrictions enforced successfully.")
+
# Setup
# TODO: Add all new tests here
tests = {"blkio_bandwidth_weigth_read" : TestBlkioBandwidthWeigthRead,
@@ -605,9 +775,10 @@ def run_cgroup(test, params, env):
"blkio_throttle_write" : TestBlkioThrottleWrite,
"blkio_throttle_multiple_read" : TestBlkioThrottleMultipleRead,
"blkio_throttle_multiple_write" : TestBlkioThrottleMultipleWrite,
+ "devices_access" : TestDevicesAccess,
}
modules = CgroupModules()
- if (modules.init(['blkio']) <= 0):
+ if (modules.init(['blkio', 'devices']) <= 0):
raise error.TestFail('Can\'t mount any cgroup modules')
# Add all vms
vms = []
@@ -674,14 +845,15 @@ def run_cgroup(test, params, env):
results += ("\n [F] %s: {%s} FAILED: %s" %
(cg_test, err[:-2], out))
elif err:
- results += ("\n [E] %s: Test passed but {%s} FAILED: %s" %
+ results += ("\n [W] %s: Test passed but {%s} FAILED: %s" %
(cg_test, err[:-2], out))
else:
results += ("\n [P] %s: PASSED: %s" % (cg_test, out))
- out = ("SUM: All tests finished (%d PASS / %d FAIL = %d TOTAL)%s" %
- (results.count("PASSED"), results.count("FAILED"),
- (results.count("PASSED")+results.count("FAILED")), results))
+ out = ("SUM: All tests finished (%d PASS / %d WARN / %d FAIL = %d TOTAL)%s"%
+ (results.count("\n [P]"), results.count("\n [W]"),
+ results.count("\n [F]"), (results.count("\n [P]") +
+ results.count("\n [F]") + results.count("\n [W]")), results))
logging.info(out)
if results.count("FAILED"):
raise error.TestFail("Some subtests failed\n%s" % out)
--
1.7.6.2
^ permalink raw reply related
* [kvm-autotest]client.tests.kvm.tests.cgroup: Add TestDeviceAccess subtest
From: Lukas Doktor @ 2011-10-24 12:46 UTC (permalink / raw)
To: autotest, kvm, kvm-autotest, akong, lmr, ldoktor, jzupka
Hi guys,
I have a new subtest which tests the 'devices' cgroup subsystem and improve the logging a bit.
Please find the pull request on github:
https://github.com/autotest/autotest/pull/48
Cheers,
Lukáš
^ permalink raw reply
* [PATCH v2 4/5] ARM: SPMP8000: Add SPMP8000 SoC and Letcool board dts descriptions
From: Rob Herring @ 2011-10-24 12:47 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1319040118-29773-5-git-send-email-zoss@devai.org>
On 10/19/2011 11:01 AM, Zoltan Devai wrote:
> This adds the DT description of the SPMP8000 SoC, the Letcool
> N350JP board and documentation of required bindings
>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> CC: devicetree-discuss at lists.ozlabs.org
> Signed-off-by: Zoltan Devai <zoss@devai.org>
> ---
Only a couple of minor things below. Otherwise looks good.
Acked-by: Rob Herring <rob.herring@calxeda.com>
> Documentation/devicetree/bindings/arm/spmp8000.txt | 25 +++++
> arch/arm/boot/dts/spmp8000-letcool.dts | 20 ++++
> arch/arm/boot/dts/spmp8000.dtsi | 93 ++++++++++++++++++++
> 3 files changed, 138 insertions(+), 0 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/arm/spmp8000.txt
> create mode 100644 arch/arm/boot/dts/spmp8000-letcool.dts
> create mode 100644 arch/arm/boot/dts/spmp8000.dtsi
>
> diff --git a/Documentation/devicetree/bindings/arm/spmp8000.txt b/Documentation/devicetree/bindings/arm/spmp8000.txt
> new file mode 100644
> index 0000000..c392b09
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/arm/spmp8000.txt
> @@ -0,0 +1,25 @@
> +Sunplus SPMP8000 device tree bindings
> +=====================================
> +
> +Required root node properties:
> + - compatible:
> + - "gameware,letcool" : Letcool N350JO handheld game console board
> + - "sunplus,spmp8000" : A board based on the SPMP8000 SoC
> +
> +Timer required properties:
> + - compatible = "sunplus,spmp8000-timer"
> + - interrupt-parent : The interrupt controller node this timer belongs to
> + - interrupts : IRQs of the timer
> + - clock-freq : The frequency in HZ of the timer.
"clock-frequency" is what is commonly used.
> + - reg : The register bank for the timer.
> +
> +Watchdog required properties:
> + - compatible = "sunplus,spmp8000-watchdof"
s/watchdof/watchdog/
> + - interrupt-parent : The interrupt controller node this timer belongs to
> + - interrupts : IRQs of the watchdog
> + - reg : The register bank for the watchdog controller
> +
> +SCU required properties:
> + - compatible: "sunplus,spmp8000-scua" or "sunplus,spmp8000-scuab" or
> + "sunplus,spmp8000-scuc"
> + - reg: The register bank of the System Control Unit
> diff --git a/arch/arm/boot/dts/spmp8000-letcool.dts b/arch/arm/boot/dts/spmp8000-letcool.dts
> new file mode 100644
> index 0000000..424f2aa
> --- /dev/null
> +++ b/arch/arm/boot/dts/spmp8000-letcool.dts
> @@ -0,0 +1,20 @@
> +/dts-v1/;
> +/include/ "spmp8000.dtsi"
> +/ {
> + model = "Letcool N350JP handheld game console";
> + compatible = "gameware,letcool", "sunplus,spmp8000";
> +
> + memory {
> + reg = <0x00000000 0x02000000>;
> + };
> +
> + chosen {
> + linux,stdout-path = &uart0;
> + };
> +
> + armapb {
> + timer at 90000000 {
> + clock-freq = <15187500>;
> + };
> + };
> +};
> diff --git a/arch/arm/boot/dts/spmp8000.dtsi b/arch/arm/boot/dts/spmp8000.dtsi
> new file mode 100644
> index 0000000..15b25fa
> --- /dev/null
> +++ b/arch/arm/boot/dts/spmp8000.dtsi
> @@ -0,0 +1,93 @@
> +/ {
> + compatible = "sunplus,spmp8000";
> + #address-cells = <1>;
> + #size-cells = <1>;
> +
> + armapb {
> + compatible = "simple-bus";
> + #address-cells = <1>;
> + #size-cells = <1>;
> + ranges = <0 0x90000000 0x10000>;
> +
> + timer at 90000000 {
> + compatible = "sunplus,spmp8000-timer";
> + reg = <0x0 0x1000>;
> + interrupt-parent = <&vic0>;
> + interrupts = <7 8 9>;
> + };
> +
> + watchdog at 90001000 {
> + compatible = "sunplus,spmp8000-wdt";
> + reg = <0x1000 0x1000>;
> + interrupt-parent = <&vic0>;
> + interrupts = <10 11 12>;
> + };
> +
> + scu-b at 90005000 {
> + compatible = "sunplus,spmp8000-scub";
> + reg = <0x5000 0x1000>;
> + };
> + };
> +
> + armahb {
> + compatible = "simple-bus";
> + #address-cells = <1>;
> + #size-cells = <1>;
> + ranges = <0 0x90010000 0x20000>;
> +
> + vic0: interrupt-controller at 90010000 {
> + compatible = "arm,pl192";
> + interrupt-controller;
> + #interrupt-cells = <1>;
> + reg = <0x0 0x1000>;
> + };
> +
> + vic1: interrupt-controller at 900020000 {
> + compatible = "arm,pl192";
> + interrupt-controller;
> + #interrupt-cells = <1>;
> + reg = <0x10000 0x1000>;
> + };
> + };
> +
> + plat {
> + compatible = "simple-bus";
> + #address-cells = <1>;
> + #size-cells = <1>;
> + ranges = <0 0x92000000 0x1000000>;
> +
> + scu-c at 92005000 {
> + compatible = "sunplus,spmp8000-scuc";
> + reg = <0x5000 0x1000>;
> + };
> +
> + plat-apb {
> + compatible = "simple-bus";
> + #address-cells = <1>;
> + #size-cells = <1>;
> + ranges = <0 0xB00000 0x10000>;
lower case for hex is preferred.
> +
> + uart0: uart-c0 at 92B04000 {
> + compatible = "ns16550a";
> + reg = <0x4000 0x1000>;
> + clock-frequency = <2076923>;
> + interrupt-parent = <&vic1>;
> + interrupts = <24>;
> + current-speed = <115200>;
> + reg-shift = <2>;
> + };
> + };
> + };
> +
> + axi {
> + compatible = "simple-bus";
> + #address-cells = <1>;
> + #size-cells = <1>;
> + ranges = <0 0x93000000 0x20000>;
> +
> + scu-a at 93007000 {
> + compatible = "sunplus,spmp8000-scua";
> + reg = <0x7000 0x1000>;
> + };
> + };
> +};
^ permalink raw reply
* Re: [PATCH v2 4/5] ARM: SPMP8000: Add SPMP8000 SoC and Letcool board dts descriptions
From: Rob Herring @ 2011-10-24 12:47 UTC (permalink / raw)
To: Zoltan Devai
Cc: Grant Likely, devicetree-discuss, Russell King, Arnd Bergmann,
linux-arm-kernel
In-Reply-To: <1319040118-29773-5-git-send-email-zoss@devai.org>
On 10/19/2011 11:01 AM, Zoltan Devai wrote:
> This adds the DT description of the SPMP8000 SoC, the Letcool
> N350JP board and documentation of required bindings
>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> CC: devicetree-discuss@lists.ozlabs.org
> Signed-off-by: Zoltan Devai <zoss@devai.org>
> ---
Only a couple of minor things below. Otherwise looks good.
Acked-by: Rob Herring <rob.herring@calxeda.com>
> Documentation/devicetree/bindings/arm/spmp8000.txt | 25 +++++
> arch/arm/boot/dts/spmp8000-letcool.dts | 20 ++++
> arch/arm/boot/dts/spmp8000.dtsi | 93 ++++++++++++++++++++
> 3 files changed, 138 insertions(+), 0 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/arm/spmp8000.txt
> create mode 100644 arch/arm/boot/dts/spmp8000-letcool.dts
> create mode 100644 arch/arm/boot/dts/spmp8000.dtsi
>
> diff --git a/Documentation/devicetree/bindings/arm/spmp8000.txt b/Documentation/devicetree/bindings/arm/spmp8000.txt
> new file mode 100644
> index 0000000..c392b09
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/arm/spmp8000.txt
> @@ -0,0 +1,25 @@
> +Sunplus SPMP8000 device tree bindings
> +=====================================
> +
> +Required root node properties:
> + - compatible:
> + - "gameware,letcool" : Letcool N350JO handheld game console board
> + - "sunplus,spmp8000" : A board based on the SPMP8000 SoC
> +
> +Timer required properties:
> + - compatible = "sunplus,spmp8000-timer"
> + - interrupt-parent : The interrupt controller node this timer belongs to
> + - interrupts : IRQs of the timer
> + - clock-freq : The frequency in HZ of the timer.
"clock-frequency" is what is commonly used.
> + - reg : The register bank for the timer.
> +
> +Watchdog required properties:
> + - compatible = "sunplus,spmp8000-watchdof"
s/watchdof/watchdog/
> + - interrupt-parent : The interrupt controller node this timer belongs to
> + - interrupts : IRQs of the watchdog
> + - reg : The register bank for the watchdog controller
> +
> +SCU required properties:
> + - compatible: "sunplus,spmp8000-scua" or "sunplus,spmp8000-scuab" or
> + "sunplus,spmp8000-scuc"
> + - reg: The register bank of the System Control Unit
> diff --git a/arch/arm/boot/dts/spmp8000-letcool.dts b/arch/arm/boot/dts/spmp8000-letcool.dts
> new file mode 100644
> index 0000000..424f2aa
> --- /dev/null
> +++ b/arch/arm/boot/dts/spmp8000-letcool.dts
> @@ -0,0 +1,20 @@
> +/dts-v1/;
> +/include/ "spmp8000.dtsi"
> +/ {
> + model = "Letcool N350JP handheld game console";
> + compatible = "gameware,letcool", "sunplus,spmp8000";
> +
> + memory {
> + reg = <0x00000000 0x02000000>;
> + };
> +
> + chosen {
> + linux,stdout-path = &uart0;
> + };
> +
> + armapb {
> + timer@90000000 {
> + clock-freq = <15187500>;
> + };
> + };
> +};
> diff --git a/arch/arm/boot/dts/spmp8000.dtsi b/arch/arm/boot/dts/spmp8000.dtsi
> new file mode 100644
> index 0000000..15b25fa
> --- /dev/null
> +++ b/arch/arm/boot/dts/spmp8000.dtsi
> @@ -0,0 +1,93 @@
> +/ {
> + compatible = "sunplus,spmp8000";
> + #address-cells = <1>;
> + #size-cells = <1>;
> +
> + armapb {
> + compatible = "simple-bus";
> + #address-cells = <1>;
> + #size-cells = <1>;
> + ranges = <0 0x90000000 0x10000>;
> +
> + timer@90000000 {
> + compatible = "sunplus,spmp8000-timer";
> + reg = <0x0 0x1000>;
> + interrupt-parent = <&vic0>;
> + interrupts = <7 8 9>;
> + };
> +
> + watchdog@90001000 {
> + compatible = "sunplus,spmp8000-wdt";
> + reg = <0x1000 0x1000>;
> + interrupt-parent = <&vic0>;
> + interrupts = <10 11 12>;
> + };
> +
> + scu-b@90005000 {
> + compatible = "sunplus,spmp8000-scub";
> + reg = <0x5000 0x1000>;
> + };
> + };
> +
> + armahb {
> + compatible = "simple-bus";
> + #address-cells = <1>;
> + #size-cells = <1>;
> + ranges = <0 0x90010000 0x20000>;
> +
> + vic0: interrupt-controller@90010000 {
> + compatible = "arm,pl192";
> + interrupt-controller;
> + #interrupt-cells = <1>;
> + reg = <0x0 0x1000>;
> + };
> +
> + vic1: interrupt-controller@900020000 {
> + compatible = "arm,pl192";
> + interrupt-controller;
> + #interrupt-cells = <1>;
> + reg = <0x10000 0x1000>;
> + };
> + };
> +
> + plat {
> + compatible = "simple-bus";
> + #address-cells = <1>;
> + #size-cells = <1>;
> + ranges = <0 0x92000000 0x1000000>;
> +
> + scu-c@92005000 {
> + compatible = "sunplus,spmp8000-scuc";
> + reg = <0x5000 0x1000>;
> + };
> +
> + plat-apb {
> + compatible = "simple-bus";
> + #address-cells = <1>;
> + #size-cells = <1>;
> + ranges = <0 0xB00000 0x10000>;
lower case for hex is preferred.
> +
> + uart0: uart-c0@92B04000 {
> + compatible = "ns16550a";
> + reg = <0x4000 0x1000>;
> + clock-frequency = <2076923>;
> + interrupt-parent = <&vic1>;
> + interrupts = <24>;
> + current-speed = <115200>;
> + reg-shift = <2>;
> + };
> + };
> + };
> +
> + axi {
> + compatible = "simple-bus";
> + #address-cells = <1>;
> + #size-cells = <1>;
> + ranges = <0 0x93000000 0x20000>;
> +
> + scu-a@93007000 {
> + compatible = "sunplus,spmp8000-scua";
> + reg = <0x7000 0x1000>;
> + };
> + };
> +};
^ permalink raw reply
* Re: [RFD] Network configuration data in sysfs
From: Kay Sievers @ 2011-10-24 12:46 UTC (permalink / raw)
To: David Miller
Cc: kirill, netdev, kuznet, jmorris, yoshfuji, kaber, gregkh,
gladkov.alexey
In-Reply-To: <20111024.005900.1091819103500072631.davem@davemloft.net>
On Mon, Oct 24, 2011 at 06:59, David Miller <davem@davemloft.net> wrote:
> From: "Kirill A. Shutemov" <kirill@shutemov.name>
> Date: Mon, 24 Oct 2011 07:24:00 +0300
>
>> On Sun, Oct 23, 2011 at 11:24:16PM -0400, David Miller wrote:
>>> From: "Kirill A. Shutemov" <kirill@shutemov.name>
>>> Date: Mon, 24 Oct 2011 04:34:07 +0300
>>>
>>> You can use netlink to perform any configuration change you want, or
>>> to view any network configuration setting.
>>
>> You need /sbin/ip or similar tool to do this, right?
>
> I'm talking about udev using netlink natively.
Kirill, what exactly is the use case? And why what does udev support
mean in that context?
I doubt that "not having /sbin/ip installed" should be a reason to add
and expose complex interfaces in /sys, while we already have a
perfectly working native way to do it.
Kay
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.