Re: [PATCH v3] x86/hyperv: Handle unknown NMIs on one CPU when unknown_nmi_panic
Thomas Gleixner writes: > Vitaly, > > On Thu, 1 Dec 2016, Vitaly Kuznetsov wrote: > >> There is a feature in Hyper-V (Debug-VM --InjectNonMaskableInterrupt) which >> injects NMI to the guest. Prior to WS2016 the NMI is injected to all CPUs >> of the guest and WS2016 injects it to CPU0 only. When unknown_nmi_panic is >> enabled and we'd like to do kdump we need to perform some minimal cleanup >> so the kdump kernel will be able to initialize VMBus devices, this cleanup >> includes sending CHANNELMSG_UNLOAD to the host waiting for >> CHANNELMSG_UNLOAD_RESPONSE to arrive. WS2012R2 always sends the response >> to the CPU which was used to send CHANNELMSG_REQUESTOFFERS on VMBus module >> load and not to the CPU which is sending CHANNELMSG_UNLOAD. As we can't do >> any cross-CPU work reliably on crash we have vmbus_wait_for_unload() >> function which tries to read CHANNELMSG_UNLOAD_RESPONSE on all CPUs message >> pages and this sometimes works. It was discovered that in case the host >> wants to send more than one message to a secondary CPU (not the CPU running >> vmbus_wait_for_unload()) we're unable to get it as after reading the first >> message we're supposed to do EOMing by doing wrmsrl(HV_X64_MSR_EOM, 0) but >> this is per-CPU. I have a feeling that this was working some time ago when >> I implemented vmbus_wait_for_unload(), the host was re-trying to deliver a >> message even without wrmsrl() but apparently this doesn't work any more. >> Unfortunately there is not that much we can do when all CPUs get NMI as >> all but the first one are getting blocked with interrupts disabled. What we >> can do is limit processing unknown interrupts to the first CPU which gets >> it in case we're about to crash. > > This is completely unreadable and I really tried hard to make sense of it. > > Please structure it in a way that people who are not familiar with the > inner workings of hyperv can at least understand the problem you are trying > to solve and the concept of the solution w/o needing to figure out what all > the acronyms and constants actually mean. > > Also visual structuring in paragraphs helps readability a lot. > Got it, I'll try to do my best to make it readable. > AFAICT this tries to deal with different problems of different hypervisor > versions, but even that is unclear as you talk about version WS2016, > versions prior to WS2016 and then about WS2012R2 in particular. > > Another issue I have with this is: > > " I have a feeling that this was working " > > Changes like this are not about feelings. We want to have changes based on > facts. > The thing is that Hyper-V is a (proprietary) software which gets updates and I don't remember which particular updates were installed when I was imlementing vmbus_wait_for_unload() but as far as I remember it was always working on WS2012R2. Now I observe a different behavior ... -- Vitaly ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4] x86/hyperv: Handle unknown NMIs on one CPU when unknown_nmi_panic
There is a feature in Hyper-V ('Debug-VM --InjectNonMaskableInterrupt') which injects NMI to the guest. We may want to crash the guest and do kdump on this NMI by enabling unknown_nmi_panic. To make kdump succeed we need to allow the kdump kernel to re-establish VMBus connection so it will see VMBus devices (storage, network,..). To properly unload VMBus making it possible to start over during kdump we need to do the following: - Send an 'unload' message to the hypervisor. This can be done on any CPU so we do this the crashing CPU. - Receive the 'unload finished' reply message. WS2012R2 delivers this message to the CPU which was used to establish VMBus connection during module load and this CPU may differ from the CPU sending 'unload'. Receiving a VMBus message means the following: - There is a per-CPU slot in memory for one message. This slot can in theory be accessed by any CPU. - We get an interrupt on the CPU when a message was placed into the slot. - When we read the message we need to clear the slot and signal the fact to the hypervisor. In case there are more messages to this CPU pending the hypervisor will deliver the next message. The signaling is done by writing to an MSR so this can only be done on the appropriate CPU. To avoid doing cross-CPU work on crash we have vmbus_wait_for_unload() function which checks message slots for all CPUs in a loop waiting for the 'unload finished' messages. However, there is an issue which arises when these conditions are met: - We're crashing on a CPU which is different from the one which was used to initially contact the hypervisor. - The CPU which was used for the initial contact is blocked with interrupts disabled and there is a message pending in the message slot. In this case we won't be able to read the 'unload finished' message on the crashing CPU. This is reproducible when we receive unknown NMIs on all CPUs simultaneously: the first CPU entering panic() will proceed to crash and all other CPUs will stop themselves with interrupts disabled. The suggested solution is to handle unknown NMIs for Hyper-V guests on the first CPU which gets them only. This will allow us to rely on VMBus interrupt handler being able to receive the 'unload finish' message in case it is delivered to a different CPU. The issue is not reproducible on WS2016 as Debug-VM delivers NMI to the boot CPU only, WS2012R2 and earlier Hyper-V versions are affected. Signed-off-by: Vitaly Kuznetsov Acked-by: K. Y. Srinivasan --- Changes since v3: - Rewrite the commit message. Hope it's more readable now... [Thomas Gleixner] --- arch/x86/kernel/cpu/mshyperv.c | 24 1 file changed, 24 insertions(+) diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c index 8f44c5a..f228f74 100644 --- a/arch/x86/kernel/cpu/mshyperv.c +++ b/arch/x86/kernel/cpu/mshyperv.c @@ -31,6 +31,7 @@ #include #include #include +#include struct ms_hyperv_info ms_hyperv; EXPORT_SYMBOL_GPL(ms_hyperv); @@ -158,6 +159,26 @@ static unsigned char hv_get_nmi_reason(void) return 0; } +#ifdef CONFIG_X86_LOCAL_APIC +/* + * Prior to WS2016 Debug-VM sends NMIs to all CPUs which makes + * it dificult to process CHANNELMSG_UNLOAD in case of crash. Handle + * unknown NMI on the first CPU which gets it. + */ +static int hv_nmi_unknown(unsigned int val, struct pt_regs *regs) +{ + static atomic_t nmi_cpu = ATOMIC_INIT(-1); + + if (!unknown_nmi_panic) + return NMI_DONE; + + if (atomic_cmpxchg(&nmi_cpu, -1, raw_smp_processor_id()) != -1) + return NMI_HANDLED; + + return NMI_DONE; +} +#endif + static void __init ms_hyperv_init_platform(void) { /* @@ -183,6 +204,9 @@ static void __init ms_hyperv_init_platform(void) pr_info("HyperV: LAPIC Timer Frequency: %#x\n", lapic_timer_frequency); } + + register_nmi_handler(NMI_UNKNOWN, hv_nmi_unknown, NMI_FLAG_FIRST, +"hv_nmi_unknown"); #endif if (ms_hyperv.features & HV_X64_MSR_TIME_REF_COUNT_AVAILABLE) -- 2.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: wlan-ng: hfa384x_usb.c Fixed too long code line warnings.
Remove initialization of usbin on its decarlation. Yan Laijun (1): Staging: wlan-ng: hfa384x_usb.c Fixed too long code line warnings. drivers/staging/wlan-ng/hfa384x_usb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging: wlan-ng: Fixed too long code line warnings.
Fixed checkpatch warning "line over 80 characters" in wlan-ng/hfa384x_usb.c file. Signed-off-by: Yan Laijun --- Changes in v2: - Remove initialization of usbin on its decarlation. --- drivers/staging/wlan-ng/hfa384x_usb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c index 5f11f6e..c7bda04 100644 --- a/drivers/staging/wlan-ng/hfa384x_usb.c +++ b/drivers/staging/wlan-ng/hfa384x_usb.c @@ -3037,7 +3037,7 @@ static void hfa384x_usbin_callback(struct urb *urb) { struct wlandevice *wlandev = urb->context; struct hfa384x *hw; - union hfa384x_usbin *usbin = (union hfa384x_usbin *)urb->transfer_buffer; + union hfa384x_usbin *usbin; struct sk_buff *skb = NULL; int result; int urb_status; @@ -3049,6 +3049,7 @@ static void hfa384x_usbin_callback(struct urb *urb) ABORT } action; + usbin = (union hfa384x_usbin *)urb->transfer_buffer; if (!wlandev || !wlandev->netdev || wlandev->hwremoved) goto exit; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 21/22 v2] staging/lustre/libcfs: Convert to hotplug state machine
From: Anna-Maria Gleixner Install the callbacks via the state machine. Cc: Oleg Drokin Cc: Andreas Dilger Cc: James Simmons Cc: Greg Kroah-Hartman Cc: lustre-de...@lists.lustre.org Cc: de...@driverdev.osuosl.org Signed-off-by: Anna-Maria Gleixner [bigeasy: rebase to linux-next] Signed-off-by: Sebastian Andrzej Siewior --- v1…v2: rebase to linux-next Side note: Is there a reason the handle the down state very late at CPU_DEAD time and use the counterpart of the online callback (the old CPU_DOWN_PREPARE state). .../staging/lustre/lnet/libcfs/linux/linux-cpu.c | 88 -- include/linux/cpuhotplug.h | 1 + 2 files changed, 49 insertions(+), 40 deletions(-) diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c index 6b9cf06e8df2..f70b7d16378c 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c @@ -75,6 +75,9 @@ struct cfs_cpt_data { }; static struct cfs_cpt_data cpt_data; +#ifdef CONFIG_HOTPLUG_CPU +static enum cpuhp_state lustre_cpu_online; +#endif static void cfs_node_to_cpumask(int node, cpumask_t *mask) @@ -967,48 +970,37 @@ cfs_cpt_table_create_pattern(char *pattern) } #ifdef CONFIG_HOTPLUG_CPU -static int -cfs_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) +static void cfs_cpu_incr_cpt_version(void) { - unsigned int cpu = (unsigned long)hcpu; - bool warn; - - switch (action) { - case CPU_DEAD: - case CPU_DEAD_FROZEN: - case CPU_ONLINE: - case CPU_ONLINE_FROZEN: - spin_lock(&cpt_data.cpt_lock); - cpt_data.cpt_version++; - spin_unlock(&cpt_data.cpt_lock); - /* Fall through */ - default: - if (action != CPU_DEAD && action != CPU_DEAD_FROZEN) { - CDEBUG(D_INFO, "CPU changed [cpu %u action %lx]\n", - cpu, action); - break; - } - - mutex_lock(&cpt_data.cpt_mutex); - /* if all HTs in a core are offline, it may break affinity */ - cpumask_copy(cpt_data.cpt_cpumask, -topology_sibling_cpumask(cpu)); - warn = cpumask_any_and(cpt_data.cpt_cpumask, - cpu_online_mask) >= nr_cpu_ids; - mutex_unlock(&cpt_data.cpt_mutex); - CDEBUG(warn ? D_WARNING : D_INFO, - "Lustre: can't support CPU plug-out well now, performance and stability could be impacted [CPU %u action: %lx]\n", - cpu, action); - } - - return NOTIFY_OK; + spin_lock(&cpt_data.cpt_lock); + cpt_data.cpt_version++; + spin_unlock(&cpt_data.cpt_lock); } -static struct notifier_block cfs_cpu_notifier = { - .notifier_call = cfs_cpu_notify, - .priority = 0 -}; +static int cfs_cpu_online(unsigned int cpu) +{ + cfs_cpu_incr_cpt_version(); + return 0; +} +static int cfs_cpu_dead(unsigned int cpu) +{ + bool warn; + + cfs_cpu_incr_cpt_version(); + + mutex_lock(&cpt_data.cpt_mutex); + /* if all HTs in a core are offline, it may break affinity */ + cpumask_copy(cpt_data.cpt_cpumask, +topology_sibling_cpumask(cpu)); + warn = cpumask_any_and(cpt_data.cpt_cpumask, + cpu_online_mask) >= nr_cpu_ids; + mutex_unlock(&cpt_data.cpt_mutex); + CDEBUG(warn ? D_WARNING : D_INFO, + "Lustre: can't support CPU plug-out well now, performance and stability could be impacted [CPU %u]\n", + cpu); + return 0; +} #endif void @@ -1018,7 +1010,9 @@ cfs_cpu_fini(void) cfs_cpt_table_free(cfs_cpt_table); #ifdef CONFIG_HOTPLUG_CPU - unregister_hotcpu_notifier(&cfs_cpu_notifier); + if (lustre_cpu_online) + cpuhp_remove_state_nocalls(lustre_cpu_online); + cpuhp_remove_state_nocalls(CPUHP_LUSTRE_CFS_DEAD); #endif if (cpt_data.cpt_cpumask) LIBCFS_FREE(cpt_data.cpt_cpumask, cpumask_size()); @@ -1027,6 +1021,10 @@ cfs_cpu_fini(void) int cfs_cpu_init(void) { +#ifdef CONFIG_HOTPLUG_CPU + int ret; +#endif + LASSERT(!cfs_cpt_table); memset(&cpt_data, 0, sizeof(cpt_data)); @@ -1041,7 +1039,17 @@ cfs_cpu_init(void) mutex_init(&cpt_data.cpt_mutex); #ifdef CONFIG_HOTPLUG_CPU - register_hotcpu_notifier(&cfs_cpu_notifier); + ret = cpuhp_setup_state_nocalls(CPUHP_LUSTRE_CFS_DEAD, + "staging/lustre/cfe:dead", NULL, + cfs_cpu_dead); + if (ret < 0) + goto failed; + ret = cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, + "staging/lustre/cfe:onl
Re: [PATCH 21/22 v2] staging/lustre/libcfs: Convert to hotplug state machine
On Fri, Dec 02, 2016 at 11:18:25AM +0100, Sebastian Andrzej Siewior wrote: > From: Anna-Maria Gleixner > > Install the callbacks via the state machine. > Cc: Oleg Drokin > Cc: Andreas Dilger > Cc: James Simmons > Cc: Greg Kroah-Hartman > Cc: lustre-de...@lists.lustre.org > Cc: de...@driverdev.osuosl.org > Signed-off-by: Anna-Maria Gleixner > [bigeasy: rebase to linux-next] > Signed-off-by: Sebastian Andrzej Siewior > --- > v1…v2: rebase to linux-next > > Side note: Is there a reason the handle the down state very late at > CPU_DEAD time and use the counterpart of the online callback (the old > CPU_DOWN_PREPARE state). You need a blank line before the cc: lines in your changelog please... thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] staging: wlan-ng: Fixed too long code line warnings.
On 12/02/2016 11:09 AM, Yan Laijun wrote: > Fixed checkpatch warning "line over 80 characters" in > wlan-ng/hfa384x_usb.c file. > > Signed-off-by: Yan Laijun > --- > Changes in v2: > - Remove initialization of usbin on its decarlation. > --- > drivers/staging/wlan-ng/hfa384x_usb.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c > b/drivers/staging/wlan-ng/hfa384x_usb.c > index 5f11f6e..c7bda04 100644 > --- a/drivers/staging/wlan-ng/hfa384x_usb.c > +++ b/drivers/staging/wlan-ng/hfa384x_usb.c > @@ -3037,7 +3037,7 @@ static void hfa384x_usbin_callback(struct urb *urb) > { > struct wlandevice *wlandev = urb->context; > struct hfa384x *hw; > - union hfa384x_usbin *usbin = (union hfa384x_usbin > *)urb->transfer_buffer; > + union hfa384x_usbin *usbin; > struct sk_buff *skb = NULL; > int result; > int urb_status; > @@ -3049,6 +3049,7 @@ static void hfa384x_usbin_callback(struct urb *urb) > ABORT > } action; > > + usbin = (union hfa384x_usbin *)urb->transfer_buffer; > if (!wlandev || !wlandev->netdev || wlandev->hwremoved) > goto exit; > > If you separate declaration and assignment of usbin, maybe it makes sense to move the assignment down to where usbin is used for the first time. Regards, Markus ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 21/22 v3] staging/lustre/libcfs: Convert to hotplug state machine
From: Anna-Maria Gleixner Install the callbacks via the state machine. Cc: Oleg Drokin Cc: Andreas Dilger Cc: James Simmons Cc: Greg Kroah-Hartman Cc: lustre-de...@lists.lustre.org Cc: de...@driverdev.osuosl.org Signed-off-by: Anna-Maria Gleixner [bigeasy: rebase to linux-next] Signed-off-by: Sebastian Andrzej Siewior --- v2…v3: add the missing blank before the Cc: lines. v1…v2: rebase to linux-next Side note: Is there a reason the handle the down state very late at CPU_DEAD time and use the counterpart of the online callback (the old CPU_DOWN_PREPARE state). .../staging/lustre/lnet/libcfs/linux/linux-cpu.c | 88 -- include/linux/cpuhotplug.h | 1 + 2 files changed, 49 insertions(+), 40 deletions(-) diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c index 6b9cf06e8df2..f70b7d16378c 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c @@ -75,6 +75,9 @@ struct cfs_cpt_data { }; static struct cfs_cpt_data cpt_data; +#ifdef CONFIG_HOTPLUG_CPU +static enum cpuhp_state lustre_cpu_online; +#endif static void cfs_node_to_cpumask(int node, cpumask_t *mask) @@ -967,48 +970,37 @@ cfs_cpt_table_create_pattern(char *pattern) } #ifdef CONFIG_HOTPLUG_CPU -static int -cfs_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) +static void cfs_cpu_incr_cpt_version(void) { - unsigned int cpu = (unsigned long)hcpu; - bool warn; - - switch (action) { - case CPU_DEAD: - case CPU_DEAD_FROZEN: - case CPU_ONLINE: - case CPU_ONLINE_FROZEN: - spin_lock(&cpt_data.cpt_lock); - cpt_data.cpt_version++; - spin_unlock(&cpt_data.cpt_lock); - /* Fall through */ - default: - if (action != CPU_DEAD && action != CPU_DEAD_FROZEN) { - CDEBUG(D_INFO, "CPU changed [cpu %u action %lx]\n", - cpu, action); - break; - } - - mutex_lock(&cpt_data.cpt_mutex); - /* if all HTs in a core are offline, it may break affinity */ - cpumask_copy(cpt_data.cpt_cpumask, -topology_sibling_cpumask(cpu)); - warn = cpumask_any_and(cpt_data.cpt_cpumask, - cpu_online_mask) >= nr_cpu_ids; - mutex_unlock(&cpt_data.cpt_mutex); - CDEBUG(warn ? D_WARNING : D_INFO, - "Lustre: can't support CPU plug-out well now, performance and stability could be impacted [CPU %u action: %lx]\n", - cpu, action); - } - - return NOTIFY_OK; + spin_lock(&cpt_data.cpt_lock); + cpt_data.cpt_version++; + spin_unlock(&cpt_data.cpt_lock); } -static struct notifier_block cfs_cpu_notifier = { - .notifier_call = cfs_cpu_notify, - .priority = 0 -}; +static int cfs_cpu_online(unsigned int cpu) +{ + cfs_cpu_incr_cpt_version(); + return 0; +} +static int cfs_cpu_dead(unsigned int cpu) +{ + bool warn; + + cfs_cpu_incr_cpt_version(); + + mutex_lock(&cpt_data.cpt_mutex); + /* if all HTs in a core are offline, it may break affinity */ + cpumask_copy(cpt_data.cpt_cpumask, +topology_sibling_cpumask(cpu)); + warn = cpumask_any_and(cpt_data.cpt_cpumask, + cpu_online_mask) >= nr_cpu_ids; + mutex_unlock(&cpt_data.cpt_mutex); + CDEBUG(warn ? D_WARNING : D_INFO, + "Lustre: can't support CPU plug-out well now, performance and stability could be impacted [CPU %u]\n", + cpu); + return 0; +} #endif void @@ -1018,7 +1010,9 @@ cfs_cpu_fini(void) cfs_cpt_table_free(cfs_cpt_table); #ifdef CONFIG_HOTPLUG_CPU - unregister_hotcpu_notifier(&cfs_cpu_notifier); + if (lustre_cpu_online) + cpuhp_remove_state_nocalls(lustre_cpu_online); + cpuhp_remove_state_nocalls(CPUHP_LUSTRE_CFS_DEAD); #endif if (cpt_data.cpt_cpumask) LIBCFS_FREE(cpt_data.cpt_cpumask, cpumask_size()); @@ -1027,6 +1021,10 @@ cfs_cpu_fini(void) int cfs_cpu_init(void) { +#ifdef CONFIG_HOTPLUG_CPU + int ret; +#endif + LASSERT(!cfs_cpt_table); memset(&cpt_data, 0, sizeof(cpt_data)); @@ -1041,7 +1039,17 @@ cfs_cpu_init(void) mutex_init(&cpt_data.cpt_mutex); #ifdef CONFIG_HOTPLUG_CPU - register_hotcpu_notifier(&cfs_cpu_notifier); + ret = cpuhp_setup_state_nocalls(CPUHP_LUSTRE_CFS_DEAD, + "staging/lustre/cfe:dead", NULL, + cfs_cpu_dead); + if (ret < 0) + goto failed; + ret = cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, +
Re: [PATCH v3 4/9] bus: fsl-mc: dpio: add frame descriptor and scatter/gather APIs
Some more bits and pieces inside. --- Best Regards, Laurentiu On 12/02/2016 12:41 AM, Stuart Yoder wrote: > From: Roy Pledge > > Add global definitions for DPAA2 frame descriptors and scatter > gather entries. > > Signed-off-by: Roy Pledge > Signed-off-by: Stuart Yoder > --- > > Notes: > -v3 >-no changes > -v2 >-added setter/getter for the FD ctrl field >-corrected comment for SG format_offset field description >-added support for short length field in FD > > include/linux/fsl/dpaa2-fd.h | 448 > +++ > 1 file changed, 448 insertions(+) > create mode 100644 include/linux/fsl/dpaa2-fd.h > > diff --git a/include/linux/fsl/dpaa2-fd.h b/include/linux/fsl/dpaa2-fd.h > new file mode 100644 > index 000..182c8f4 > --- /dev/null > +++ b/include/linux/fsl/dpaa2-fd.h > @@ -0,0 +1,448 @@ > +/* > + * Copyright 2014-2016 Freescale Semiconductor Inc. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions are > met: > + * * Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * * Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * * Neither the name of Freescale Semiconductor nor the > + * names of its contributors may be used to endorse or promote products > + * derived from this software without specific prior written > permission. > + * > + * ALTERNATIVELY, this software may be distributed under the terms of the > + * GNU General Public License ("GPL") as published by the Free Software > + * Foundation, either version 2 of that License or (at your option) any > + * later version. > + * > + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY > + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED > + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE > + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY > + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES > + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR > SERVICES; > + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED > AND > + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF > THIS > + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + */ > +#ifndef __FSL_DPAA2_FD_H > +#define __FSL_DPAA2_FD_H > + > +#include > + > +/** > + * DOC: DPAA2 FD - Frame Descriptor APIs for DPAA2 > + * > + * Frame Descriptors (FDs) are used to describe frame data in the DPAA2. > + * Frames can be enqueued and dequeued to Frame Queues (FQs) which are > consumed > + * by the various DPAA accelerators (WRIOP, SEC, PME, DCE) > + * > + * There are three types of frames: single, scatter gather, and frame lists. > + * > + * The set of APIs in this file must be used to create, manipulate and > + * query Frame Descriptors. > + */ > + > +/** > + * struct dpaa2_fd - Struct describing FDs > + * @words: for easier/faster copying the whole FD structure > + * @addr: address in the FD > + * @len: length in the FD > + * @bpid: buffer pool ID > + * @format_offset: format, offset, and short-length fields > + * @frc: frame context > + * @ctrl: control bits...including dd, sc, va, err, etc > + * @flc: flow context address > + * > + * This structure represents the basic Frame Descriptor used in the system. > + */ > +struct dpaa2_fd { > + union { > + u32 words[8]; > + struct dpaa2_fd_simple { > + __le64 addr; > + __le32 len; > + __le16 bpid; > + __le16 format_offset; > + __le32 frc; > + __le32 ctrl; > + __le64 flc; > + } simple; > + }; > +}; > + > +#define FD_SHORT_LEN_FLAG_MASK 0x1 > +#define FD_SHORT_LEN_FLAG_SHIFT 14 > +#define FD_SHORT_LEN_MASK 0x1 > +#define FD_OFFSET_MASK 0x0FFF > +#define FD_FORMAT_MASK 0x3 > +#define FD_FORMAT_SHIFT 12 > +#define SG_SHORT_LEN_FLAG_MASK 0x1 > +#define SG_SHORT_LEN_FLAG_SHIFT 14 > +#define SG_SHORT_LEN_MASK 0x1 > +#define SG_OFFSET_MASK 0x0FFF > +#define SG_FORMAT_MASK 0x3 > +#define SG_FORMAT_SHIFT 12 > +#define SG_BPID_MASK 0x3FFF > +#define SG_FINAL_FLAG_MASK 0x1 > +#define SG_FINAL_FLAG_SHIFT 15 We should align the values of these macros as we do in other places. > +enum dpaa2_fd_format { > + dpaa2_fd_single = 0, > + dpaa2_fd_list, > + d
Re: [PATCH v3 5/9] bus: fsl-mc: dpio: add global dpaa2 definitions
On 12/02/2016 12:41 AM, Stuart Yoder wrote: > From: Roy Pledge > > Create header for global dpaa2 definitions. Add definitions > for dequeue results. > > Signed-off-by: Roy Pledge > Signed-off-by: Stuart Yoder > --- > include/linux/fsl/dpaa2-global.h | 203 > +++ > 1 file changed, 203 insertions(+) > create mode 100644 include/linux/fsl/dpaa2-global.h > > diff --git a/include/linux/fsl/dpaa2-global.h > b/include/linux/fsl/dpaa2-global.h > new file mode 100644 > index 000..3ee3f29 > --- /dev/null > +++ b/include/linux/fsl/dpaa2-global.h > @@ -0,0 +1,203 @@ > +/* > + * Copyright 2014-2016 Freescale Semiconductor Inc. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions are > met: > + * * Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * * Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * * Neither the name of Freescale Semiconductor nor the > + * names of its contributors may be used to endorse or promote products > + * derived from this software without specific prior written > permission. > + * > + * ALTERNATIVELY, this software may be distributed under the terms of the > + * GNU General Public License ("GPL") as published by the Free Software > + * Foundation, either version 2 of that License or (at your option) any > + * later version. > + * > + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY > + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED > + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE > + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY > + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES > + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR > SERVICES; > + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED > AND > + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF > THIS > + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + */ > +#ifndef __FSL_DPAA2_GLOBAL_H > +#define __FSL_DPAA2_GLOBAL_H > + > +#include > +#include > +#include > + > +struct dpaa2_dq { > + union { > + struct common { > + u8 verb; > + u8 reserved[63]; > + } common; > + struct dq { > + u8 verb; > + u8 stat; > + __le16 seqnum; > + __le16 oprid; > + u8 reserved; > + u8 tok; > + __le32 fqid; > + u32 reserved2; > + __le32 fq_byte_cnt; > + __le32 fq_frm_cnt; > + __le64 fqd_ctx; > + u8 fd[32]; > + } dq; > + struct scn { > + u8 verb; > + u8 stat; > + u8 state; > + u8 reserved; > + __le32 rid_tok; > + __le64 ctx; > + } scn; > + }; > +}; > + > + Extra blank line. > +/* Parsing frame dequeue results */ > +/* FQ empty */ > +#define DPAA2_DQ_STAT_FQEMPTY 0x80 > +/* FQ held active */ > +#define DPAA2_DQ_STAT_HELDACTIVE0x40 > +/* FQ force eligible */ > +#define DPAA2_DQ_STAT_FORCEELIGIBLE 0x20 > +/* valid frame */ > +#define DPAA2_DQ_STAT_VALIDFRAME0x10 > +/* FQ ODP enable */ > +#define DPAA2_DQ_STAT_ODPVALID 0x04 > +/* volatile dequeue */ > +#define DPAA2_DQ_STAT_VOLATILE 0x02 > +/* volatile dequeue command is expired */ > +#define DPAA2_DQ_STAT_EXPIRED 0x01 > + > +#define DQ_FQID_MASK 0x00FF > +#define DQ_FRAME_COUNT_MASK 0x00FF We should have these 2 macro values aligned too. > +/** > + * dpaa2_dq_flags() - Get the stat field of dequeue response > + * @dq: the dequeue result. > + */ > +static inline u32 dpaa2_dq_flags(const struct dpaa2_dq *dq) > +{ > + return dq->dq.stat; > +} > + > +/** > + * dpaa2_dq_is_pull() - Check whether the dq response is from a pull > + * command. > + * @dq: the dequeue result > + * > + * Return 1 for volatile(pull) dequeue, 0 for static dequeue. > + */ > +static inline int dpaa2_dq_is_pull(const struct dpaa2_dq *dq) > +{ > + return (int)(dpaa2_dq_flags(dq) & DPAA2_DQ_STAT_VOLATILE); > +} > + > +/** > + * dpaa2_dq_is_pull_complete() - Check whether the pull command is completed. > + * @dq: the dequeue result > + * > + * Return bool
Re: [PATCH v3 6/9] bus: fsl-mc: dpio: add QBMan portal APIs for DPAA2
On 12/02/2016 12:41 AM, Stuart Yoder wrote: > From: Roy Pledge > > Add QBman APIs for frame queue and buffer pool operations. > > Signed-off-by: Roy Pledge > Signed-off-by: Haiying Wang > Signed-off-by: Stuart Yoder > --- > > Notes: > -v3 >-replace hardcoded dequeue token with a #define and check that > token when checking for a new result (bug fix suggested by > Ioana Radulescu) > -v2 >-fix bug in buffer release command, by setting bpid field >-handle error (NULL) return value from qbman_swp_mc_complete() >-error message cleanup >-fix bug in sending management commands where the verb was > properly initialized > > drivers/bus/fsl-mc/dpio/Makefile |2 +- > drivers/bus/fsl-mc/dpio/qbman-portal.c | 1028 > > drivers/bus/fsl-mc/dpio/qbman-portal.h | 464 ++ > 3 files changed, 1493 insertions(+), 1 deletion(-) > create mode 100644 drivers/bus/fsl-mc/dpio/qbman-portal.c > create mode 100644 drivers/bus/fsl-mc/dpio/qbman-portal.h > > diff --git a/drivers/bus/fsl-mc/dpio/Makefile > b/drivers/bus/fsl-mc/dpio/Makefile > index 128befc..6588498 100644 > --- a/drivers/bus/fsl-mc/dpio/Makefile > +++ b/drivers/bus/fsl-mc/dpio/Makefile > @@ -6,4 +6,4 @@ subdir-ccflags-y := -Werror > > obj-$(CONFIG_FSL_MC_DPIO) += fsl-mc-dpio.o > > -fsl-mc-dpio-objs := dpio.o > +fsl-mc-dpio-objs := dpio.o qbman-portal.o > diff --git a/drivers/bus/fsl-mc/dpio/qbman-portal.c > b/drivers/bus/fsl-mc/dpio/qbman-portal.c > new file mode 100644 > index 000..bbc032c > --- /dev/null > +++ b/drivers/bus/fsl-mc/dpio/qbman-portal.c > @@ -0,0 +1,1028 @@ > +/* > + * Copyright (C) 2014 Freescale Semiconductor, Inc. In previous patches the copyright years are 2014 - 2016. Maybe we should do the same here too. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions are > met: > + * * Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * * Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * * Neither the name of Freescale Semiconductor nor the > + * names of its contributors may be used to endorse or promote products > + * derived from this software without specific prior written > permission. > + * > + * ALTERNATIVELY, this software may be distributed under the terms of the > + * GNU General Public License ("GPL") as published by the Free Software > + * Foundation, either version 2 of that License or (at your option) any > + * later version. > + * > + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY > + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED > + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE > + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY > + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES > + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR > SERVICES; > + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED > AND > + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF > THIS > + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + */ > +#include > +#include > +#include > +#include > + > +#include "qbman-portal.h" > + > +#define QMAN_REV_4000 0x0400 > +#define QMAN_REV_4100 0x0401 > +#define QMAN_REV_4101 0x04010001 > + > +/* All QBMan command and result structures use this "valid bit" encoding */ > +#define QB_VALID_BIT ((u32)0x80) > + > +/* QBMan portal management command codes */ > +#define QBMAN_MC_ACQUIRE 0x30 > +#define QBMAN_WQCHAN_CONFIGURE 0x46 > + > +/* CINH register offsets */ > +#define QBMAN_CINH_SWP_EQAR0x8c0 > +#define QBMAN_CINH_SWP_DQPI0xa00 > +#define QBMAN_CINH_SWP_DCAP0xac0 > +#define QBMAN_CINH_SWP_SDQCR 0xb00 > +#define QBMAN_CINH_SWP_RAR 0xcc0 > +#define QBMAN_CINH_SWP_ISR 0xe00 > +#define QBMAN_CINH_SWP_IER 0xe40 > +#define QBMAN_CINH_SWP_ISDR0xe80 > +#define QBMAN_CINH_SWP_IIR 0xec0 > + > +/* CENA register offsets */ > +#define QBMAN_CENA_SWP_EQCR(n) (0x000 + ((u32)(n) << 6)) > +#define QBMAN_CENA_SWP_DQRR(n) (0x200 + ((u32)(n) << 6)) > +#define QBMAN_CENA_SWP_RCR(n) (0x400 + ((u32)(n) << 6)) > +#define QBMAN_CENA_SWP_CR 0x600 > +#define QBMAN_CENA_SWP_RR(vb) (0x700 + ((u32)(vb) >> 1)) > +#define QBMAN_CENA_SWP_VDQCR 0x780 > + > +/* Reverse mapping of QBMAN_CENA_SWP_DQRR() */ > +#define QBMAN_IDX_FROM_DQRR(p) (((unsigned long)
Re: [PATCH v3 7/9] bus: fsl-mc: dpio: add the DPAA2 DPIO service interface
On 12/02/2016 12:41 AM, Stuart Yoder wrote: > From: Roy Pledge > > The DPIO service interface handles initialization of DPIO objects > and exports APIs to be used by other DPAA2 object drivers to perform > queuing and buffer management related operations. The service allows > registration of callbacks when frames or notifications are received. > > Signed-off-by: Roy Pledge > Signed-off-by: Haiying Wang > Signed-off-by: Stuart Yoder > --- > > Notes: > -v3 >-zero memory allocated for a dpio store (bug fix suggested > by Ioana Radulescu) > -v2 >-use service_select_by_cpu() for re-arming DPIO interrupts >-replace use of NR_CPUS with num_possible_cpus() > > drivers/bus/fsl-mc/dpio/Makefile | 2 +- > drivers/bus/fsl-mc/dpio/dpio-service.c | 614 > + > include/linux/fsl/dpaa2-io.h | 138 > 3 files changed, 753 insertions(+), 1 deletion(-) > create mode 100644 drivers/bus/fsl-mc/dpio/dpio-service.c > create mode 100644 include/linux/fsl/dpaa2-io.h > > diff --git a/drivers/bus/fsl-mc/dpio/Makefile > b/drivers/bus/fsl-mc/dpio/Makefile > index 6588498..0778da7 100644 > --- a/drivers/bus/fsl-mc/dpio/Makefile > +++ b/drivers/bus/fsl-mc/dpio/Makefile > @@ -6,4 +6,4 @@ subdir-ccflags-y := -Werror > > obj-$(CONFIG_FSL_MC_DPIO) += fsl-mc-dpio.o > > -fsl-mc-dpio-objs := dpio.o qbman-portal.o > +fsl-mc-dpio-objs := dpio.o qbman-portal.o dpio-service.o > diff --git a/drivers/bus/fsl-mc/dpio/dpio-service.c > b/drivers/bus/fsl-mc/dpio/dpio-service.c > new file mode 100644 > index 000..01f0293 > --- /dev/null > +++ b/drivers/bus/fsl-mc/dpio/dpio-service.c > @@ -0,0 +1,614 @@ > +/* > + * Copyright 2014-2016 Freescale Semiconductor Inc. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions are > met: > + * * Redistributions of source code must retain the above copyright > + *notice, this list of conditions and the following disclaimer. > + * * Redistributions in binary form must reproduce the above copyright > + *notice, this list of conditions and the following disclaimer in the > + *documentation and/or other materials provided with the distribution. > + * * Neither the name of Freescale Semiconductor nor the > + *names of its contributors may be used to endorse or promote products > + *derived from this software without specific prior written permission. > + * > + * > + * ALTERNATIVELY, this software may be distributed under the terms of the > + * GNU General Public License ("GPL") as published by the Free Software > + * Foundation, either version 2 of that License or (at your option) any > + * later version. > + * > + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY > + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED > + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE > + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY > + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES > + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR > SERVICES; > + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED > AND > + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF > THIS > + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + */ > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include "dpio.h" > +#include "qbman-portal.h" > + > +struct dpaa2_io { > + atomic_t refs; > + struct dpaa2_io_desc dpio_desc; > + struct qbman_swp_desc swp_desc; > + struct qbman_swp *swp; > + struct list_head node; > + spinlock_t lock_mgmt_cmd; > + spinlock_t lock_notifications; > + struct list_head notifications; > +}; > + > +struct dpaa2_io_store { > + unsigned int max; > + dma_addr_t paddr; > + struct dpaa2_dq *vaddr; > + void *alloced_addr;/* unaligned value from kmalloc() */ > + unsigned int idx; /* position of the next-to-be-returned entry */ > + struct qbman_swp *swp; /* portal used to issue VDQCR */ > + struct device *dev;/* device used for DMA mapping */ > +}; > + > +/* keep a per cpu array of DPIOs for fast access */ > +static struct dpaa2_io *dpio_by_cpu[NR_CPUS]; > +static struct list_head dpio_list = LIST_HEAD_INIT(dpio_list); > +static DEFINE_SPINLOCK(dpio_list_lock); > + > +static inline struct dpaa2_io *service_select_by_cpu(struct dpaa2_io *d, > + int cpu) > +{ > + if (d) > + return d; > + > + if (unlikely(cpu >= num_possible_cpus())) > + return NULL; > + > + /* > + * If cpu =
Re: [PATCH v2 0/7] Tests for sync infrastructure
On 12/01/2016 06:17 PM, Shuah Khan wrote: > On 10/19/2016 06:49 AM, Emilio López wrote: >> Hello everyone, >> >> This is a series of tests to exercise the sync kernel infrastructure. It is >> meant to be a test suite for the work Gustavo has been doing to destage it. >> >> These tests were originally part of a battery of tests shipping with >> Android's libsync that were rewritten to use the new userspace interfaces. >> >> This is the second iteration of the test suite. Main changes over v1 are >> a reworked Makefile and small code style fixes. >> >> If you are testing this on v4.9-rc1, do note that the last test will >> currently fail due to a regression[0]. > > Hi Emilio, > > Thanks. I will apply these to linux-kselftest next for 4.10-rc1 > > -- Shuah >> >> As usual, all comments are welcome. >> Hi Emilio, Applied to linux-kselftest next. Could you take a look at the output and see if it can be refined. Does [BAD] mean the test failed? Results could refined to help user understand if a test failed or not clearly. This can be done in a separate patch as a fix in one of the 4.01-rcs thanks, -- Shuah ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 3/9] bus: fsl-mc: dpio: add APIs for DPIO objects
Couple of nits inline. --- Best Regards, Laurentiu On 12/02/2016 12:41 AM, Stuart Yoder wrote: > From: Ioana Radulescu > > Add the command build/parse APIs for operating on DPIO objects through > the DPAA2 Management Complex. > > Signed-off-by: Ioana Radulescu > Signed-off-by: Roy Pledge > Signed-off-by: Stuart Yoder > --- > > Notes: > -v3 > -no changes > -v2 > -removed unused structs and defines > > drivers/bus/fsl-mc/Kconfig | 10 ++ > drivers/bus/fsl-mc/Makefile| 3 + > drivers/bus/fsl-mc/dpio/Makefile | 9 ++ > drivers/bus/fsl-mc/dpio/dpio-cmd.h | 75 > drivers/bus/fsl-mc/dpio/dpio.c | 229 > + > drivers/bus/fsl-mc/dpio/dpio.h | 108 + > 6 files changed, 434 insertions(+) > create mode 100644 drivers/bus/fsl-mc/dpio/Makefile > create mode 100644 drivers/bus/fsl-mc/dpio/dpio-cmd.h > create mode 100644 drivers/bus/fsl-mc/dpio/dpio.c > create mode 100644 drivers/bus/fsl-mc/dpio/dpio.h > > diff --git a/drivers/bus/fsl-mc/Kconfig b/drivers/bus/fsl-mc/Kconfig > index 5c009ab..a10aaf0 100644 > --- a/drivers/bus/fsl-mc/Kconfig > +++ b/drivers/bus/fsl-mc/Kconfig > @@ -15,3 +15,13 @@ config FSL_MC_BUS > architecture. The fsl-mc bus driver handles discovery of > DPAA2 objects (which are represented as Linux devices) and > binding objects to drivers. > + > +config FSL_MC_DPIO > +tristate "QorIQ DPAA2 DPIO driver" > +depends on FSL_MC_BUS > +help > + Driver for the DPAA2 DPIO object. A DPIO provides queue and > + buffer management facilities for software to interact with > + other DPAA2 objects. This driver does not expose the DPIO > + objects individually, but groups them under a service layer > + API. > diff --git a/drivers/bus/fsl-mc/Makefile b/drivers/bus/fsl-mc/Makefile > index d56afee..d18df72 100644 > --- a/drivers/bus/fsl-mc/Makefile > +++ b/drivers/bus/fsl-mc/Makefile > @@ -17,3 +17,6 @@ mc-bus-driver-objs := fsl-mc-bus.o \ > fsl-mc-msi.o \ > dpmcp.o \ > dpbp.o > + > +# MC DPIO driver > +obj-$(CONFIG_FSL_MC_DPIO) += dpio/ > diff --git a/drivers/bus/fsl-mc/dpio/Makefile > b/drivers/bus/fsl-mc/dpio/Makefile > new file mode 100644 > index 000..128befc > --- /dev/null > +++ b/drivers/bus/fsl-mc/dpio/Makefile > @@ -0,0 +1,9 @@ > +# > +# QorIQ DPAA2 DPIO driver > +# > + > +subdir-ccflags-y := -Werror > + > +obj-$(CONFIG_FSL_MC_DPIO) += fsl-mc-dpio.o > + > +fsl-mc-dpio-objs := dpio.o > diff --git a/drivers/bus/fsl-mc/dpio/dpio-cmd.h > b/drivers/bus/fsl-mc/dpio/dpio-cmd.h > new file mode 100644 > index 000..3464ed9 > --- /dev/null > +++ b/drivers/bus/fsl-mc/dpio/dpio-cmd.h > @@ -0,0 +1,75 @@ > +/* > + * Copyright 2013-2016 Freescale Semiconductor Inc. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions are > met: > + * * Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * * Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * * Neither the name of the above-listed copyright holders nor the > + * names of any contributors may be used to endorse or promote products > + * derived from this software without specific prior written permission. > + * > + * ALTERNATIVELY, this software may be distributed under the terms of the > + * GNU General Public License ("GPL") as published by the Free Software > + * Foundation, either version 2 of that License or (at your option) any > + * later version. > + * > + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS > IS" > + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE > + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS > + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) > + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE > + * POSSIBILITY OF SUCH DAMAGE. > + */ > +#ifndef _FSL_DPIO_CMD_H > +#define _FSL_DPIO_CMD_H > + > +/* DPIO Version */ > +#define DPIO_VER_MAJOR 4 > +#define DPIO_VER_MINOR 2 > + > +/* Command Versioning */ > + > +#define DPIO_CMD_ID_OFFSET 4 > +#define DPIO_CMD_BASE_V
RE: [PATCH 02/15] hyperv: Add a function to detect hv_device
> -Original Message- > From: Greg KH [mailto:gre...@linuxfoundation.org] > Sent: Thursday, December 1, 2016 11:36 PM > To: KY Srinivasan > Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org; > o...@aepfle.de; a...@canonical.com; vkuzn...@redhat.com; > jasow...@redhat.com; leann.ogasaw...@canonical.com; Haiyang Zhang > > Subject: Re: [PATCH 02/15] hyperv: Add a function to detect hv_device > > On Fri, Dec 02, 2016 at 07:14:03AM +, KY Srinivasan wrote: > > > In other words, why do you need this and PCI or USB doesn't? Why is > > > hyperv "special"? > > > > On Hyper-V, each VF interface (SR-IOV interface) > > is paired with an instance of the > > synthetic interface that is managed by netvsc. > > When the VF interface comes up, we > > need to associate the VF instance with > > the corresponding netvsc instance. To do this > > without modifying the VF drivers, netvsc registers > > for netdev events. > > Why not modify the VF drivers? You have the full source to them... Greg, This is even worse. On Linux, VF drivers are hypervisor agnostic and I want to keep it that way. Regards, K. Y ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 02/15] hyperv: Add a function to detect hv_device
On Fri, Dec 02, 2016 at 03:38:51PM +, KY Srinivasan wrote: > > > > -Original Message- > > From: Greg KH [mailto:gre...@linuxfoundation.org] > > Sent: Thursday, December 1, 2016 11:36 PM > > To: KY Srinivasan > > Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org; > > o...@aepfle.de; a...@canonical.com; vkuzn...@redhat.com; > > jasow...@redhat.com; leann.ogasaw...@canonical.com; Haiyang Zhang > > > > Subject: Re: [PATCH 02/15] hyperv: Add a function to detect hv_device > > > > On Fri, Dec 02, 2016 at 07:14:03AM +, KY Srinivasan wrote: > > > > In other words, why do you need this and PCI or USB doesn't? Why is > > > > hyperv "special"? > > > > > > On Hyper-V, each VF interface (SR-IOV interface) > > > is paired with an instance of the > > > synthetic interface that is managed by netvsc. > > > When the VF interface comes up, we > > > need to associate the VF instance with > > > the corresponding netvsc instance. To do this > > > without modifying the VF drivers, netvsc registers > > > for netdev events. > > > > Why not modify the VF drivers? You have the full source to them... > Greg, > > This is even worse. On Linux, VF drivers are hypervisor agnostic > and I want to keep it that way. Ok, I really don't know what to suggest, other than this is probably not the way to do this as no other bus has to. As I don't see the code that actually uses this anywhere, it's really impossible to have this conversation at all :( greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: lustre: Fix a spatch warning due to an assignment from kernel to user space
lnet_ipif_enumerate was assigning a pointer from kernel space to user space. This patch uses copy_to_user to properly do that assignment. Signed-off-by: Quentin Lambert --- shouldn't we be using ifc_req instead of ifc_buf? drivers/staging/lustre/lnet/lnet/lib-socket.c |8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/drivers/staging/lustre/lnet/lnet/lib-socket.c +++ b/drivers/staging/lustre/lnet/lnet/lib-socket.c @@ -181,7 +181,13 @@ lnet_ipif_enumerate(char ***namesp) goto out0; } - ifc.ifc_buf = (char *)ifr; + rc = copy_to_user(ifc.ifc_buf, (char *)ifr, + nalloc * sizeof(*ifr)); + if (rc) { + rc = -ENOMEM; + goto out1; + } + ifc.ifc_len = nalloc * sizeof(*ifr); rc = lnet_sock_ioctl(SIOCGIFCONF, (unsigned long)&ifc); ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: wilc1000: fixed the wrong error code
in case of memory failure -ENOMEM should be returned. Signed-off-by: Atul Raj --- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 60d8b05..971956f 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -1642,7 +1642,7 @@ static int mgmt_tx(struct wiphy *wiphy, if (ieee80211_is_mgmt(mgmt->frame_control)) { mgmt_tx = kmalloc(sizeof(struct p2p_mgmt_data), GFP_KERNEL); if (!mgmt_tx) - return -EFAULT; + return -ENOMEM; mgmt_tx->buff = kmalloc(buf_len, GFP_KERNEL); if (!mgmt_tx->buff) { -- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: dgnc: Fix lines longer than 80 characters
For the first lines of the patch, I opted to create a small function instead of breaking the the line in a weird way. The other changes are simple ones. Signed-off-by: Fernando Apesteguia --- drivers/staging/dgnc/dgnc_tty.c | 42 + 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index af4bc86..835d448 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -102,6 +102,7 @@ static int dgnc_tty_write(struct tty_struct *tty, const unsigned char *buf, static void dgnc_tty_set_termios(struct tty_struct *tty, struct ktermios *old_termios); static void dgnc_tty_send_xchar(struct tty_struct *tty, char ch); +static void dgnc_keep_line_low(struct channel_t *ch, const unsigned char line); static const struct tty_operations dgnc_tty_ops = { .open = dgnc_tty_open, @@ -786,6 +787,12 @@ void dgnc_check_queue_flow_control(struct channel_t *ch) } } +static void dgnc_keep_line_low(struct channel_t *ch, const unsigned char line) +{ + ch->ch_mostat &= ~(line); + ch->ch_bd->bd_ops->assert_modem_signals(ch); +} + void dgnc_wakeup_writes(struct channel_t *ch) { int qlen = 0; @@ -823,19 +830,15 @@ void dgnc_wakeup_writes(struct channel_t *ch) * If RTS Toggle mode is on, whenever * the queue and UART is empty, keep RTS low. */ - if (ch->ch_digi.digi_flags & DIGI_RTS_TOGGLE) { - ch->ch_mostat &= ~(UART_MCR_RTS); - ch->ch_bd->bd_ops->assert_modem_signals(ch); - } + if (ch->ch_digi.digi_flags & DIGI_RTS_TOGGLE) + dgnc_keep_line_low(ch, UART_MCR_RTS); /* * If DTR Toggle mode is on, whenever * the queue and UART is empty, keep DTR low. */ - if (ch->ch_digi.digi_flags & DIGI_DTR_TOGGLE) { - ch->ch_mostat &= ~(UART_MCR_DTR); - ch->ch_bd->bd_ops->assert_modem_signals(ch); - } + if (ch->ch_digi.digi_flags & DIGI_DTR_TOGGLE) + dgnc_keep_line_low(ch, UART_MCR_DTR); } } @@ -969,8 +972,9 @@ static int dgnc_tty_open(struct tty_struct *tty, struct file *file) * touched safely, the close routine will signal the * ch_flags_wait to wake us back up. */ - rc = wait_event_interruptible(ch->ch_flags_wait, (((ch->ch_tun.un_flags | - ch->ch_pun.un_flags) & UN_CLOSING) == 0)); + rc = wait_event_interruptible(ch->ch_flags_wait, + (((ch->ch_tun.un_flags | + ch->ch_pun.un_flags) & UN_CLOSING) == 0)); /* If ret is non-zero, user ctrl-c'ed us */ if (rc) @@ -1188,11 +1192,12 @@ static int dgnc_block_til_ready(struct tty_struct *tty, */ if (sleep_on_un_flags) retval = wait_event_interruptible - (un->un_flags_wait, (old_flags != (ch->ch_tun.un_flags | - ch->ch_pun.un_flags))); + (un->un_flags_wait, +(old_flags != (ch->ch_tun.un_flags | + ch->ch_pun.un_flags))); else retval = wait_event_interruptible(ch->ch_flags_wait, - (old_flags != ch->ch_flags)); + (old_flags != ch->ch_flags)); /* * We got woken up for some reason. @@ -2511,13 +2516,15 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, if (ch->ch_tun.un_flags & (UN_LOW | UN_EMPTY)) { ch->ch_tun.un_flags &= ~(UN_LOW | UN_EMPTY); - wake_up_interruptible(&ch->ch_tun.un_flags_wait); + wake_up_interruptible(&ch->ch_tun + .un_flags_wait); } if (ch->ch_pun.un_flags & (UN_LOW | UN_EMPTY)) { ch->ch_pun.un_flags &= ~(UN_LOW | UN_EMPTY);
[PATCH] staging: dgnc: fix unnamed parameter
This patch fixes a checkpatch warning. Signed-off-by: Fernando Apesteguia --- drivers/staging/dgnc/dgnc_tty.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_tty.h b/drivers/staging/dgnc/dgnc_tty.h index 85a1310..1ee0eee 100644 --- a/drivers/staging/dgnc/dgnc_tty.h +++ b/drivers/staging/dgnc/dgnc_tty.h @@ -21,9 +21,9 @@ intdgnc_tty_register(struct dgnc_board *brd); void dgnc_tty_unregister(struct dgnc_board *brd); -int dgnc_tty_init(struct dgnc_board *); +int dgnc_tty_init(struct dgnc_board *brd); -void dgnc_cleanup_tty(struct dgnc_board *); +void dgnc_cleanup_tty(struct dgnc_board *brd); void dgnc_input(struct channel_t *ch); void dgnc_carrier(struct channel_t *ch); -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/6] Fix ups to make lustre_idl.h a proper UAPI header
The header lustre_idl.h is a UAPI header which contains extras that don't belong. This patch set moves a bunch of very kernel specific material out of the header. Lastly proper byteorder functions are used so this file can build in user space as well. Ben Evans (5): staging: lustre: headers: move swab functions to new header files staging: lustre: headers: sort headers affected by swab move staging: lustre: obdclass: Create a header for obdo related functions staging: lustre: headers: sort headers affected by obdo move staging: lustre: headers: Move functions out of lustre_idl.h James Simmons (1): staging: lustre: headers: use proper byteorder functions in lustre_idl.h drivers/staging/lustre/lustre/include/llog_swab.h | 65 + .../staging/lustre/lustre/include/lprocfs_status.h |2 + .../lustre/lustre/include/lustre/lustre_idl.h | 289 ++-- .../lustre/lustre/include/lustre/lustre_user.h |2 - drivers/staging/lustre/lustre/include/lustre_dlm.h | 13 + .../staging/lustre/lustre/include/lustre_obdo.h| 54 drivers/staging/lustre/lustre/include/lustre_sec.h |1 + .../staging/lustre/lustre/include/lustre_swab.h| 108 drivers/staging/lustre/lustre/ldlm/ldlm_internal.h |6 + drivers/staging/lustre/lustre/ldlm/ldlm_lock.c |1 + drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 27 ++ drivers/staging/lustre/lustre/llite/dir.c |2 + drivers/staging/lustre/lustre/llite/file.c |1 + drivers/staging/lustre/lustre/lov/lov_obd.c| 18 +- drivers/staging/lustre/lustre/lov/lov_pack.c |7 +- drivers/staging/lustre/lustre/mdc/mdc_lib.c|6 + drivers/staging/lustre/lustre/mdc/mdc_locks.c |4 +- drivers/staging/lustre/lustre/mdc/mdc_request.c| 13 +- drivers/staging/lustre/lustre/mgc/mgc_request.c|8 +- drivers/staging/lustre/lustre/obdclass/llog.c |3 +- drivers/staging/lustre/lustre/obdclass/llog_swab.c |1 + .../staging/lustre/lustre/obdclass/obd_config.c|7 +- drivers/staging/lustre/lustre/obdclass/obdo.c | 54 drivers/staging/lustre/lustre/osc/osc_io.c |2 + drivers/staging/lustre/lustre/osc/osc_request.c| 13 +- drivers/staging/lustre/lustre/ptlrpc/layout.c | 12 +- .../staging/lustre/lustre/ptlrpc/pack_generic.c|9 +- 27 files changed, 430 insertions(+), 298 deletions(-) create mode 100644 drivers/staging/lustre/lustre/include/llog_swab.h create mode 100644 drivers/staging/lustre/lustre/include/lustre_obdo.h create mode 100644 drivers/staging/lustre/lustre/include/lustre_swab.h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 6/6] staging: lustre: headers: use proper byteorder functions in lustre_idl.h
In order for lustre_idl.h to be usable for both user land and kernel space it has to use the proper byteorder functions. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245 Reviewed-on: http://review.whamcloud.com/16916 Reviewed-by: Frank Zago Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin Reviewed-by: John L. Hammond Signed-off-by: James Simmons --- .../lustre/lustre/include/lustre/lustre_idl.h | 55 ++- 1 files changed, 29 insertions(+), 26 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h index b0fef6d..c207ad6 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h @@ -69,6 +69,9 @@ #ifndef _LUSTRE_IDL_H_ #define _LUSTRE_IDL_H_ +#include +#include + #include "../../../include/linux/libcfs/libcfs.h" #include "../../../include/linux/lnet/types.h" @@ -687,30 +690,30 @@ static inline void lu_igif_build(struct lu_fid *fid, __u32 ino, __u32 gen) */ static inline void fid_cpu_to_le(struct lu_fid *dst, const struct lu_fid *src) { - dst->f_seq = cpu_to_le64(fid_seq(src)); - dst->f_oid = cpu_to_le32(fid_oid(src)); - dst->f_ver = cpu_to_le32(fid_ver(src)); + dst->f_seq = __cpu_to_le64(fid_seq(src)); + dst->f_oid = __cpu_to_le32(fid_oid(src)); + dst->f_ver = __cpu_to_le32(fid_ver(src)); } static inline void fid_le_to_cpu(struct lu_fid *dst, const struct lu_fid *src) { - dst->f_seq = le64_to_cpu(fid_seq(src)); - dst->f_oid = le32_to_cpu(fid_oid(src)); - dst->f_ver = le32_to_cpu(fid_ver(src)); + dst->f_seq = __le64_to_cpu(fid_seq(src)); + dst->f_oid = __le32_to_cpu(fid_oid(src)); + dst->f_ver = __le32_to_cpu(fid_ver(src)); } static inline void fid_cpu_to_be(struct lu_fid *dst, const struct lu_fid *src) { - dst->f_seq = cpu_to_be64(fid_seq(src)); - dst->f_oid = cpu_to_be32(fid_oid(src)); - dst->f_ver = cpu_to_be32(fid_ver(src)); + dst->f_seq = __cpu_to_be64(fid_seq(src)); + dst->f_oid = __cpu_to_be32(fid_oid(src)); + dst->f_ver = __cpu_to_be32(fid_ver(src)); } static inline void fid_be_to_cpu(struct lu_fid *dst, const struct lu_fid *src) { - dst->f_seq = be64_to_cpu(fid_seq(src)); - dst->f_oid = be32_to_cpu(fid_oid(src)); - dst->f_ver = be32_to_cpu(fid_ver(src)); + dst->f_seq = __be64_to_cpu(fid_seq(src)); + dst->f_oid = __be32_to_cpu(fid_oid(src)); + dst->f_ver = __be32_to_cpu(fid_ver(src)); } static inline bool fid_is_sane(const struct lu_fid *fid) @@ -747,8 +750,8 @@ static inline void ostid_cpu_to_le(const struct ost_id *src_oi, struct ost_id *dst_oi) { if (fid_seq_is_mdt0(ostid_seq(src_oi))) { - dst_oi->oi.oi_id = cpu_to_le64(src_oi->oi.oi_id); - dst_oi->oi.oi_seq = cpu_to_le64(src_oi->oi.oi_seq); + dst_oi->oi.oi_id = __cpu_to_le64(src_oi->oi.oi_id); + dst_oi->oi.oi_seq = __cpu_to_le64(src_oi->oi.oi_seq); } else { fid_cpu_to_le(&dst_oi->oi_fid, &src_oi->oi_fid); } @@ -758,8 +761,8 @@ static inline void ostid_le_to_cpu(const struct ost_id *src_oi, struct ost_id *dst_oi) { if (fid_seq_is_mdt0(ostid_seq(src_oi))) { - dst_oi->oi.oi_id = le64_to_cpu(src_oi->oi.oi_id); - dst_oi->oi.oi_seq = le64_to_cpu(src_oi->oi.oi_seq); + dst_oi->oi.oi_id = __le64_to_cpu(src_oi->oi.oi_id); + dst_oi->oi.oi_seq = __le64_to_cpu(src_oi->oi.oi_seq); } else { fid_le_to_cpu(&dst_oi->oi_fid, &src_oi->oi_fid); } @@ -866,7 +869,7 @@ enum lu_dirpage_flags { static inline struct lu_dirent *lu_dirent_start(struct lu_dirpage *dp) { - if (le32_to_cpu(dp->ldp_flags) & LDF_EMPTY) + if (__le32_to_cpu(dp->ldp_flags) & LDF_EMPTY) return NULL; else return dp->ldp_entries; @@ -876,8 +879,8 @@ enum lu_dirpage_flags { { struct lu_dirent *next; - if (le16_to_cpu(ent->lde_reclen) != 0) - next = ((void *)ent) + le16_to_cpu(ent->lde_reclen); + if (__le16_to_cpu(ent->lde_reclen) != 0) + next = ((void *)ent) + __le16_to_cpu(ent->lde_reclen); else next = NULL; @@ -1438,15 +1441,15 @@ static inline __u64 lmm_oi_seq(const struct ost_id *oi) static inline void lmm_oi_le_to_cpu(struct ost_id *dst_oi, const struct ost_id *src_oi) { - dst_oi->oi.oi_id = le64_to_cpu(src_oi->oi.oi_id); - dst_oi->oi.oi_seq = le64_to_cpu(src_oi->oi.oi_seq); + dst_oi->oi.oi_id = __le64_to_cpu(src_oi->oi.oi_id); + dst_oi->oi.oi_seq = __le64_to_cpu(src_oi->oi.oi_seq); } static inline void lmm_oi_cpu_to_le(struct ost_id *d
[PATCH 5/6] staging: lustre: headers: Move functions out of lustre_idl.h
From: Ben Evans Migrate functions set/get_mrc_cr_flags, ldlm_res_eq ldlm_extent_overlap, ldlm_extent_contain, ldlm_request_bufsize, and alll the PTLRPC dump_* functions out of lustre_idl.h which is a UAPI header to the places in the kernel code they are actually used. Delete unused lmv_mds_md_stripe_count and agent_req_in_final_state. Signed-off-by: Ben Evans Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: http://review.whamcloud.com/21484 Reviewed-by: Frank Zago Reviewed-by: James Simmons Reviewed-by: Andreas Dilger Reviewed-by: John L. Hammond Signed-off-by: James Simmons --- .../lustre/lustre/include/lustre/lustre_idl.h | 73 drivers/staging/lustre/lustre/include/lustre_dlm.h | 13 .../staging/lustre/lustre/include/lustre_swab.h|6 ++ drivers/staging/lustre/lustre/ldlm/ldlm_internal.h |6 ++ drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 27 +++ drivers/staging/lustre/lustre/mdc/mdc_lib.c|6 ++ 6 files changed, 58 insertions(+), 73 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h index 52bef77..b0fef6d 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h @@ -2126,17 +2126,6 @@ struct mdt_rec_create { __u32 cr_padding_4; /* rr_padding_4 */ }; -static inline void set_mrc_cr_flags(struct mdt_rec_create *mrc, __u64 flags) -{ - mrc->cr_flags_l = (__u32)(flags & 0xUll); - mrc->cr_flags_h = (__u32)(flags >> 32); -} - -static inline __u64 get_mrc_cr_flags(struct mdt_rec_create *mrc) -{ - return ((__u64)(mrc->cr_flags_l) | ((__u64)mrc->cr_flags_h << 32)); -} - /* instance of mdt_reint_rec */ struct mdt_rec_link { __u32 lk_opcode; @@ -2399,25 +2388,6 @@ static inline int lmv_mds_md_stripe_count_get(const union lmv_mds_md *lmm) } } -static inline int lmv_mds_md_stripe_count_set(union lmv_mds_md *lmm, - unsigned int stripe_count) -{ - int rc = 0; - - switch (le32_to_cpu(lmm->lmv_magic)) { - case LMV_MAGIC_V1: - lmm->lmv_md_v1.lmv_stripe_count = cpu_to_le32(stripe_count); - break; - case LMV_USER_MAGIC: - lmm->lmv_user_md.lum_stripe_count = cpu_to_le32(stripe_count); - break; - default: - rc = -EINVAL; - break; - } - return rc; -} - enum fld_rpc_opc { FLD_QUERY = 900, FLD_READ= 901, @@ -2498,12 +2468,6 @@ struct ldlm_res_id { #define PLDLMRES(res) (res)->lr_name.name[0], (res)->lr_name.name[1], \ (res)->lr_name.name[2], (res)->lr_name.name[3] -static inline bool ldlm_res_eq(const struct ldlm_res_id *res0, - const struct ldlm_res_id *res1) -{ - return !memcmp(res0, res1, sizeof(*res0)); -} - /* lock types */ enum ldlm_mode { LCK_MINMODE = 0, @@ -2536,19 +2500,6 @@ struct ldlm_extent { __u64 gid; }; -static inline int ldlm_extent_overlap(const struct ldlm_extent *ex1, - const struct ldlm_extent *ex2) -{ - return (ex1->start <= ex2->end) && (ex2->start <= ex1->end); -} - -/* check if @ex1 contains @ex2 */ -static inline int ldlm_extent_contain(const struct ldlm_extent *ex1, - const struct ldlm_extent *ex2) -{ - return (ex1->start <= ex2->start) && (ex1->end >= ex2->end); -} - struct ldlm_inodebits { __u64 bits; }; @@ -2623,18 +2574,6 @@ struct ldlm_request { struct lustre_handle lock_handle[LDLM_LOCKREQ_HANDLES]; }; -/* If LDLM_ENQUEUE, 1 slot is already occupied, 1 is available. - * Otherwise, 2 are available. - */ -#define ldlm_request_bufsize(count, type) \ -({ \ - int _avail = LDLM_LOCKREQ_HANDLES;\ - _avail -= (type == LDLM_ENQUEUE ? LDLM_ENQUEUE_CANCEL_OFF : 0); \ - sizeof(struct ldlm_request) + \ - (count > _avail ? count - _avail : 0) * \ - sizeof(struct lustre_handle); \ -}) - struct ldlm_reply { __u32 lock_flags; __u32 lock_padding; /* also fix lustre_swab_ldlm_reply */ @@ -2938,12 +2877,6 @@ enum agent_req_status { } } -static inline bool agent_req_in_final_state(enum agent_req_status ars) -{ - return ((ars == ARS_SUCCEED) || (ars == ARS_FAILED) || - (ars == ARS_CANCELED)); -} - struct llog_agent_req_rec { struct llog_rec_hdr arr_hdr;/**< record header */ __u32 arr_status; /**< status of the request */ @@ -3138,12 +3071,6 @@ struct ll_fiemap_info_key {
[PATCH 3/6] staging: lustre: obdclass: Create a header for obdo related functions
From: Ben Evans Remove all obdo related functions from lustre_idl.h Create lustre_odbo.h. Include where appropriate. Make the functions lustre_get_wire_obdo and lustre_set_wire_obdo to not be inlined functions. Signed-off-by: Ben Evans Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: http://review.whamcloud.com/16917 Reviewed-on: http://review.whamcloud.com/19266 Reviewed-by: James Simmons Reviewed-by: Andreas Dilger Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../lustre/lustre/include/lustre/lustre_idl.h | 46 - .../staging/lustre/lustre/include/lustre_obdo.h| 54 drivers/staging/lustre/lustre/obdclass/obdo.c | 54 drivers/staging/lustre/lustre/osc/osc_io.c |2 + 4 files changed, 110 insertions(+), 46 deletions(-) create mode 100644 drivers/staging/lustre/lustre/include/lustre_obdo.h diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h index 6831e4d..52bef77 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h @@ -3126,52 +3126,6 @@ struct obdo { #define o_cksum o_nlink #define o_grant_used o_data_version -static inline void lustre_set_wire_obdo(const struct obd_connect_data *ocd, - struct obdo *wobdo, - const struct obdo *lobdo) -{ - *wobdo = *lobdo; - wobdo->o_flags &= ~OBD_FL_LOCAL_MASK; - if (!ocd) - return; - - if (unlikely(!(ocd->ocd_connect_flags & OBD_CONNECT_FID)) && - fid_seq_is_echo(ostid_seq(&lobdo->o_oi))) { - /* Currently OBD_FL_OSTID will only be used when 2.4 echo -* client communicate with pre-2.4 server -*/ - wobdo->o_oi.oi.oi_id = fid_oid(&lobdo->o_oi.oi_fid); - wobdo->o_oi.oi.oi_seq = fid_seq(&lobdo->o_oi.oi_fid); - } -} - -static inline void lustre_get_wire_obdo(const struct obd_connect_data *ocd, - struct obdo *lobdo, - const struct obdo *wobdo) -{ - __u32 local_flags = 0; - - if (lobdo->o_valid & OBD_MD_FLFLAGS) - local_flags = lobdo->o_flags & OBD_FL_LOCAL_MASK; - - *lobdo = *wobdo; - if (local_flags != 0) { - lobdo->o_valid |= OBD_MD_FLFLAGS; - lobdo->o_flags &= ~OBD_FL_LOCAL_MASK; - lobdo->o_flags |= local_flags; - } - if (!ocd) - return; - - if (unlikely(!(ocd->ocd_connect_flags & OBD_CONNECT_FID)) && - fid_seq_is_echo(wobdo->o_oi.oi.oi_seq)) { - /* see above */ - lobdo->o_oi.oi_fid.f_seq = wobdo->o_oi.oi.oi_seq; - lobdo->o_oi.oi_fid.f_oid = wobdo->o_oi.oi.oi_id; - lobdo->o_oi.oi_fid.f_ver = 0; - } -} - /* request structure for OST's */ struct ost_body { struct obdo oa; diff --git a/drivers/staging/lustre/lustre/include/lustre_obdo.h b/drivers/staging/lustre/lustre/include/lustre_obdo.h new file mode 100644 index 000..1e12f8c --- /dev/null +++ b/drivers/staging/lustre/lustre/include/lustre_obdo.h @@ -0,0 +1,54 @@ +/* + * GPL HEADER START + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 only, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License version 2 for more details (a copy is included + * in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU General Public License + * version 2 along with this program; If not, see + * http://www.gnu.org/licenses/gpl-2.0.html + * + * GPL HEADER END + */ +/* + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Use is subject to license terms. + * + * Copyright (c) 2011, 2014, Intel Corporation. + * + * Copyright 2015 Cray Inc, all rights reserved. + * Author: Ben Evans. + * + * Define obdo associated functions + * obdo: OBject Device o... + */ + +#ifndef _LUSTRE_OBDO_H_ +#define _LUSTRE_OBDO_H_ + +#include "lustre/lustre_idl.h" + +/** + * Create an obdo to send over the wire + */ +void lustre_set_wire_obdo(const struct obd_connect_data *ocd, + struct obdo *wobdo, + const struct obdo *lobdo); + +/** + * Create a local obdo from a wire based odbo + */ +void lustre_get_wire_obdo(const struct obd_connect_data *ocd, +
[PATCH 1/6] staging: lustre: headers: move swab functions to new header files
From: Ben Evans Create headers for pack_generic.c and llog_swab.c Reference only where needed. This separates out the kernel only code from lustre_idl.h that is an UAPI header. Signed-off-by: Ben Evans Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: http://review.whamcloud.com/16339 Reviewed-by: John L. Hammond Reviewed-by: Andreas Dilger Reviewed-by: James Simmons Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/llog_swab.h | 65 +++ .../staging/lustre/lustre/include/lprocfs_status.h |2 + .../lustre/lustre/include/lustre/lustre_idl.h | 115 +--- .../lustre/lustre/include/lustre/lustre_user.h |2 - drivers/staging/lustre/lustre/include/lustre_sec.h |1 + .../staging/lustre/lustre/include/lustre_swab.h| 102 + drivers/staging/lustre/lustre/ldlm/ldlm_lock.c |1 + drivers/staging/lustre/lustre/llite/dir.c |2 + drivers/staging/lustre/lustre/llite/file.c |1 + drivers/staging/lustre/lustre/lov/lov_obd.c|1 + drivers/staging/lustre/lustre/lov/lov_pack.c |1 + drivers/staging/lustre/lustre/mdc/mdc_locks.c |4 +- drivers/staging/lustre/lustre/mdc/mdc_request.c|2 + drivers/staging/lustre/lustre/mgc/mgc_request.c|1 + drivers/staging/lustre/lustre/obdclass/llog.c |1 + drivers/staging/lustre/lustre/obdclass/llog_swab.c |1 + .../staging/lustre/lustre/obdclass/obd_config.c|1 + drivers/staging/lustre/lustre/ptlrpc/layout.c |2 + .../staging/lustre/lustre/ptlrpc/pack_generic.c|2 + 19 files changed, 190 insertions(+), 117 deletions(-) create mode 100644 drivers/staging/lustre/lustre/include/llog_swab.h create mode 100644 drivers/staging/lustre/lustre/include/lustre_swab.h diff --git a/drivers/staging/lustre/lustre/include/llog_swab.h b/drivers/staging/lustre/lustre/include/llog_swab.h new file mode 100644 index 000..fd7ffb1 --- /dev/null +++ b/drivers/staging/lustre/lustre/include/llog_swab.h @@ -0,0 +1,65 @@ +/* + * GPL HEADER START + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 only, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License version 2 for more details (a copy is included + * in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU General Public License + * version 2 along with this program; If not, see + * http://www.gnu.org/licenses/gpl-2.0.html + * + * GPL HEADER END + */ +/* + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Use is subject to license terms. + * + * Copyright (c) 2011, 2014, Intel Corporation. + * + * Copyright 2015 Cray Inc, all rights reserved. + * Author: Ben Evans. + * + * We assume all nodes are either little-endian or big-endian, and we + * always send messages in the sender's native format. The receiver + * detects the message format by checking the 'magic' field of the message + * (see lustre_msg_swabbed() below). + * + * Each type has corresponding 'lustre_swab_xxxtypexxx()' routines + * are implemented in ptlrpc/pack_generic.c. These 'swabbers' convert the + * type from "other" endian, in-place in the message buffer. + * + * A swabber takes a single pointer argument. The caller must already have + * verified that the length of the message buffer >= sizeof (type). + * + * For variable length types, a second 'lustre_swab_v_xxxtypexxx()' routine + * may be defined that swabs just the variable part, after the caller has + * verified that the message buffer is large enough. + */ + +#ifndef _LLOG_SWAB_H_ +#define _LLOG_SWAB_H_ + +#include "lustre/lustre_idl.h" +struct lustre_cfg; + +void lustre_swab_lu_fid(struct lu_fid *fid); +void lustre_swab_ost_id(struct ost_id *oid); +void lustre_swab_llogd_body(struct llogd_body *d); +void lustre_swab_llog_hdr(struct llog_log_hdr *h); +void lustre_swab_llogd_conn_body(struct llogd_conn_body *d); +void lustre_swab_llog_rec(struct llog_rec_hdr *rec); +void lustre_swab_lu_seq_range(struct lu_seq_range *range); +void lustre_swab_lustre_cfg(struct lustre_cfg *lcfg); +void lustre_swab_cfg_marker(struct cfg_marker *marker, + int swab, int size); + +#endif diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h index cc0713e..d0a32d2 100644 --- a/drivers/staging/lustre/lustre/include/lprocfs_status.h +++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h @@ -43,6 +43,8 @@ #include #include +#include "
[PATCH 4/6] staging: lustre: headers: sort headers affected by obdo move
From: Ben Evans It was found if you sort the headers alphabetically that it reduced patch conflicts. This patch sorts the headers alphabetically and also place linux header first, then uapi header and finally the lustre kernel headers. Signed-off-by: Ben Evans Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: http://review.whamcloud.com/16917 Reviewed-on: http://review.whamcloud.com/19266 Reviewed-by: James Simmons Reviewed-by: Andreas Dilger Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/osc/osc_request.c | 13 +++-- 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c b/drivers/staging/lustre/lustre/osc/osc_request.c index 4d4d3eb..f2365b9 100644 --- a/drivers/staging/lustre/lustre/osc/osc_request.c +++ b/drivers/staging/lustre/lustre/osc/osc_request.c @@ -34,19 +34,20 @@ #include "../../include/linux/libcfs/libcfs.h" -#include "../include/lustre_dlm.h" -#include "../include/lustre_net.h" #include "../include/lustre/lustre_user.h" -#include "../include/obd_cksum.h" +#include "../include/lustre/lustre_ioctl.h" -#include "../include/lustre_ha.h" #include "../include/lprocfs_status.h" -#include "../include/lustre/lustre_ioctl.h" #include "../include/lustre_debug.h" -#include "../include/lustre_param.h" #include "../include/lustre_fid.h" +#include "../include/lustre_ha.h" +#include "../include/lustre_obdo.h" +#include "../include/lustre_param.h" + +#include "../include/obd_cksum.h" #include "../include/obd_class.h" #include "../include/obd.h" + #include "osc_internal.h" #include "osc_cl_internal.h" -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/6] staging: lustre: headers: sort headers affected by swab move
From: Ben Evans It was found if you sort the headers alphabetically that it reduced patch conflicts. This patch sorts the headers alphabetically and also place linux header first, then uapi header and finally the lustre kernel headers. Signed-off-by: Ben Evans Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: http://review.whamcloud.com/16339 Reviewed-by: John L. Hammond Reviewed-by: Andreas Dilger Reviewed-by: James Simmons Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/lov/lov_obd.c| 17 + drivers/staging/lustre/lustre/lov/lov_pack.c |6 -- drivers/staging/lustre/lustre/mdc/mdc_request.c| 11 ++- drivers/staging/lustre/lustre/mgc/mgc_request.c|7 --- drivers/staging/lustre/lustre/obdclass/llog.c |2 +- .../staging/lustre/lustre/obdclass/obd_config.c|6 -- drivers/staging/lustre/lustre/ptlrpc/layout.c | 14 ++ .../staging/lustre/lustre/ptlrpc/pack_generic.c|7 --- 8 files changed, 38 insertions(+), 32 deletions(-) diff --git a/drivers/staging/lustre/lustre/lov/lov_obd.c b/drivers/staging/lustre/lustre/lov/lov_obd.c index b236e93..63b0645 100644 --- a/drivers/staging/lustre/lustre/lov/lov_obd.c +++ b/drivers/staging/lustre/lustre/lov/lov_obd.c @@ -40,19 +40,20 @@ #define DEBUG_SUBSYSTEM S_LOV #include "../../include/linux/libcfs/libcfs.h" -#include "../include/obd_support.h" -#include "../include/lustre/lustre_ioctl.h" -#include "../include/lustre_lib.h" -#include "../include/lustre_net.h" #include "../include/lustre/lustre_idl.h" +#include "../include/lustre/lustre_ioctl.h" + +#include "../include/cl_object.h" #include "../include/lustre_dlm.h" +#include "../include/lustre_fid.h" +#include "../include/lustre_lib.h" #include "../include/lustre_mds.h" -#include "../include/obd_class.h" +#include "../include/lustre_net.h" +#include "../include/lustre_param.h" #include "../include/lustre_swab.h" #include "../include/lprocfs_status.h" -#include "../include/lustre_param.h" -#include "../include/cl_object.h" -#include "../include/lustre_fid.h" +#include "../include/obd_class.h" +#include "../include/obd_support.h" #include "lov_internal.h" diff --git a/drivers/staging/lustre/lustre/lov/lov_pack.c b/drivers/staging/lustre/lustre/lov/lov_pack.c index 561b246..6c93d18 100644 --- a/drivers/staging/lustre/lustre/lov/lov_pack.c +++ b/drivers/staging/lustre/lustre/lov/lov_pack.c @@ -38,15 +38,17 @@ #define DEBUG_SUBSYSTEM S_LOV +#include "../include/lustre/lustre_idl.h" +#include "../include/lustre/lustre_user.h" + #include "../include/lustre_net.h" #include "../include/lustre_swab.h" #include "../include/obd.h" #include "../include/obd_class.h" #include "../include/obd_support.h" -#include "../include/lustre/lustre_user.h" -#include "lov_internal.h" #include "lov_cl_internal.h" +#include "lov_internal.h" void lov_dump_lmm_common(int level, void *lmmp) { diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index 087c2cf..2cfd913 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -38,17 +38,18 @@ # include # include +#include "../include/cl_object.h" #include "../include/llog_swab.h" +#include "../include/lprocfs_status.h" #include "../include/lustre_acl.h" +#include "../include/lustre_fid.h" #include "../include/lustre/lustre_ioctl.h" -#include "../include/obd_class.h" +#include "../include/lustre_kernelcomm.h" #include "../include/lustre_lmv.h" -#include "../include/lustre_fid.h" -#include "../include/lprocfs_status.h" -#include "../include/lustre_param.h" #include "../include/lustre_log.h" -#include "../include/lustre_kernelcomm.h" +#include "../include/lustre_param.h" #include "../include/lustre_swab.h" +#include "../include/obd_class.h" #include "mdc_internal.h" diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c index b5370f6..6894d4c 100644 --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c @@ -38,12 +38,13 @@ #define D_MGC D_CONFIG /*|D_WARNING*/ #include -#include "../include/obd_class.h" -#include "../include/lustre_dlm.h" + #include "../include/lprocfs_status.h" -#include "../include/lustre_log.h" +#include "../include/lustre_dlm.h" #include "../include/lustre_disk.h" +#include "../include/lustre_log.h" #include "../include/lustre_swab.h" +#include "../include/obd_class.h" #include "mgc_internal.h" diff --git a/drivers/staging/lustre/lustre/obdclass/llog.c b/drivers/staging/lustre/lustre/obdclass/llog.c index 073abe3..1f6609e 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog.c +++ b/drivers/staging/lustre/lustre/obdclass/llog.c @@ -44,8 +44,8 @@ #define DEBUG_SUBSYSTEM S_LOG #include "../include/llog_swab.h" -#
RE: [PATCH 02/15] hyperv: Add a function to detect hv_device
> -Original Message- > From: Greg KH [mailto:gre...@linuxfoundation.org] > Sent: Friday, December 2, 2016 8:03 AM > To: KY Srinivasan > Cc: o...@aepfle.de; jasow...@redhat.com; Haiyang Zhang > ; linux-ker...@vger.kernel.org; > a...@canonical.com; de...@linuxdriverproject.org; > leann.ogasaw...@canonical.com > Subject: Re: [PATCH 02/15] hyperv: Add a function to detect hv_device > > On Fri, Dec 02, 2016 at 03:38:51PM +, KY Srinivasan wrote: > > > > > > > -Original Message- > > > From: Greg KH [mailto:gre...@linuxfoundation.org] > > > Sent: Thursday, December 1, 2016 11:36 PM > > > To: KY Srinivasan > > > Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org; > > > o...@aepfle.de; a...@canonical.com; vkuzn...@redhat.com; > > > jasow...@redhat.com; leann.ogasaw...@canonical.com; Haiyang Zhang > > > > > > Subject: Re: [PATCH 02/15] hyperv: Add a function to detect hv_device > > > > > > On Fri, Dec 02, 2016 at 07:14:03AM +, KY Srinivasan wrote: > > > > > In other words, why do you need this and PCI or USB doesn't? Why is > > > > > hyperv "special"? > > > > > > > > On Hyper-V, each VF interface (SR-IOV interface) > > > > is paired with an instance of the > > > > synthetic interface that is managed by netvsc. > > > > When the VF interface comes up, we > > > > need to associate the VF instance with > > > > the corresponding netvsc instance. To do this > > > > without modifying the VF drivers, netvsc registers > > > > for netdev events. > > > > > > Why not modify the VF drivers? You have the full source to them... > > Greg, > > > > This is even worse. On Linux, VF drivers are hypervisor agnostic > > and I want to keep it that way. > > Ok, I really don't know what to suggest, other than this is probably not > the way to do this as no other bus has to. As I don't see the code that > actually uses this anywhere, it's really impossible to have this > conversation at all :( I agree it is difficult to discuss this without having the code that uses this. That said, there is currently code in the tree that disambiguates the netdev events that netvsc sees - look at the function get_netvsc_bymac(). This function allows us to associate the VF interface that maybe coming up with the associated netvsc interface using MAC address. What I want to do is to not use the MAC address but to use a serial number that the host publishes. I could send the netvsc patches that use this if that would help here. In any case once we have this functionality, we will be submitting the patches that use this. What I am trying to do here is to implement the equivalent of dev_is_pci() for vmbus. You also had concerns about how we were implementing this functionality. We could certainly use the same mechanism used in dev_is_pci(). Perhaps I could also use the same naming convention - dev_is_hv()? Regards, K. Y > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH net-next] tools: hv: Enable network manager for bonding scripts on RHEL
From: Haiyang Zhang We found network manager is necessary on RHEL to make the synthetic NIC, VF NIC bonding operations handled automatically. So, enabling network manager here. Signed-off-by: Haiyang Zhang Reviewed-by: K. Y. Srinivasan --- tools/hv/bondvf.sh |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/hv/bondvf.sh b/tools/hv/bondvf.sh index 8e96023..4aa5369 100755 --- a/tools/hv/bondvf.sh +++ b/tools/hv/bondvf.sh @@ -74,8 +74,8 @@ function create_eth_cfg_redhat { echo DEVICE=$1 >>$fn echo TYPE=Ethernet >>$fn echo BOOTPROTO=none >>$fn + echo UUID=`uuidgen` >>$fn echo ONBOOT=yes >>$fn - echo NM_CONTROLLED=no >>$fn echo PEERDNS=yes >>$fn echo IPV6INIT=yes >>$fn echo MASTER=$2 >>$fn @@ -93,8 +93,8 @@ function create_bond_cfg_redhat { echo DEVICE=$1 >>$fn echo TYPE=Bond >>$fn echo BOOTPROTO=dhcp >>$fn + echo UUID=`uuidgen` >>$fn echo ONBOOT=yes >>$fn - echo NM_CONTROLLED=no >>$fn echo PEERDNS=yes >>$fn echo IPV6INIT=yes >>$fn echo BONDING_MASTER=yes >>$fn -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/22] staging: lustre: llite: clear LLIF_DATA_MODIFIED in atomic
From: Jinshan Xiong This flag should be cleared atomically after the op_data flag MDS_DATA_MODIFIED is packed. Otherwise, if there exists an operation to dirty the file again, the state may be missed on the MDT. Stop using spin lock lli_lock to protect operations of changing file flags; using bit operations instead. Signed-off-by: Jinshan Xiong Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6377 Reviewed-on: http://review.whamcloud.com/14100 Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/file.c | 61 +++ .../staging/lustre/lustre/llite/llite_internal.h | 12 ++-- drivers/staging/lustre/lustre/llite/llite_lib.c| 18 +-- drivers/staging/lustre/lustre/llite/llite_mmap.c |7 +-- drivers/staging/lustre/lustre/llite/vvp_io.c | 10 +-- drivers/staging/lustre/lustre/llite/xattr_cache.c |7 +- 6 files changed, 38 insertions(+), 77 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index 6c2abb3..ea21e19 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -75,45 +75,39 @@ static void ll_file_data_put(struct ll_file_data *fd) kmem_cache_free(ll_file_data_slab, fd); } -void ll_pack_inode2opdata(struct inode *inode, struct md_op_data *op_data, - struct lustre_handle *fh) +/** + * Packs all the attributes into @op_data for the CLOSE rpc. + */ +static void ll_prepare_close(struct inode *inode, struct md_op_data *op_data, +struct obd_client_handle *och) { - op_data->op_fid1 = ll_i2info(inode)->lli_fid; + struct ll_inode_info *lli = ll_i2info(inode); + + ll_prep_md_op_data(op_data, inode, NULL, NULL, + 0, 0, LUSTRE_OPC_ANY, NULL); + op_data->op_attr.ia_mode = inode->i_mode; op_data->op_attr.ia_atime = inode->i_atime; op_data->op_attr.ia_mtime = inode->i_mtime; op_data->op_attr.ia_ctime = inode->i_ctime; op_data->op_attr.ia_size = i_size_read(inode); + op_data->op_attr.ia_valid |= ATTR_MODE | ATTR_ATIME | ATTR_ATIME_SET | +ATTR_MTIME | ATTR_MTIME_SET | +ATTR_CTIME | ATTR_CTIME_SET; op_data->op_attr_blocks = inode->i_blocks; op_data->op_attr_flags = ll_inode_to_ext_flags(inode->i_flags); - if (fh) - op_data->op_handle = *fh; + op_data->op_handle = och->och_fh; - if (ll_i2info(inode)->lli_flags & LLIF_DATA_MODIFIED) + /* +* For HSM: if inode data has been modified, pack it so that +* MDT can set data dirty flag in the archive. +*/ + if (och->och_flags & FMODE_WRITE && + test_and_clear_bit(LLIF_DATA_MODIFIED, &lli->lli_flags)) op_data->op_bias |= MDS_DATA_MODIFIED; } /** - * Packs all the attributes into @op_data for the CLOSE rpc. - */ -static void ll_prepare_close(struct inode *inode, struct md_op_data *op_data, -struct obd_client_handle *och) -{ - op_data->op_attr.ia_valid = ATTR_MODE | ATTR_ATIME | ATTR_ATIME_SET | - ATTR_MTIME | ATTR_MTIME_SET | - ATTR_CTIME | ATTR_CTIME_SET; - - if (!(och->och_flags & FMODE_WRITE)) - goto out; - - op_data->op_attr.ia_valid |= ATTR_SIZE | ATTR_BLOCKS; -out: - ll_pack_inode2opdata(inode, op_data, &och->och_fh); - ll_prep_md_op_data(op_data, inode, NULL, NULL, - 0, 0, LUSTRE_OPC_ANY, NULL); -} - -/** * Perform a close, possibly with a bias. * The meaning of "data" depends on the value of "bias". * @@ -181,17 +175,6 @@ static int ll_close_inode_openhandle(struct obd_export *md_exp, PFID(ll_inode2fid(inode)), rc); } - /* DATA_MODIFIED flag was successfully sent on close, cancel data -* modification flag. -*/ - if (rc == 0 && (op_data->op_bias & MDS_DATA_MODIFIED)) { - struct ll_inode_info *lli = ll_i2info(inode); - - spin_lock(&lli->lli_lock); - lli->lli_flags &= ~LLIF_DATA_MODIFIED; - spin_unlock(&lli->lli_lock); - } - if (op_data->op_bias & (MDS_HSM_RELEASE | MDS_CLOSE_LAYOUT_SWAP) && !rc) { struct mdt_body *body; @@ -2888,6 +2871,8 @@ static int ll_inode_revalidate(struct dentry *dentry, __u64 ibits) LTIME_S(inode->i_mtime) = ll_i2info(inode)->lli_mtime; LTIME_S(inode->i_ctime) = ll_i2info(inode)->lli_ctime; } else { + struct ll_inode_info *lli = ll_i2info(inode); + /* In case of restore, the MDT has the right size and has * already s
[PATCH 08/22] staging: lustre: clio: revise read ahead algorithm
From: Jinshan Xiong ras_window_len should only be updated in ras_update() by read pattern and it can't be adjusted in ll_readahead() at all; ras_consecutive_pages is used to detect read pattern from mmap. It will be used to increase read ahead window length gradually. Signed-off-by: Jinshan Xiong Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5505 Reviewed-on: http://review.whamcloud.com/11528 Reviewed-by: John L. Hammond Reviewed-by: Bobi Jam Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/lustre/llite/llite_internal.h |5 +- drivers/staging/lustre/lustre/llite/rw.c | 71 +++- 2 files changed, 43 insertions(+), 33 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h index ae0bb09..e37ba1f 100644 --- a/drivers/staging/lustre/lustre/llite/llite_internal.h +++ b/drivers/staging/lustre/lustre/llite/llite_internal.h @@ -1005,8 +1005,11 @@ int ll_xattr_list(struct inode *inode, const char *name, int type, */ int cl_sb_init(struct super_block *sb); int cl_sb_fini(struct super_block *sb); -void ll_io_init(struct cl_io *io, const struct file *file, int write); +enum ras_update_flags { + LL_RAS_HIT = 0x1, + LL_RAS_MMAP = 0x2 +}; void ll_ra_count_put(struct ll_sb_info *sbi, unsigned long len); void ll_ra_stats_inc(struct inode *inode, enum ra_stat which); diff --git a/drivers/staging/lustre/lustre/llite/rw.c b/drivers/staging/lustre/lustre/llite/rw.c index e34017d..e2d5e75 100644 --- a/drivers/staging/lustre/lustre/llite/rw.c +++ b/drivers/staging/lustre/lustre/llite/rw.c @@ -457,30 +457,25 @@ static int ll_readahead(const struct lu_env *env, struct cl_io *io, spin_lock(&ras->ras_lock); - /* Enlarge the RA window to encompass the full read */ - if (vio->vui_ra_valid && - ras->ras_window_start + ras->ras_window_len < - vio->vui_ra_start + vio->vui_ra_count) { - ras->ras_window_len = vio->vui_ra_start + vio->vui_ra_count - - ras->ras_window_start; - } + /** +* Note: other thread might rollback the ras_next_readahead, +* if it can not get the full size of prepared pages, see the +* end of this function. For stride read ahead, it needs to +* make sure the offset is no less than ras_stride_offset, +* so that stride read ahead can work correctly. +*/ + if (stride_io_mode(ras)) + start = max(ras->ras_next_readahead, ras->ras_stride_offset); + else + start = ras->ras_next_readahead; - /* Reserve a part of the read-ahead window that we'll be issuing */ - if (ras->ras_window_len > 0) { - /* -* Note: other thread might rollback the ras_next_readahead, -* if it can not get the full size of prepared pages, see the -* end of this function. For stride read ahead, it needs to -* make sure the offset is no less than ras_stride_offset, -* so that stride read ahead can work correctly. -*/ - if (stride_io_mode(ras)) - start = max(ras->ras_next_readahead, - ras->ras_stride_offset); - else - start = ras->ras_next_readahead; + if (ras->ras_window_len > 0) end = ras->ras_window_start + ras->ras_window_len - 1; - } + + /* Enlarge the RA window to encompass the full read */ + if (vio->vui_ra_valid && + end < vio->vui_ra_start + vio->vui_ra_count - 1) + end = vio->vui_ra_start + vio->vui_ra_count - 1; if (end != 0) { unsigned long rpc_boundary; @@ -602,7 +597,7 @@ static void ras_reset(struct inode *inode, struct ll_readahead_state *ras, ras->ras_consecutive_pages = 0; ras->ras_window_len = 0; ras_set_start(inode, ras, index); - ras->ras_next_readahead = max(ras->ras_window_start, index); + ras->ras_next_readahead = max(ras->ras_window_start, index + 1); RAS_CDEBUG(ras); } @@ -733,10 +728,11 @@ static void ras_increase_window(struct inode *inode, static void ras_update(struct ll_sb_info *sbi, struct inode *inode, struct ll_readahead_state *ras, unsigned long index, - unsigned int hit) + enum ras_update_flags flags) { struct ll_ra_info *ra = &sbi->ll_ra_info; int zero = 0, stride_detect = 0, ra_miss = 0; + bool hit = flags & LL_RAS_HIT; spin_lock(&ras->ras_lock); @@ -766,7 +762,7 @@ static void ras_update(struct ll_sb_info *sbi, struct inode *inode, * to for subsequent IO. The mmap case does not increment * ras_requests and thus can never trigger this behavior. */ - if (ras-
[PATCH 00/22] Next batch of missing work for upstream client
Batch of various fixes and clean ups missing in the upstream client. Only one smaller batch of patches left to sync lustre 2.8.0 version. These patches are independent of each other so they can be landed in any order. Alex Zhuravlev (1): staging: lustre: obdclass: lu_site_purge() to handle purge-all Alexander Boyko (1): staging: lustre: obd: add callback for llog_cat_process_or_fork Alexander Zarochentsev (1): staging: lustre: libcfs: remove lnet upcall code Ashish Purkar (1): staging: lustre: osc: fix debug log message formatting Bobi Jam (1): staging: lustre: clio: remove mtime check in vvp_io_fault_start() Fan Yong (1): staging: lustre: statahead: set sai_index_wait with lli_sa_lock held Jinshan Xiong (5): staging: lustre: llite: clear LLIF_DATA_MODIFIED in atomic staging: lustre: osc: handle osc eviction correctly staging: lustre: clio: revise read ahead algorithm staging: lustre: rpc: increase bulk size staging: lustre: osc: set lock data for readahead lock Li Dongyang (2): staging: lustre: obdclass: limit lu_site hash table size on clients staging: lustre: mdt: fail FMODE_WRITE open if the client is read only Mikhal Pershin (1): staging: lustre: import: don't reconnect during connect interpret Parinay Kondekar (1): staging: lustre: llite: ll_dir_ioctl cleanup of redundant comparisons Wally Wang (1): staging: lustre: llite: Add client mount opt to ignore suppress_pings Yang Sheng (3): staging: lustre: libcfs: report hnode value for cfs_hash_putref staging: lustre: llite: Invoke file_update_time in page_mkwrite staging: lustre: remove set but unused variables wang di (3): staging: lustre: mdt: race between open and migrate staging: lustre: lmv: remove nlink check in lmv_revalidate_slaves staging: lustre: llog: reset llog bitmap .../staging/lustre/include/linux/libcfs/libcfs.h |1 - .../lustre/include/linux/libcfs/libcfs_private.h |2 - drivers/staging/lustre/lnet/libcfs/hash.c |2 +- .../staging/lustre/lnet/libcfs/linux/linux-debug.c | 54 drivers/staging/lustre/lnet/libcfs/module.c|8 - drivers/staging/lustre/lnet/lnet/nidstrings.c |2 - .../lustre/lustre/include/lustre/lustre_idl.h |6 +- .../staging/lustre/lustre/include/lustre_import.h |4 +- drivers/staging/lustre/lustre/include/lustre_net.h |8 +- .../lustre/lustre/include/lustre_req_layout.h |1 + drivers/staging/lustre/lustre/ldlm/ldlm_lock.c |3 +- drivers/staging/lustre/lustre/llite/dir.c |5 +- drivers/staging/lustre/lustre/llite/file.c | 137 +--- .../staging/lustre/lustre/llite/llite_internal.h | 22 ++-- drivers/staging/lustre/lustre/llite/llite_lib.c| 34 +++--- drivers/staging/lustre/lustre/llite/llite_mmap.c |8 +- drivers/staging/lustre/lustre/llite/namei.c|4 + drivers/staging/lustre/lustre/llite/rw.c | 71 ++- drivers/staging/lustre/lustre/llite/statahead.c| 18 ++- drivers/staging/lustre/lustre/llite/vvp_io.c | 16 +-- drivers/staging/lustre/lustre/llite/xattr_cache.c |7 +- drivers/staging/lustre/lustre/lmv/lmv_intent.c | 16 +-- drivers/staging/lustre/lustre/mdc/mdc_lib.c| 59 + drivers/staging/lustre/lustre/mdc/mdc_reint.c | 20 +++- drivers/staging/lustre/lustre/obdclass/llog.c |7 + drivers/staging/lustre/lustre/obdclass/llog_cat.c | 16 +-- drivers/staging/lustre/lustre/obdclass/lu_object.c |9 +- drivers/staging/lustre/lustre/osc/osc_cache.c | 25 ++-- .../staging/lustre/lustre/osc/osc_cl_internal.h| 11 +- drivers/staging/lustre/lustre/osc/osc_internal.h |2 + drivers/staging/lustre/lustre/osc/osc_io.c | 61 +++-- drivers/staging/lustre/lustre/osc/osc_lock.c |7 +- drivers/staging/lustre/lustre/osc/osc_object.c | 19 +++ drivers/staging/lustre/lustre/osc/osc_page.c |2 +- drivers/staging/lustre/lustre/osc/osc_request.c| 94 +++--- drivers/staging/lustre/lustre/ptlrpc/import.c | 16 ++- drivers/staging/lustre/lustre/ptlrpc/layout.c | 18 +++ drivers/staging/lustre/lustre/ptlrpc/wiretest.c|2 + 38 files changed, 452 insertions(+), 345 deletions(-) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/22] staging: lustre: mdt: race between open and migrate
From: wang di During intent open, it was found that if the parent has been migrated to another MDT, it should retry the open request with the new object, so it needs to keep the old object in the orphan list, which will be cleanup during next recovery. Note: if the client still using the old FID after next recovery, it will return -ENOENT for the application. Also enqueue the lease lock of the migrating file, then compare the lease before migration to make sure no other clients open the file at the same time. Signed-off-by: wang di Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6475 Reviewed-on: http://review.whamcloud.com/14497 Reviewed-by: James Simmons Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../lustre/lustre/include/lustre_req_layout.h |1 + drivers/staging/lustre/lustre/llite/dir.c |2 +- drivers/staging/lustre/lustre/llite/file.c | 76 --- .../staging/lustre/lustre/llite/llite_internal.h |2 +- drivers/staging/lustre/lustre/mdc/mdc_lib.c| 59 +--- drivers/staging/lustre/lustre/mdc/mdc_reint.c | 20 +- drivers/staging/lustre/lustre/ptlrpc/layout.c | 18 + 7 files changed, 138 insertions(+), 40 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_req_layout.h b/drivers/staging/lustre/lustre/include/lustre_req_layout.h index 7657132..fbcd395 100644 --- a/drivers/staging/lustre/lustre/include/lustre_req_layout.h +++ b/drivers/staging/lustre/lustre/include/lustre_req_layout.h @@ -167,6 +167,7 @@ void req_capsule_shrink(struct req_capsule *pill, extern struct req_format RQF_MDS_REINT_SETXATTR; extern struct req_format RQF_MDS_QUOTACTL; extern struct req_format RQF_MDS_SWAP_LAYOUTS; +extern struct req_format RQF_MDS_REINT_MIGRATE; /* MDS hsm formats */ extern struct req_format RQF_MDS_HSM_STATE_GET; extern struct req_format RQF_MDS_HSM_STATE_SET; diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index ce05493..351e900 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -1083,7 +1083,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) goto out_free; } - rc = ll_get_fid_by_name(inode, filename, namelen, NULL); + rc = ll_get_fid_by_name(inode, filename, namelen, NULL, NULL); if (rc < 0) { CERROR("%s: lookup %.*s failed: rc = %d\n", ll_get_fsname(inode->i_sb, NULL, 0), namelen, diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index ea21e19..aa29583 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -2531,7 +2531,8 @@ int ll_fsync(struct file *file, loff_t start, loff_t end, int datasync) } int ll_get_fid_by_name(struct inode *parent, const char *name, - int namelen, struct lu_fid *fid) + int namelen, struct lu_fid *fid, + struct inode **inode) { struct md_op_data *op_data = NULL; struct ptlrpc_request *req; @@ -2543,7 +2544,7 @@ int ll_get_fid_by_name(struct inode *parent, const char *name, if (IS_ERR(op_data)) return PTR_ERR(op_data); - op_data->op_valid = OBD_MD_FLID; + op_data->op_valid = OBD_MD_FLID | OBD_MD_FLTYPE; rc = md_getattr_name(ll_i2sbi(parent)->ll_md_exp, op_data, &req); ll_finish_md_op_data(op_data); if (rc < 0) @@ -2556,6 +2557,9 @@ int ll_get_fid_by_name(struct inode *parent, const char *name, } if (fid) *fid = body->mbo_fid1; + + if (inode) + rc = ll_prep_inode(inode, req, parent->i_sb, NULL); out_req: ptlrpc_req_finished(req); return rc; @@ -2565,9 +2569,12 @@ int ll_migrate(struct inode *parent, struct file *file, int mdtidx, const char *name, int namelen) { struct ptlrpc_request *request = NULL; + struct obd_client_handle *och = NULL; struct inode *child_inode = NULL; struct dentry *dchild = NULL; struct md_op_data *op_data; + struct mdt_body *body; + u64 data_version = 0; struct qstr qstr; int rc; @@ -2586,22 +2593,25 @@ int ll_migrate(struct inode *parent, struct file *file, int mdtidx, dchild = d_lookup(file_dentry(file), &qstr); if (dchild) { op_data->op_fid3 = *ll_inode2fid(dchild->d_inode); - if (dchild->d_inode) { + if (dchild->d_inode) child_inode = igrab(dchild->d_inode); - if (child_inode) { - inode_lock(child_inode); - op_data->op_fid3 = *ll_inode2fid(chil
[PATCH 11/22] staging: lustre: mdt: fail FMODE_WRITE open if the client is read only
From: Li Dongyang O_WRONLY/O_RDWR open on a file will get EROFS on a read only client, but the rpc gets sent to the mdt anyway. mdt will increase the mot_write_count of the mdt object, blocking subsequent FMODE_EXEC open to the same file. This patch makes sure we fail the FMODE_WRITE open with EROFS on the client straight away without sending the rpc to mdt. Signed-off-by: Li Dongyang Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7727 Reviewed-on: http://review.whamcloud.com/18242 Reviewed-by: Ian Costello Reviewed-by: Nathaniel Clark Reviewed-by: Yang Sheng Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/namei.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c index b07079c..9426759 100644 --- a/drivers/staging/lustre/lustre/llite/namei.c +++ b/drivers/staging/lustre/lustre/llite/namei.c @@ -572,6 +572,10 @@ static int ll_lookup_it_finish(struct ptlrpc_request *request, } } + if (it->it_op & IT_OPEN && it->it_flags & FMODE_WRITE && + dentry->d_sb->s_flags & MS_RDONLY) + return ERR_PTR(-EROFS); + if (it->it_op & IT_CREAT) opc = LUSTRE_OPC_CREATE; else -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 12/22] staging: lustre: libcfs: report hnode value for cfs_hash_putref
From: Yang Sheng Add more debugging info. Signed-off-by: Yang Sheng Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7084 Reviewed-on: http://review.whamcloud.com/17673 Reviewed-by: Andreas Dilger Reviewed-by: Fan Yong Reviewed-by: Mike Pershin Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lnet/libcfs/hash.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/lustre/lnet/libcfs/hash.c b/drivers/staging/lustre/lnet/libcfs/hash.c index b90dfb9..c93c59d 100644 --- a/drivers/staging/lustre/lnet/libcfs/hash.c +++ b/drivers/staging/lustre/lnet/libcfs/hash.c @@ -1215,7 +1215,7 @@ void cfs_hash_putref(struct cfs_hash *hs) struct cfs_hash_bd bds[2]; int bits = 0; - LASSERT(hlist_unhashed(hnode)); + LASSERTF(hlist_unhashed(hnode), "hnode = %p\n", hnode); cfs_hash_lock(hs, 0); cfs_hash_dual_bd_get_and_lock(hs, key, bds, 1); -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/22] staging: lustre: osc: fix debug log message formatting
From: Ashish Purkar Corrected newline specifier in debug log message. Signed-off-by: Ashish Purkar Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7029 Reviewed-on: http://review.whamcloud.com/16046 Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/osc/osc_page.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/lustre/lustre/osc/osc_page.c b/drivers/staging/lustre/lustre/osc/osc_page.c index a80a847..c5129d1 100644 --- a/drivers/staging/lustre/lustre/osc/osc_page.c +++ b/drivers/staging/lustre/lustre/osc/osc_page.c @@ -462,7 +462,7 @@ static void osc_lru_del(struct client_obd *cli, struct osc_page *opg) * stealing one of them. */ if (osc_cache_too_much(cli)) { - CDEBUG(D_CACHE, "%s: queue LRU workn", cli_name(cli)); + CDEBUG(D_CACHE, "%s: queue LRU work\n", cli_name(cli)); (void)ptlrpcd_queue_work(cli->cl_lru_work); } wake_up(&osc_lru_waitq); -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/22] staging: lustre: llog: reset llog bitmap
From: wang di Once update request fails due to eviction or other failures, all of update request in the sending list should return fail, because after the failure, the update log in the following request will have wrong llog bitmap. Signed-off-by: wang di Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7039 Reviewed-on: http://review.whamcloud.com/16969 Reviewed-by: Alex Zhuravlev Reviewed-by: James Simmons Reviewed-by: Lai Siyao Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/obdclass/llog.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/llog.c b/drivers/staging/lustre/lustre/obdclass/llog.c index ae63047..65e6ce6 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog.c +++ b/drivers/staging/lustre/lustre/obdclass/llog.c @@ -114,6 +114,7 @@ static int llog_read_header(const struct lu_env *env, rc = lop->lop_read_header(env, handle); if (rc == LLOG_EEMPTY) { struct llog_log_hdr *llh = handle->lgh_hdr; + size_t len; /* lrh_len should be initialized in llog_init_handle */ handle->lgh_last_idx = 0; /* header is record with index 0 */ @@ -127,6 +128,12 @@ static int llog_read_header(const struct lu_env *env, memcpy(&llh->llh_tgtuuid, uuid, sizeof(llh->llh_tgtuuid)); llh->llh_bitmap_offset = offsetof(typeof(*llh), llh_bitmap); + /* +* Since update llog header might also call this function, +* let's reset the bitmap to 0 here +*/ + len = llh->llh_hdr.lrh_len - llh->llh_bitmap_offset; + memset(LLOG_HDR_BITMAP(llh), 0, len - sizeof(llh->llh_tail)); ext2_set_bit(0, LLOG_HDR_BITMAP(llh)); LLOG_HDR_TAIL(llh)->lrt_len = llh->llh_hdr.lrh_len; LLOG_HDR_TAIL(llh)->lrt_index = llh->llh_hdr.lrh_index; -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 22/22] staging: lustre: libcfs: remove lnet upcall code
From: Alexander Zarochentsev Removing lnet upcall infrastructure completely as nobody uses it anymore. The upcall causes a delay before calling BUG() and might even cause a hang making getting a crash dump unreliable or containing outdated info. Signed-off-by: Alexander Zarochentsev Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8418 Seagate-bug-id: MRP-2939 Reviewed-on: http://review.whamcloud.com/21440 Reviewed-by: Andreas Dilger Reviewed-by: James Simmons Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/include/linux/libcfs/libcfs.h |1 - .../lustre/include/linux/libcfs/libcfs_private.h |2 - .../staging/lustre/lnet/libcfs/linux/linux-debug.c | 54 drivers/staging/lustre/lnet/libcfs/module.c|8 --- 4 files changed, 0 insertions(+), 65 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/libcfs.h index 70eb08e..cc2c0e9 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h @@ -125,7 +125,6 @@ int libcfs_ioctl_getdata(struct libcfs_ioctl_hdr **hdr_pp, /** * The path of debug log dump upcall script. */ -extern char lnet_upcall[1024]; extern char lnet_debug_log_upcall[1024]; extern struct cfs_wi_sched *cfs_sched_rehash; diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h index 41a651f..aab15d8 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h @@ -169,8 +169,6 @@ #define ntohs(x) ___ntohs(x) #endif -void libcfs_run_upcall(char **argv); -void libcfs_run_lbug_upcall(struct libcfs_debug_msg_data *msg); void libcfs_debug_dumplog(void); int libcfs_debug_init(unsigned long bufsize); int libcfs_debug_cleanup(void); diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-debug.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-debug.c index d8a9894..39a72e3 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-debug.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-debug.c @@ -57,7 +57,6 @@ #include -char lnet_upcall[1024] = "/usr/lib/lustre/lnet_upcall"; char lnet_debug_log_upcall[1024] = "/usr/lib/lustre/lnet_debug_log_upcall"; /** @@ -92,58 +91,6 @@ void libcfs_run_debug_log_upcall(char *file) } } -void libcfs_run_upcall(char **argv) -{ - int rc; - int argc; - static const char * const envp[] = { - "HOME=/", - "PATH=/sbin:/bin:/usr/sbin:/usr/bin", - NULL - }; - - argv[0] = lnet_upcall; - argc = 1; - while (argv[argc]) - argc++; - - LASSERT(argc >= 2); - - rc = call_usermodehelper(argv[0], argv, (char **)envp, 1); - if (rc < 0 && rc != -ENOENT) { - CERROR("Error %d invoking LNET upcall %s %s%s%s%s%s%s%s%s; check /sys/kernel/debug/lnet/upcall\n", - rc, argv[0], argv[1], - argc < 3 ? "" : ",", argc < 3 ? "" : argv[2], - argc < 4 ? "" : ",", argc < 4 ? "" : argv[3], - argc < 5 ? "" : ",", argc < 5 ? "" : argv[4], - argc < 6 ? "" : ",..."); - } else { - CDEBUG(D_HA, "Invoked LNET upcall %s %s%s%s%s%s%s%s%s\n", - argv[0], argv[1], - argc < 3 ? "" : ",", argc < 3 ? "" : argv[2], - argc < 4 ? "" : ",", argc < 4 ? "" : argv[3], - argc < 5 ? "" : ",", argc < 5 ? "" : argv[4], - argc < 6 ? "" : ",..."); - } -} - -void libcfs_run_lbug_upcall(struct libcfs_debug_msg_data *msgdata) -{ - char *argv[6]; - char buf[32]; - - snprintf(buf, sizeof(buf), "%d", msgdata->msg_line); - - argv[1] = "LBUG"; - argv[2] = (char *)msgdata->msg_file; - argv[3] = (char *)msgdata->msg_fn; - argv[4] = buf; - argv[5] = NULL; - - libcfs_run_upcall(argv); -} -EXPORT_SYMBOL(libcfs_run_lbug_upcall); - /* coverity[+kill] */ void __noreturn lbug_with_loc(struct libcfs_debug_msg_data *msgdata) { @@ -158,7 +105,6 @@ void __noreturn lbug_with_loc(struct libcfs_debug_msg_data *msgdata) dump_stack(); if (!libcfs_panic_on_lbug) libcfs_debug_dumplog(); - libcfs_run_lbug_upcall(msgdata); if (libcfs_panic_on_lbug) panic("LBUG"); set_task_state(current, TASK_UNINTERRUPTIBLE); diff --git a/drivers/staging/lustre/lnet/libcfs/module.c b/drivers/staging/lustre/lnet/libcfs/module.c index 5884a33..161e042 100644 --- a/drivers/staging/lustre/lnet/libcfs/module.c +++ b/drivers/staging/lustre/lnet/libcfs/module.c @@ -365,14 +365,6 @@ static int proc_cpt_table(struct ctl_table *table, int write, .mode = 0444,
[PATCH 16/22] staging: lustre: llite: Invoke file_update_time in page_mkwrite
From: Yang Sheng Only update file times if page_mkwrite is not set. So we need call file_update_time by ourselves. Signed-off-by: Yang Sheng Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-1118 Reviewed-on: http://review.whamcloud.com/18683 Reviewed-by: Andreas Dilger Reviewed-by: Niu Yawei Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/llite_mmap.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/llite_mmap.c b/drivers/staging/lustre/lustre/llite/llite_mmap.c index f50b6c1..ee01f20 100644 --- a/drivers/staging/lustre/lustre/llite/llite_mmap.c +++ b/drivers/staging/lustre/lustre/llite/llite_mmap.c @@ -369,6 +369,7 @@ static int ll_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) bool retry; int result; + file_update_time(vma->vm_file); do { retry = false; result = ll_page_mkwrite0(vma, vmf->page, &retry); -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 13/22] staging: lustre: statahead: set sai_index_wait with lli_sa_lock held
From: Fan Yong It is the sponsor thread of the statahead thread to update the sai::sai_index_wait. Originally, it didn't hold the lli_sa_lock when did that. Becuase of out-of-order execution others may miss to wakeup such thread. On the other hand, if the statahead RPC gets failure, it should wakeup the sponsor thread, not the statahead thread. Signed-off-by: Li Xi Signed-off-by: Fan Yong Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7828 Reviewed-on: http://review.whamcloud.com/18499 Reviewed-by: Lai Siyao Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/statahead.c | 18 +++--- 1 files changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/statahead.c b/drivers/staging/lustre/lustre/llite/statahead.c index b43955f..4769a22 100644 --- a/drivers/staging/lustre/lustre/llite/statahead.c +++ b/drivers/staging/lustre/lustre/llite/statahead.c @@ -659,8 +659,8 @@ static int ll_statahead_interpret(struct ptlrpc_request *req, struct ll_inode_info *lli = ll_i2info(dir); struct ll_statahead_info *sai = lli->lli_sai; struct sa_entry *entry = (struct sa_entry *)minfo->mi_cbdata; + wait_queue_head_t *waitq = NULL; __u64 handle = 0; - bool wakeup; if (it_disposition(it, DISP_LOOKUP_NEG)) rc = -ENOENT; @@ -693,7 +693,8 @@ static int ll_statahead_interpret(struct ptlrpc_request *req, spin_lock(&lli->lli_sa_lock); if (rc) { - wakeup = __sa_make_ready(sai, entry, rc); + if (__sa_make_ready(sai, entry, rc)) + waitq = &sai->sai_waitq; } else { entry->se_minfo = minfo; entry->se_req = ptlrpc_request_addref(req); @@ -704,13 +705,15 @@ static int ll_statahead_interpret(struct ptlrpc_request *req, * with parent's lock held, for example: unlink. */ entry->se_handle = handle; - wakeup = !sa_has_callback(sai); + if (!sa_has_callback(sai)) + waitq = &sai->sai_thread.t_ctl_waitq; + list_add_tail(&entry->se_list, &sai->sai_interim_entries); } sai->sai_replied++; - if (wakeup) - wake_up(&sai->sai_thread.t_ctl_waitq); + if (waitq) + wake_up(waitq); spin_unlock(&lli->lli_sa_lock); return rc; @@ -1397,10 +1400,10 @@ static int revalidate_statahead_dentry(struct inode *dir, struct dentry **dentryp, bool unplug) { + struct ll_inode_info *lli = ll_i2info(dir); struct sa_entry *entry = NULL; struct l_wait_info lwi = { 0 }; struct ll_dentry_data *ldd; - struct ll_inode_info *lli; int rc = 0; if ((*dentryp)->d_name.name[0] == '.') { @@ -1446,7 +1449,9 @@ static int revalidate_statahead_dentry(struct inode *dir, sa_handle_callback(sai); if (!sa_ready(entry)) { + spin_lock(&lli->lli_sa_lock); sai->sai_index_wait = entry->se_index; + spin_unlock(&lli->lli_sa_lock); lwi = LWI_TIMEOUT_INTR(cfs_time_seconds(30), NULL, LWI_ON_SIGNAL_NOOP, NULL); rc = l_wait_event(sai->sai_waitq, sa_ready(entry), &lwi); @@ -1514,7 +1519,6 @@ static int revalidate_statahead_dentry(struct inode *dir, * dentry_may_statahead(). */ ldd = ll_d2d(*dentryp); - lli = ll_i2info(dir); /* ldd can be NULL if llite lookup failed. */ if (ldd) ldd->lld_sa_generation = lli->lli_sa_generation; -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/22] staging: lustre: lmv: remove nlink check in lmv_revalidate_slaves
From: wang di Remove nlink < 2 check in lmv_revalidate_slaves, because after nlink reaches to LDISKFS_LINK_MAX (65000), the inode nlink will be set to 1. Signed-off-by: wang di Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6984 Reviewed-on: http://review.whamcloud.com/16490 Reviewed-by: James Simmons Reviewed-by: Jian Yu Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/lmv/lmv_intent.c | 16 +--- 1 files changed, 1 insertions(+), 15 deletions(-) diff --git a/drivers/staging/lustre/lustre/lmv/lmv_intent.c b/drivers/staging/lustre/lustre/lmv/lmv_intent.c index b1071cf..aa42066 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_intent.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_intent.c @@ -220,21 +220,7 @@ int lmv_revalidate_slaves(struct obd_export *exp, /* refresh slave from server */ body = req_capsule_server_get(&req->rq_pill, &RMF_MDT_BODY); - LASSERT(body); - - if (unlikely(body->mbo_nlink < 2)) { - /* -* If this is bad stripe, most likely due -* to the race between close(unlink) and -* getattr, let's return -EONENT, so llite -* will revalidate the dentry see -* ll_inode_revalidate_fini() -*/ - CDEBUG(D_INODE, "%s: nlink %d < 2 corrupt stripe %d "DFID":" DFID"\n", - obd->obd_name, body->mbo_nlink, i, - PFID(&lsm->lsm_md_oinfo[i].lmo_fid), - PFID(&lsm->lsm_md_oinfo[0].lmo_fid)); - + if (!body) { if (it.it_lock_mode && lockh) { ldlm_lock_decref(lockh, it.it_lock_mode); it.it_lock_mode = 0; -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 15/22] staging: lustre: rpc: increase bulk size
From: Jinshan Xiong To make the ptlrpc be able to size 16MB IO Signed-off-by: Jinshan Xiong Signed-off-by: Gu Zheng Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7990 Reviewed-on: http://review.whamcloud.com/19366 Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../lustre/lustre/include/lustre/lustre_idl.h |6 +- drivers/staging/lustre/lustre/include/lustre_net.h |8 ++-- drivers/staging/lustre/lustre/ptlrpc/wiretest.c|2 ++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h index b9f333b..20f55b7 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h @@ -1683,8 +1683,12 @@ struct obd_ioobj { __u32 ioo_bufcnt; /* number of niobufs for this object */ }; +/* + * NOTE: IOOBJ_MAX_BRW_BITS defines the _offset_ of the max_brw field in + * ioo_max_brw, NOT the maximum number of bits in PTLRPC_BULK_OPS_BITS. + * That said, ioo_max_brw is a 32-bit field so the limit is also 16 bits. + */ #define IOOBJ_MAX_BRW_BITS 16 -#define IOOBJ_TYPE_MASK((1U << IOOBJ_MAX_BRW_BITS) - 1) #define ioobj_max_brw_get(ioo) (((ioo)->ioo_max_brw >> IOOBJ_MAX_BRW_BITS) + 1) #define ioobj_max_brw_set(ioo, num)\ do { (ioo)->ioo_max_brw = ((num) - 1) << IOOBJ_MAX_BRW_BITS; } while (0) diff --git a/drivers/staging/lustre/lustre/include/lustre_net.h b/drivers/staging/lustre/lustre/include/lustre_net.h index 2be135d..411eb0d 100644 --- a/drivers/staging/lustre/lustre/include/lustre_net.h +++ b/drivers/staging/lustre/lustre/include/lustre_net.h @@ -69,13 +69,17 @@ #define PTLRPC_MD_OPTIONS 0 /** - * Max # of bulk operations in one request. + * log2 max # of bulk operations in one request: 2=4MB/RPC, 5=32MB/RPC, ... * In order for the client and server to properly negotiate the maximum * possible transfer size, PTLRPC_BULK_OPS_COUNT must be a power-of-two * value. The client is free to limit the actual RPC size for any bulk * transfer via cl_max_pages_per_rpc to some non-power-of-two value. + * NOTE: This is limited to 16 (=64GB RPCs) by IOOBJ_MAX_BRW_BITS. */ -#define PTLRPC_BULK_OPS_BITS 2 +#define PTLRPC_BULK_OPS_BITS 4 +#if PTLRPC_BULK_OPS_BITS > 16 +#error "More than 65536 BRW RPCs not allowed by IOOBJ_MAX_BRW_BITS." +#endif #define PTLRPC_BULK_OPS_COUNT (1U << PTLRPC_BULK_OPS_BITS) /** * PTLRPC_BULK_OPS_MASK is for the convenience of the client only, and diff --git a/drivers/staging/lustre/lustre/ptlrpc/wiretest.c b/drivers/staging/lustre/lustre/ptlrpc/wiretest.c index f50f487..e12eb83 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/wiretest.c +++ b/drivers/staging/lustre/lustre/ptlrpc/wiretest.c @@ -1576,6 +1576,8 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct obd_ioobj, ioo_bufcnt)); LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_bufcnt) == 4, "found %lld\n", (long long)(int)sizeof(((struct obd_ioobj *)0)->ioo_bufcnt)); + LASSERTF(IOOBJ_MAX_BRW_BITS == 16, "found %lld\n", +(long long)IOOBJ_MAX_BRW_BITS); /* Checks for union lquota_id */ LASSERTF((int)sizeof(union lquota_id) == 16, "found %lld\n", -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 19/22] staging: lustre: llite: ll_dir_ioctl cleanup of redundant comparisons
From: Parinay Kondekar In ll_dir_ioctl() two identical comparisions are present for return code (rc) of ll_dir_getstripe(). This patch removes the other inside if( ) condition which is not necessary. Signed-off-by: Parinay Kondekar Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6512 Reviewed-on: http://review.whamcloud.com/18027 Reviewed-by: Bobi Jam Reviewed-by: James Simmons Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/dir.c |3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index 351e900..3dc7344 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -1227,9 +1227,6 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) /* Get default LMV EA */ if (lum.lum_magic == LMV_USER_MAGIC) { - if (rc) - goto finish_req; - if (lmmsize > sizeof(*ulmv)) { rc = -EINVAL; goto finish_req; -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/22] staging: lustre: llite: Add client mount opt to ignore suppress_pings
From: Wally Wang When Lustre servers enable 'suppress_pings', all clients will stop pinging. However, some clients may not have external mechanism to notify Lustre servers for node death and therefore need to preserve the Lustre ping. This patch provides a mount option 'always_ping' so that the client will not stop pinging even if the server has enabled 'suppress_pings'. Signed-off-by: Wally Wang Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6391 Reviewed-on: http://review.whamcloud.com/14127 Reviewed-by: Li Wei Reviewed-by: Chris Horn Reviewed-by: Lai Siyao Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/lustre/llite/llite_internal.h |3 +++ drivers/staging/lustre/lustre/llite/llite_lib.c| 16 2 files changed, 19 insertions(+), 0 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h index e37ba1f..2f46d47 100644 --- a/drivers/staging/lustre/lustre/llite/llite_internal.h +++ b/drivers/staging/lustre/lustre/llite/llite_internal.h @@ -391,6 +391,8 @@ enum stats_track_type { #define LL_SBI_USER_FID2PATH 0x4 /* allow fid2path by unprivileged users */ #define LL_SBI_XATTR_CACHE0x8 /* support for xattr cache */ #define LL_SBI_NOROOTSQUASH0x10 /* do not apply root squash */ +#define LL_SBI_ALWAYS_PING 0x20 /* always ping even if server + * suppress_pings */ #define LL_SBI_FLAGS { \ "nolck",\ @@ -414,6 +416,7 @@ enum stats_track_type { "user_fid2path",\ "xattr_cache", \ "norootsquash", \ + "always_ping", \ } /* diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index 2a51efa..25f5aed 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -224,6 +224,10 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, /* real client */ data->ocd_connect_flags |= OBD_CONNECT_REAL; + /* always ping even if server suppress_pings */ + if (sbi->ll_flags & LL_SBI_ALWAYS_PING) + data->ocd_connect_flags &= ~OBD_CONNECT_PINGLESS; + data->ocd_brw_size = MD_MAX_BRW_SIZE; err = obd_connect(NULL, &sbi->ll_md_exp, obd, &sbi->ll_sb_uuid, @@ -373,6 +377,10 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, data->ocd_connect_flags |= OBD_CONNECT_LRU_RESIZE; + /* always ping even if server suppress_pings */ + if (sbi->ll_flags & LL_SBI_ALWAYS_PING) + data->ocd_connect_flags &= ~OBD_CONNECT_PINGLESS; + CDEBUG(D_RPCTRACE, "ocd_connect_flags: %#llx ocd_version: %d ocd_grant: %d\n", data->ocd_connect_flags, data->ocd_version, data->ocd_grant); @@ -788,6 +796,11 @@ static int ll_options(char *options, int *flags) *flags &= ~tmp; goto next; } + tmp = ll_set_opt("always_ping", s1, LL_SBI_ALWAYS_PING); + if (tmp) { + *flags |= tmp; + goto next; + } LCONSOLE_ERROR_MSG(0x152, "Unknown option '%s', won't mount.\n", s1); return -EINVAL; @@ -2361,6 +2374,9 @@ int ll_show_options(struct seq_file *seq, struct dentry *dentry) if (sbi->ll_flags & LL_SBI_USER_FID2PATH) seq_puts(seq, ",user_fid2path"); + if (sbi->ll_flags & LL_SBI_ALWAYS_PING) + seq_puts(seq, ",always_ping"); + return 0; } -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 20/22] staging: lustre: osc: set lock data for readahead lock
From: Jinshan Xiong If osc_io_readahead() finds a lock that belongs to the previous instance of osc_object, the lock data pointer will be null. It has to instantiate with new instance otherwise those pages won't be destroyed at lock cancel, and then finally hit the assertion in osc_req_attr_set(). This patch revised dlmlock_at_pgoff() to call osc_match_base() to find caching locks for readahead. And new osc_object will be set to the lock if it doesn't have one yet. Signed-off-by: Jinshan Xiong Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8005 Reviewed-on: http://review.whamcloud.com/19453 Reviewed-by: Bobi Jam Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/osc/osc_io.c |1 + drivers/staging/lustre/lustre/osc/osc_lock.c|7 +-- drivers/staging/lustre/lustre/osc/osc_request.c | 49 ++ 3 files changed, 18 insertions(+), 39 deletions(-) diff --git a/drivers/staging/lustre/lustre/osc/osc_io.c b/drivers/staging/lustre/lustre/osc/osc_io.c index 369761f..d96f4f2 100644 --- a/drivers/staging/lustre/lustre/osc/osc_io.c +++ b/drivers/staging/lustre/lustre/osc/osc_io.c @@ -88,6 +88,7 @@ static int osc_io_read_ahead(const struct lu_env *env, dlmlock = osc_dlmlock_at_pgoff(env, osc, start, 0); if (dlmlock) { + LASSERT(dlmlock->l_ast_data == osc); if (dlmlock->l_req_mode != LCK_PR) { struct lustre_handle lockh; diff --git a/drivers/staging/lustre/lustre/osc/osc_lock.c b/drivers/staging/lustre/lustre/osc/osc_lock.c index 130460d..001fe75 100644 --- a/drivers/staging/lustre/lustre/osc/osc_lock.c +++ b/drivers/staging/lustre/lustre/osc/osc_lock.c @@ -1205,10 +1205,9 @@ struct ldlm_lock *osc_dlmlock_at_pgoff(const struct lu_env *env, * with a uniq gid and it conflicts with all other lock modes too */ again: - mode = ldlm_lock_match(osc_export(obj)->exp_obd->obd_namespace, - flags, resname, LDLM_EXTENT, policy, - LCK_PR | LCK_PW | LCK_GROUP, &lockh, - dap_flags & OSC_DAP_FL_CANCELING); + mode = osc_match_base(osc_export(obj), resname, LDLM_EXTENT, policy, + LCK_PR | LCK_PW | LCK_GROUP, &flags, obj, &lockh, + dap_flags & OSC_DAP_FL_CANCELING); if (mode != 0) { lock = ldlm_handle2lock(&lockh); /* RACE: the lock is cancelled so let's try again */ diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c b/drivers/staging/lustre/lustre/osc/osc_request.c index bc698d3..0977127 100644 --- a/drivers/staging/lustre/lustre/osc/osc_request.c +++ b/drivers/staging/lustre/lustre/osc/osc_request.c @@ -1813,16 +1813,11 @@ int osc_build_rpc(const struct lu_env *env, struct client_obd *cli, return rc; } -static int osc_set_lock_data_with_check(struct ldlm_lock *lock, - struct ldlm_enqueue_info *einfo) +static int osc_set_lock_data(struct ldlm_lock *lock, void *data) { - void *data = einfo->ei_cbdata; int set = 0; - LASSERT(lock->l_blocking_ast == einfo->ei_cb_bl); - LASSERT(lock->l_resource->lr_type == einfo->ei_type); - LASSERT(lock->l_completion_ast == einfo->ei_cb_cp); - LASSERT(lock->l_glimpse_ast == einfo->ei_cb_gl); + LASSERT(lock); lock_res_and_lock(lock); @@ -1836,21 +1831,6 @@ static int osc_set_lock_data_with_check(struct ldlm_lock *lock, return set; } -static int osc_set_data_with_check(struct lustre_handle *lockh, - struct ldlm_enqueue_info *einfo) -{ - struct ldlm_lock *lock = ldlm_handle2lock(lockh); - int set = 0; - - if (lock) { - set = osc_set_lock_data_with_check(lock, einfo); - LDLM_LOCK_PUT(lock); - } else - CERROR("lockh %p, data %p - client evicted?\n", - lockh, einfo->ei_cbdata); - return set; -} - static int osc_enqueue_fini(struct ptlrpc_request *req, osc_enqueue_upcall_f upcall, void *cookie, struct lustre_handle *lockh, enum ldlm_mode mode, @@ -2016,7 +1996,7 @@ int osc_enqueue_base(struct obd_export *exp, struct ldlm_res_id *res_id, ldlm_lock_decref(&lockh, mode); LDLM_LOCK_PUT(matched); return -ECANCELED; - } else if (osc_set_lock_data_with_check(matched, einfo)) { + } else if (osc_set_lock_data(matched, einfo->ei_cbdata)) { *flags |= LDLM_FL_LVB_READY; /* We already have a lock, and it's referenced. */ (*upcall)(cookie, &lockh, ELDLM_LOCK_MATCHED); @@ -2128,19 +2108,18 @@ int osc_match_base(struct obd_export *exp, struct ldlm_res_
[PATCH 10/22] staging: lustre: obdclass: limit lu_site hash table size on clients
From: Li Dongyang Allocating a big hash table using the current formula does not really work for clients. We will create new hash table for each mount on a single client which is a lot of memory more than expected. This patch limits the hash table up to 8M for clients, which has 524288 entries. Signed-off-by: Li Dongyang Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7689 Reviewed-on: http://review.whamcloud.com/18048 Reviewed-by: Fan Yong Reviewed-by: Alex Zhuravlev Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/obdclass/lu_object.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/lu_object.c b/drivers/staging/lustre/lustre/obdclass/lu_object.c index a02aaa3..80e0984 100644 --- a/drivers/staging/lustre/lustre/obdclass/lu_object.c +++ b/drivers/staging/lustre/lustre/obdclass/lu_object.c @@ -68,6 +68,7 @@ enum { #define LU_SITE_BITS_MIN 12 #define LU_SITE_BITS_MAX 24 +#define LU_SITE_BITS_MAX_CL19 /** * total 256 buckets, we don't want too many buckets because: * - consume too much memory @@ -878,6 +879,9 @@ static unsigned long lu_htable_order(struct lu_device *top) unsigned long cache_size; unsigned long bits; + if (!strcmp(top->ld_type->ldt_name, LUSTRE_VVP_NAME)) + bits_max = LU_SITE_BITS_MAX_CL; + /* * Calculate hash table size, assuming that we want reasonable * performance when 20% of total memory is occupied by cache of -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 14/22] staging: lustre: obd: add callback for llog_cat_process_or_fork
From: Alexander Boyko Currently llog_process_or_fork() is hard coded to always pass the function pointer llog_cat_process_cb(). Change llog_cat_process_or_fork() to pass in any function pointer which will allow us more options for llog_cat callback routines in the future. Signed-off-by: Alexander Boyko Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7156 Seagate-bug-id: MRP-2383 Reviewed-on: http://review.whamcloud.com/16416 Reviewed-by: Andreas Dilger Reviewed-by: Nathaniel Clark Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/obdclass/llog_cat.c | 16 +++- 1 files changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/llog_cat.c b/drivers/staging/lustre/lustre/obdclass/llog_cat.c index ce8e2f6..de9d01d 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog_cat.c +++ b/drivers/staging/lustre/lustre/obdclass/llog_cat.c @@ -188,7 +188,8 @@ static int llog_cat_process_cb(const struct lu_env *env, static int llog_cat_process_or_fork(const struct lu_env *env, struct llog_handle *cat_llh, - llog_cb_t cb, void *data, int startcat, + llog_cb_t cat_cb, llog_cb_t cb, + void *data, int startcat, int startidx, bool fork) { struct llog_process_data d; @@ -209,18 +210,15 @@ static int llog_cat_process_or_fork(const struct lu_env *env, cd.lpcd_first_idx = llh->llh_cat_idx; cd.lpcd_last_idx = 0; - rc = llog_process_or_fork(env, cat_llh, llog_cat_process_cb, - &d, &cd, fork); + rc = llog_process_or_fork(env, cat_llh, cat_cb, &d, &cd, fork); if (rc != 0) return rc; cd.lpcd_first_idx = 0; cd.lpcd_last_idx = cat_llh->lgh_last_idx; - rc = llog_process_or_fork(env, cat_llh, llog_cat_process_cb, - &d, &cd, fork); + rc = llog_process_or_fork(env, cat_llh, cat_cb, &d, &cd, fork); } else { - rc = llog_process_or_fork(env, cat_llh, llog_cat_process_cb, - &d, NULL, fork); + rc = llog_process_or_fork(env, cat_llh, cat_cb, &d, NULL, fork); } return rc; @@ -229,7 +227,7 @@ static int llog_cat_process_or_fork(const struct lu_env *env, int llog_cat_process(const struct lu_env *env, struct llog_handle *cat_llh, llog_cb_t cb, void *data, int startcat, int startidx) { - return llog_cat_process_or_fork(env, cat_llh, cb, data, startcat, - startidx, false); + return llog_cat_process_or_fork(env, cat_llh, llog_cat_process_cb, cb, + data, startcat, startidx, false); } EXPORT_SYMBOL(llog_cat_process); -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/22] staging: lustre: obdclass: lu_site_purge() to handle purge-all
From: Alex Zhuravlev if the callers wants to purge all objects, then scanning should start from the first bucket. Signed-off-by: Alex Zhuravlev Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7038 Reviewed-on: http://review.whamcloud.com/18505 Reviewed-by: Mike Pershin Reviewed-by: Faccini Bruno Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/obdclass/lu_object.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/lu_object.c b/drivers/staging/lustre/lustre/obdclass/lu_object.c index 43868ed..a02aaa3 100644 --- a/drivers/staging/lustre/lustre/obdclass/lu_object.c +++ b/drivers/staging/lustre/lustre/obdclass/lu_object.c @@ -338,7 +338,7 @@ int lu_site_purge(const struct lu_env *env, struct lu_site *s, int nr) struct cfs_hash_bd bd2; struct list_head dispose; int did_sth; - unsigned int start; + unsigned int start = 0; int count; int bnr; unsigned int i; @@ -351,7 +351,8 @@ int lu_site_purge(const struct lu_env *env, struct lu_site *s, int nr) * Under LRU list lock, scan LRU list and move unreferenced objects to * the dispose list, removing them from LRU and hash table. */ - start = s->ls_purge_start; + if (nr != ~0) + start = s->ls_purge_start; bnr = (nr == ~0) ? -1 : nr / (int)CFS_HASH_NBKT(s->ls_obj_hash) + 1; again: /* -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 21/22] staging: lustre: remove set but unused variables
From: Yang Sheng Remove set but unused variables in nidstring.c and osc_request.c as reported by make W=1. Signed-off-by: Yang Sheng Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8378 Reviewed-on: http://review.whamcloud.com/23221 Reviewed-by: Bob Glossman Reviewed-by: Emoly Liu Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lnet/lnet/nidstrings.c |2 -- drivers/staging/lustre/lustre/osc/osc_request.c |3 +-- 2 files changed, 1 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/nidstrings.c b/drivers/staging/lustre/lnet/lnet/nidstrings.c index e1f1ca8..a9fe3e6 100644 --- a/drivers/staging/lustre/lnet/lnet/nidstrings.c +++ b/drivers/staging/lustre/lnet/lnet/nidstrings.c @@ -247,10 +247,8 @@ struct addrrange { { struct cfs_lstr addrrange; struct cfs_lstr net; - struct cfs_lstr tmp; struct nidrange *nr; - tmp = *src; if (!cfs_gettok(src, '@', &addrrange)) goto failed; diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c b/drivers/staging/lustre/lustre/osc/osc_request.c index 0977127..0c50225 100644 --- a/drivers/staging/lustre/lustre/osc/osc_request.c +++ b/drivers/staging/lustre/lustre/osc/osc_request.c @@ -933,7 +933,6 @@ static u32 osc_checksum_bulk(int nob, u32 pg_count, int i = 0; struct cfs_crypto_hash_desc *hdesc; unsigned int bufsize; - int err; unsigned char cfs_alg = cksum_obd2cfs(cksum_type); LASSERT(pg_count > 0); @@ -975,7 +974,7 @@ static u32 osc_checksum_bulk(int nob, u32 pg_count, } bufsize = sizeof(cksum); - err = cfs_crypto_hash_final(hdesc, (unsigned char *)&cksum, &bufsize); + cfs_crypto_hash_final(hdesc, (unsigned char *)&cksum, &bufsize); /* For sending we only compute the wrong checksum instead * of corrupting the data so it is still correct on a redo -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 18/22] staging: lustre: import: don't reconnect during connect interpret
From: Mikhal Pershin The import connect flags might be cleared by ptlrpc_connect_import() wrongly if there is still connect interpret function is running. Use imp_connected boolean variable to indicate that we are still interpretting connect reply and don't try to reconnect until it ends. Signed-off-by: Mikhal Pershin Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7558 Reviewed-on: http://review.whamcloud.com/19312 Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/lustre/include/lustre_import.h |4 +++- drivers/staging/lustre/lustre/ptlrpc/import.c | 16 +++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_import.h b/drivers/staging/lustre/lustre/include/lustre_import.h index 4499c69..f0c931c 100644 --- a/drivers/staging/lustre/lustre/include/lustre_import.h +++ b/drivers/staging/lustre/lustre/include/lustre_import.h @@ -299,7 +299,9 @@ struct obd_import { */ imp_force_reconnect:1, /* import has tried to connect with server */ - imp_connect_tried:1; + imp_connect_tried:1, +/* connected but not FULL yet */ +imp_connected:1; __u32imp_connect_op; struct obd_connect_data imp_connect_data; __u64imp_connect_flags_orig; diff --git a/drivers/staging/lustre/lustre/ptlrpc/import.c b/drivers/staging/lustre/lustre/ptlrpc/import.c index 66f5b49..e828019 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/import.c +++ b/drivers/staging/lustre/lustre/ptlrpc/import.c @@ -622,7 +622,8 @@ int ptlrpc_connect_import(struct obd_import *imp) spin_unlock(&imp->imp_lock); CERROR("already connected\n"); return 0; - } else if (imp->imp_state == LUSTRE_IMP_CONNECTING) { + } else if (imp->imp_state == LUSTRE_IMP_CONNECTING || + imp->imp_connected) { spin_unlock(&imp->imp_lock); CERROR("already connecting\n"); return -EALREADY; @@ -971,6 +972,13 @@ static int ptlrpc_connect_interpret(const struct lu_env *env, ptlrpc_maybe_ping_import_soon(imp); goto out; } + + /* +* LU-7558: indicate that we are interpretting connect reply, +* pltrpc_connect_import() will not try to reconnect until +* interpret will finish. +*/ + imp->imp_connected = 1; spin_unlock(&imp->imp_lock); LASSERT(imp->imp_conn_current); @@ -1194,12 +1202,18 @@ static int ptlrpc_connect_interpret(const struct lu_env *env, obd2cli_tgt(imp->imp_obd), imp->imp_connection->c_remote_uuid.uuid); ptlrpc_connect_import(imp); + spin_lock(&imp->imp_lock); + imp->imp_connected = 0; imp->imp_connect_tried = 1; + spin_unlock(&imp->imp_lock); return 0; } out: + spin_lock(&imp->imp_lock); + imp->imp_connected = 0; imp->imp_connect_tried = 1; + spin_unlock(&imp->imp_lock); if (rc != 0) { IMPORT_SET_STATE(imp, LUSTRE_IMP_DISCON); -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/22] staging: lustre: osc: handle osc eviction correctly
From: Jinshan Xiong Cleanup everything if an OSC is being evicted. Group lock is not well supported yet. Signed-off-by: Jinshan Xiong Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6271 Reviewed-on: http://review.whamcloud.com/14989 Reviewed-by: John L. Hammond Reviewed-by: Bobi Jam Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c |3 +- drivers/staging/lustre/lustre/osc/osc_cache.c | 25 .../staging/lustre/lustre/osc/osc_cl_internal.h| 11 ++- drivers/staging/lustre/lustre/osc/osc_internal.h |2 + drivers/staging/lustre/lustre/osc/osc_io.c | 60 +++ drivers/staging/lustre/lustre/osc/osc_object.c | 19 ++ drivers/staging/lustre/lustre/osc/osc_request.c| 42 +++-- 7 files changed, 124 insertions(+), 38 deletions(-) diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c index d03e6d4..c1665f9 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c @@ -1130,8 +1130,7 @@ static int lock_matches(struct ldlm_lock *lock, struct lock_match_data *data) if (!data->lmd_unref && LDLM_HAVE_MASK(lock, GONE)) return INTERVAL_ITER_CONT; - if ((data->lmd_flags & LDLM_FL_LOCAL_ONLY) && - !ldlm_is_local(lock)) + if (!equi(data->lmd_flags & LDLM_FL_LOCAL_ONLY, ldlm_is_local(lock))) return INTERVAL_ITER_CONT; if (data->lmd_flags & LDLM_FL_TEST_LOCK) { diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c b/drivers/staging/lustre/lustre/osc/osc_cache.c index b0f030c..76942cc 100644 --- a/drivers/staging/lustre/lustre/osc/osc_cache.c +++ b/drivers/staging/lustre/lustre/osc/osc_cache.c @@ -247,7 +247,7 @@ static int osc_extent_sanity_check0(struct osc_extent *ext, goto out; } - if (ext->oe_dlmlock) { + if (ext->oe_dlmlock && !ldlm_is_failed(ext->oe_dlmlock)) { struct ldlm_extent *extent; extent = &ext->oe_dlmlock->l_policy_data.l_extent; @@ -2710,8 +2710,8 @@ int osc_queue_sync_pages(const struct lu_env *env, struct osc_object *obj, /** * Called by osc_io_setattr_start() to freeze and destroy covering extents. */ -int osc_cache_truncate_start(const struct lu_env *env, struct osc_io *oio, -struct osc_object *obj, __u64 size) +int osc_cache_truncate_start(const struct lu_env *env, struct osc_object *obj, +u64 size, struct osc_extent **extp) { struct client_obd *cli = osc_cli(obj); struct osc_extent *ext; @@ -2808,9 +2808,11 @@ int osc_cache_truncate_start(const struct lu_env *env, struct osc_io *oio, /* we need to hold this extent in OES_TRUNC state so * that no writeback will happen. This is to avoid * BUG 17397. +* Only partial truncate can reach here, if @size is +* not zero, the caller should provide a valid @extp. */ - LASSERT(!oio->oi_trunc); - oio->oi_trunc = osc_extent_get(ext); + LASSERT(!*extp); + *extp = osc_extent_get(ext); OSC_EXTENT_DUMP(D_CACHE, ext, "trunc at %llu\n", size); } @@ -2836,13 +2838,10 @@ int osc_cache_truncate_start(const struct lu_env *env, struct osc_io *oio, /** * Called after osc_io_setattr_end to add oio->oi_trunc back to cache. */ -void osc_cache_truncate_end(const struct lu_env *env, struct osc_io *oio, - struct osc_object *obj) +void osc_cache_truncate_end(const struct lu_env *env, struct osc_extent *ext) { - struct osc_extent *ext = oio->oi_trunc; - - oio->oi_trunc = NULL; if (ext) { + struct osc_object *obj = ext->oe_obj; bool unplug = false; EASSERT(ext->oe_nr_pages > 0, ext); @@ -3183,8 +3182,10 @@ static int discard_cb(const struct lu_env *env, struct cl_io *io, /* page is top page. */ info->oti_next_index = osc_index(ops) + 1; if (cl_page_own(env, io, page) == 0) { - KLASSERT(ergo(page->cp_type == CPT_CACHEABLE, - !PageDirty(cl_page_vmpage(page; + if (!ergo(page->cp_type == CPT_CACHEABLE, + !PageDirty(cl_page_vmpage(page + CL_PAGE_DEBUG(D_ERROR, env, page, + "discard dirty page?\n"); /* discard the page */ cl_page_discard(env, io, page); diff --git a/drivers/staging/lustre/lustre/osc/osc_cl_internal.h b/drivers/staging/lustre/lustre/osc/osc_cl_internal.h index cce55a9..c09ab97 100644 ---
[PATCH 17/22] staging: lustre: clio: remove mtime check in vvp_io_fault_start()
From: Bobi Jam In fault IO initialization, inode's mtime is saved, and after getting locks, when the IO is about to start, vvp_io_fault_start() checks the mtime's intactness. It's a false alarm, since the timestamp from MDS could be stale, we maintain mtime mainly on OST objects, and if the check in vvp_io_fault_start() happens before mtime on OST objects are merged, it will get wrong timestamp from the inode, even the timestamp it fetched in vvp_io_fault_init() could be wrong in the first place. This patch remove the mtime check in vvp_io_fault_start(). Signed-off-by: Bobi Jam Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7198 Reviewed-on: http://review.whamcloud.com/19162 Reviewed-by: Andreas Dilger Reviewed-by: Jinshan Xiong Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/vvp_io.c |6 -- 1 files changed, 0 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/vvp_io.c b/drivers/staging/lustre/lustre/llite/vvp_io.c index 114906d..0b6d388 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_io.c +++ b/drivers/staging/lustre/lustre/llite/vvp_io.c @@ -1064,12 +1064,6 @@ static int vvp_io_fault_start(const struct lu_env *env, loff_t size; pgoff_t last_index; - if (fio->ft_executable && - inode->i_mtime.tv_sec != vio->u.fault.ft_mtime) - CWARN("binary "DFID - " changed while waiting for the page fault lock\n", - PFID(lu_object_fid(&obj->co_lu))); - down_read(&lli->lli_trunc_sem); /* offset of the last byte on the page */ -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: vt6655: Add spaces around +
Add spaces around + for better readability of the code. Signed-off-by: PrasannaKumar Muralidharan --- drivers/staging/vt6655/device_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c index a6f7a4f..da0f711 100644 --- a/drivers/staging/vt6655/device_main.c +++ b/drivers/staging/vt6655/device_main.c @@ -310,7 +310,7 @@ static void device_init_registers(struct vnt_private *priv) SROMbyReadEmbedded(priv->PortOffset, (unsigned char)(ii + EEP_OFS_CCK_PWR_TBL)); if (priv->abyCCKPwrTbl[ii + 1] == 0) - priv->abyCCKPwrTbl[ii+1] = priv->byCCKPwr; + priv->abyCCKPwrTbl[ii + 1] = priv->byCCKPwr; priv->abyOFDMPwrTbl[ii + 1] = SROMbyReadEmbedded(priv->PortOffset, @@ -552,7 +552,7 @@ static void device_init_rd0_ring(struct vnt_private *priv) if (!device_alloc_rx_buf(priv, desc)) dev_err(&priv->pcid->dev, "can not alloc rx bufs\n"); - desc->next = &(priv->aRD0Ring[(i+1) % priv->opts.rx_descs0]); + desc->next = &(priv->aRD0Ring[(i + 1) % priv->opts.rx_descs0]); desc->next_desc = cpu_to_le32(curr + sizeof(struct vnt_rx_desc)); } -- 2.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel