Re: [PATCH 0/6] Intel Secure Guard Extensions
On Fri 2016-05-06 01:52:04, Jarkko Sakkinen wrote: > On Mon, May 02, 2016 at 11:37:52AM -0400, Austin S. Hemmelgarn wrote: > > On 2016-04-29 16:17, Jarkko Sakkinen wrote: > > >On Tue, Apr 26, 2016 at 09:00:10PM +0200, Pavel Machek wrote: > > >>On Mon 2016-04-25 20:34:07, Jarkko Sakkinen wrote: > > >>>Intel(R) SGX is a set of CPU instructions that can be used by > > >>>applications to set aside private regions of code and data. The code > > >>>outside the enclave is disallowed to access the memory inside the > > >>>enclave by the CPU access control. > > >>> > > >>>The firmware uses PRMRR registers to reserve an area of physical memory > > >>>called Enclave Page Cache (EPC). There is a hardware unit in the > > >>>processor called Memory Encryption Engine. The MEE encrypts and decrypts > > >>>the EPC pages as they enter and leave the processor package. > > >> > > >>What are non-evil use cases for this? > > > > > >I'm not sure what you mean by non-evil. > > > > > I would think that this should be pretty straightforward. Pretty much every > > security technology integrated in every computer in existence has the > > potential to be used by malware for various purposes. Based on a cursory > > look at SGX, it is pretty easy to figure out how to use this to hide > > arbitrary code from virus scanners and the OS itself unless you have some > > way to force everything to be a debug enclave, which entirely defeats the > > stated purpose of the extensions. I can see this being useful for tight > > embedded systems. On a desktop which I have full control of physical access > > to though, it's something I'd immediately turn off, because the risk of > > misuse is so significant (I've done so on my new Thinkpad L560 too, although > > that's mostly because Linux doesn't support it yet). > > The code in enclave binary is in clear text so it does not really > allow you to completely hide any code. It's a signed binary, not > encypted binary. Umm. Now you are evil. Yes, the code that starts in the enclave may not be encrypted, but I'm pretty sure the enclave will download some more code from remote server after attestation... x86 or some kind of interpretted code. (But of course we already know that the technology is evil, as only Intel can use it, see Ingo's reply.) Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 1/1] staging: unisys: remove unused struct members
On 06/05/16 02:05, David Kershner wrote: > From: Erik Arfvidson > > The following struct members were never used: > putfile_active_buffer::pnext > putfile_request::file_request_number > putfile_request::data_sequence_number > > Signed-off-by: Erik Arfvidson > Signed-off-by: David Kershner > --- > drivers/staging/unisys/visorbus/visorchipset.c | 6 -- > 1 file changed, 6 deletions(-) > > diff --git a/drivers/staging/unisys/visorbus/visorchipset.c > b/drivers/staging/unisys/visorbus/visorchipset.c > index 7522559..f0bbf52 100644 > --- a/drivers/staging/unisys/visorbus/visorchipset.c > +++ b/drivers/staging/unisys/visorbus/visorchipset.c > @@ -151,8 +151,6 @@ struct putfile_active_buffer { > /* a payload from a controlvm message, containing a file data buffer */ > struct parser_context *parser_ctx; > /* points within data area of parser_ctx to next byte of data */ > - u8 *pnext; > - /* # bytes left from to the end of this data buffer */ > size_t bytes_remaining; > }; > > @@ -166,14 +164,10 @@ struct putfile_request { > > /* header from original TransmitFile request */ > struct controlvm_message_header controlvm_header; > - u64 file_request_number;/* from original TransmitFile request */ > > /* link to next struct putfile_request */ > struct list_head next_putfile_request; > > - /* most-recent sequence number supplied via a controlvm message */ > - u64 data_sequence_number; > - > /* head of putfile_buffer_entry list, which describes the data to be >* supplied as putfile data; >* - this list is added to when controlvm messages come in that supply > Looks good. Small note, when it is one patch and not a series. Instead of having a cover email [0/1] you can write comments about the patch that won't end in the git log right after the "---" line, after the Signed-off-bys and the diff. Here are two examples: https://lkml.org/lkml/2016/5/5/483 https://lkml.org/lkml/2016/5/5/335 Thanks :) Luis ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 0/6] Intel Secure Guard Extensions
On Wed, Apr 27, 2016 at 10:18:05AM +0200, Ingo Molnar wrote: > > * Andy Lutomirski wrote: > > > > What new syscalls would be needed for ssh to get all this support? > > > > This patchset or similar, plus some user code and an enclave to use. > > > > Sadly, on current CPUs, you also need Intel to bless the enclave. It looks > > like > > new CPUs might relax that requirement. > > That looks like a fundamental technical limitation in my book - to an open > source > user this is essentially a very similar capability as tboot: it only allows > the > execution of externally blessed static binary blobs... > > I don't think we can merge any of this upstream until it's clear that the > hardware > owner running open-source user-space can also freely define/start his own > secure > enclaves without having to sign the enclave with any external party. I.e. > self-signed enclaves should be fundamentally supported as well. Post Skylake we will have a set of MSRs for defining your own root of trust: IA32_SGXLEPUBKEYHASH. Andy had a concern that you could set root of trust multiple times, which could lead to potential attack scenarios. These MSRs are one-shot. ENCLS will fail if the launch control is locked. There's no possiblity to have a root of trust that is unlocked. > Thanks, > > Ingo /Jarkko ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 0/6] Intel Secure Guard Extensions
On Tue, May 03, 2016 at 04:06:27AM -0500, Dr. Greg Wettstein wrote: > It would be helpful and instructive for anyone involved in this debate > to review the following URL which details Intel's SGX licening > program: > > https://software.intel.com/en-us/articles/intel-sgx-product-licensing I think it would be good to note that the licensing process is available only for Windows. For Linux you can only use debug enclaves at the moment. The default LE has "allow-all" policy for debug enclaves. > I think the only way forward to make all of this palatable is to > embrace something similar to what has been done with Secure Boot. The > Root Enclave Key will need to be something which can be reconfigured > by the Platform Owner through BIOS/EFI. That model would take Intel > off the hook from a security perspective and establish the notion of > platform trust to be a bilateral relationship between a service > provider and client. This concern has been raised many times now. Sadly this did not make into Skyle but in future we will have one shot MSRs (can be set only once per boot cycle) for defining your own root of trust. /Jarkko ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: unisys: visornic: comment restructuring and removing bad diction
On 06/05/16 03:26, David Kershner wrote: > From: Erik Arfvidson > > The purpose of this patch is to clean up commenting and making the > code with comments be pleasant to eyes. Also make commenting be > consistent throughout the file. > > Signed-off-by: Erik Arfvidson > Signed-off-by: David Kershner > --- > drivers/staging/unisys/visornic/visornic_main.c | 152 > +--- > 1 file changed, 58 insertions(+), 94 deletions(-) > > diff --git a/drivers/staging/unisys/visornic/visornic_main.c > b/drivers/staging/unisys/visornic/visornic_main.c > index de983d2..2c43396 100644 > --- a/drivers/staging/unisys/visornic/visornic_main.c > +++ b/drivers/staging/unisys/visornic/visornic_main.c > @@ -109,51 +109,46 @@ struct chanstat { > }; > > struct visornic_devdata { > - unsigned short enabled; /* 0 disabled 1 enabled to receive */ > - unsigned short enab_dis_acked; /* NET_RCV_ENABLE/DISABLE acked by > - * IOPART > - */ > + /* 0 disabled 1 enabled to receive */ > + unsigned short enabled; > + /* NET_RCV_ENABLE/DISABLE acked by IOPART */ > + unsigned short enab_dis_acked; > + > struct visor_device *dev; > struct net_device *netdev; > struct net_device_stats net_stats; > atomic_t interrupt_rcvd; > wait_queue_head_t rsp_queue; > struct sk_buff **rcvbuf; > - u64 incarnation_id; /* lets IOPART know about re-birth */ > - unsigned short old_flags; /* flags as they were prior to > - * set_multicast_list > - */ > - atomic_t usage; /* count of users */ > - int num_rcv_bufs; /* indicates how many rcv buffers > - * the vnic will post > - */ > + /* incarnation_id lets IOPART know about re-birth */ > + u64 incarnation_id; > + /* flags as they were prior to set_multicast_list */ > + unsigned short old_flags; > + atomic_t usage; /* count of users */ > + > + /* number of rcv buffers the vnic will post */ > + int num_rcv_bufs; > int num_rcv_bufs_could_not_alloc; > atomic_t num_rcvbuf_in_iovm; > unsigned long alloc_failed_in_if_needed_cnt; > unsigned long alloc_failed_in_repost_rtn_cnt; > - unsigned long max_outstanding_net_xmits; /* absolute max number of > - * outstanding xmits - should > - * never hit this > - */ > - unsigned long upper_threshold_net_xmits; /* high water mark for > -* calling netif_stop_queue() > -*/ > - unsigned long lower_threshold_net_xmits; /* high water mark for calling > - * netif_wake_queue() > - */ > - struct sk_buff_head xmitbufhead; /* xmitbufhead is the head of the > - * xmit buffer list that have been > - * sent to the IOPART end > - */ > + > + /* absolute max number of outstanding xmits - should never hit this */ > + unsigned long max_outstanding_net_xmits; > + /* high water mark for calling netif_stop_queue() */ > + unsigned long upper_threshold_net_xmits; > + /* high water mark for calling netif_wake_queue() */ > + unsigned long lower_threshold_net_xmits; > + /* xmitbufhead - head of the xmit buffer list sent to the IOPART end */ > + struct sk_buff_head xmitbufhead; > + > visorbus_state_complete_func server_down_complete_func; > struct work_struct timeout_reset; > - struct uiscmdrsp *cmdrsp_rcv;/* cmdrsp_rcv is used for > - * posting/unposting rcv buffers > - */ > - struct uiscmdrsp *xmit_cmdrsp; /* used to issue NET_XMIT - there is > - * never more that one xmit in > - * progress at a time > - */ > + /* cmdrsp_rcv is used for posting/unposting rcv buffers */ > + struct uiscmdrsp *cmdrsp_rcv; > + /* xmit_cmdrsp - issues NET_XMIT - only one active xmit at a time */ > + struct uiscmdrsp *xmit_cmdrsp; > + > bool server_down;/* IOPART is down */ > bool server_change_state;/* Processing SERVER_CHANGESTATE msg */ > bool going_away; /* device is being torn down */ > @@ -173,18 +168,10 @@ struct visornic_devdata { > unsigned long n_rcv1; /* # rcvs of 1 buffers */ > unsigned long n_rcv2;
Re: [PATCH] staging: comedi: dt2811: add async command support for AI subdevice
On 04/05/16 23:25, H Hartley Sweeten wrote: The interrupt support available on this board is pretty limited but its simple enough to give basic async command support. This allows reading a single channel continuously using either the internal or an external clock to trigger each conversion. The command can also use the external trigger input to start the command if the external clock is being used for conversions. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- This is a follow up to: [PATCH v2 00/19] staging: comedi: dt2811: cleanup driver According to Data Translation's website, this ISA board _just_ went EOL on May 1, 2016. Who knows, there might actually be someone out there that is using it. drivers/staging/comedi/drivers/dt2811.c | 371 +--- 1 file changed, 340 insertions(+), 31 deletions(-) Thanks! Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 0/6] Intel Secure Guard Extensions
On Fri, 6 May 2016, Jarkko Sakkinen wrote: > On Tue, May 03, 2016 at 04:06:27AM -0500, Dr. Greg Wettstein wrote: > > It would be helpful and instructive for anyone involved in this debate > > to review the following URL which details Intel's SGX licening > > program: > > > > https://software.intel.com/en-us/articles/intel-sgx-product-licensing > > I think it would be good to note that the licensing process is available > only for Windows. For Linux you can only use debug enclaves at the > moment. The default LE has "allow-all" policy for debug enclaves. Which makes the feature pretty useless. > > I think the only way forward to make all of this palatable is to > > embrace something similar to what has been done with Secure Boot. The > > Root Enclave Key will need to be something which can be reconfigured > > by the Platform Owner through BIOS/EFI. That model would take Intel > > off the hook from a security perspective and establish the notion of > > platform trust to be a bilateral relationship between a service > > provider and client. > > This concern has been raised many times now. Sadly this did not make > into Skyle but in future we will have one shot MSRs (can be set only > once per boot cycle) for defining your own root of trust. We'll wait for that to happen. Thanks, tglx ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 0/6] Intel Secure Guard Extensions
On Fri, May 06, 2016 at 09:14:43AM +0200, Pavel Machek wrote: > On Fri 2016-05-06 01:52:04, Jarkko Sakkinen wrote: > > On Mon, May 02, 2016 at 11:37:52AM -0400, Austin S. Hemmelgarn wrote: > > > On 2016-04-29 16:17, Jarkko Sakkinen wrote: > > > >On Tue, Apr 26, 2016 at 09:00:10PM +0200, Pavel Machek wrote: > > > >>On Mon 2016-04-25 20:34:07, Jarkko Sakkinen wrote: > > > >>>Intel(R) SGX is a set of CPU instructions that can be used by > > > >>>applications to set aside private regions of code and data. The code > > > >>>outside the enclave is disallowed to access the memory inside the > > > >>>enclave by the CPU access control. > > > >>> > > > >>>The firmware uses PRMRR registers to reserve an area of physical memory > > > >>>called Enclave Page Cache (EPC). There is a hardware unit in the > > > >>>processor called Memory Encryption Engine. The MEE encrypts and > > > >>>decrypts > > > >>>the EPC pages as they enter and leave the processor package. > > > >> > > > >>What are non-evil use cases for this? > > > > > > > >I'm not sure what you mean by non-evil. > > > > > > > I would think that this should be pretty straightforward. Pretty much > > > every > > > security technology integrated in every computer in existence has the > > > potential to be used by malware for various purposes. Based on a cursory > > > look at SGX, it is pretty easy to figure out how to use this to hide > > > arbitrary code from virus scanners and the OS itself unless you have some > > > way to force everything to be a debug enclave, which entirely defeats the > > > stated purpose of the extensions. I can see this being useful for tight > > > embedded systems. On a desktop which I have full control of physical > > > access > > > to though, it's something I'd immediately turn off, because the risk of > > > misuse is so significant (I've done so on my new Thinkpad L560 too, > > > although > > > that's mostly because Linux doesn't support it yet). > > > > The code in enclave binary is in clear text so it does not really > > allow you to completely hide any code. It's a signed binary, not > > encypted binary. > > Umm. Now you are evil. > > Yes, the code that starts in the enclave may not be encrypted, but I'm > pretty sure the enclave will download some more code from remote > server after attestation... x86 or some kind of interpretted code. > > (But of course we already know that the technology is evil, as only > Intel can use it, see Ingo's reply.) Somehow that email from Ingo dissolved to my inbox :( Anyway, I gave now my response. For my part I'll create a second revision of the patch set and update the documentation so that it has reasonable explanation about root of trust SGX. > -- > (english) http://www.livejournal.com/~pavelmachek > (cesky, pictures) > http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html /Jarkko ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 0/6] Intel Secure Guard Extensions
On Fri, May 6, 2016 at 4:23 AM, Jarkko Sakkinen wrote: > On Wed, Apr 27, 2016 at 10:18:05AM +0200, Ingo Molnar wrote: >> >> * Andy Lutomirski wrote: >> >> > > What new syscalls would be needed for ssh to get all this support? >> > >> > This patchset or similar, plus some user code and an enclave to use. >> > >> > Sadly, on current CPUs, you also need Intel to bless the enclave. It >> > looks like >> > new CPUs might relax that requirement. >> >> That looks like a fundamental technical limitation in my book - to an open >> source >> user this is essentially a very similar capability as tboot: it only allows >> the >> execution of externally blessed static binary blobs... >> >> I don't think we can merge any of this upstream until it's clear that the >> hardware >> owner running open-source user-space can also freely define/start his own >> secure >> enclaves without having to sign the enclave with any external party. I.e. >> self-signed enclaves should be fundamentally supported as well. > > Post Skylake we will have a set of MSRs for defining your own root of > trust: IA32_SGXLEPUBKEYHASH. > > Andy had a concern that you could set root of trust multiple times, > which could lead to potential attack scenarios. These MSRs are one-shot. > ENCLS will fail if the launch control is locked. There's no possiblity > to have a root of trust that is unlocked. If this is actually true, can you ask the architecture folks to clarify their manual. The MSR description in table 35-2 says "Write permitted if CPUID.(EAX=12H,ECX=0H): EAX[0]=1 && IA32_FEATURE_CONTROL[17] = 1 && IA32_FEATURE_CONTROL[0] = 1" 39.1.4 says "If IA32_FEATURE_CONTROL is locked with bit 17 set, IA32_SGXLEPUBKEYHASH MSRs are reconfigurable (writeable). If either IA32_FEATURE_CONTROL is not locked or bit 17 is clear, the MSRs are read only. By leaving these MSRs writable, system SW or a VMM can support a plurality of Launch Enclaves for hosting multiple execution environments." This does not sound like one-shot to me. It sounds quite clear, in fact, that it's *not* one-shot so a "plurality" of these things are supported. --Andy ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v9 net-next 1/2] hv_sock: introduce Hyper-V Sockets
From: Dexuan Cui Date: Wed, 4 May 2016 09:56:57 -0700 > +#define VMBUS_RINGBUFFER_SIZE_HVSOCK_RECV (5 * PAGE_SIZE) > +#define VMBUS_RINGBUFFER_SIZE_HVSOCK_SEND (5 * PAGE_SIZE) > + > +#define HVSOCK_RCV_BUF_SZVMBUS_RINGBUFFER_SIZE_HVSOCK_RECV ... > +struct hvsock_sock { ... > + /* The 'hdr' and 'buf' in the below 'send' and 'recv' definitions must > + * be consecutive: see hvsock_send_data() and hvsock_recv_data(). > + */ > + struct { > + struct vmpipe_proto_header hdr; > + u8 buf[HVSOCK_SND_BUF_SZ]; > + } send; > + > + struct { > + struct vmpipe_proto_header hdr; > + u8 buf[HVSOCK_RCV_BUF_SZ]; > + > + unsigned int data_len; > + unsigned int data_offset; > + } recv; I don't think allocating 5 pages of unswappable memory for every Hyper-V socket created is reasonable. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 00/10] staging: unisys: driver updates
Patch series containing fixes for the s-Par unisys drivers. Each patch can be applied independently, if needed. Alexander Curtin (1): staging: unisys: visorhba: replace functionlike macro with function David Binder (2): staging: unisys: visorchannel: correct variable misspelling staging: unisys: visorhba: switch success handling to error handling Erik Arfvidson (4): staging: unisys: remove unused struct members staging: unisys: fix format string %Lx to %llx for u64 staging: unisys: visornic: comment restructuring and removing bad diction staging: unisys: rename misleading var ii with frag Tim Sell (3): staging: unisys: visorhba: fail gracefully for thread creation failures staging: unisys: visorinput: handle_locking_key() simplifications staging: unisys: visorhba: main path needs to flow down the left margin drivers/staging/unisys/include/iochannel.h | 42 -- drivers/staging/unisys/visorbus/visorbus_main.c | 10 +- drivers/staging/unisys/visorbus/visorchipset.c | 8 +- drivers/staging/unisys/visorhba/visorhba_main.c | 114 ++--- drivers/staging/unisys/visorinput/visorinput.c | 18 +-- drivers/staging/unisys/visornic/visornic_main.c | 162 +--- 6 files changed, 144 insertions(+), 210 deletions(-) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/10] staging: unisys: remove unused struct members
From: Erik Arfvidson The following struct members were never used: putfile_active_buffer::pnext putfile_request::file_request_number putfile_request::data_sequence_number Signed-off-by: Erik Arfvidson Signed-off-by: David Kershner Reviewed-by: Luis de Bethencourt --- drivers/staging/unisys/visorbus/visorchipset.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 7522559..f0bbf52 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -151,8 +151,6 @@ struct putfile_active_buffer { /* a payload from a controlvm message, containing a file data buffer */ struct parser_context *parser_ctx; /* points within data area of parser_ctx to next byte of data */ - u8 *pnext; - /* # bytes left from to the end of this data buffer */ size_t bytes_remaining; }; @@ -166,14 +164,10 @@ struct putfile_request { /* header from original TransmitFile request */ struct controlvm_message_header controlvm_header; - u64 file_request_number;/* from original TransmitFile request */ /* link to next struct putfile_request */ struct list_head next_putfile_request; - /* most-recent sequence number supplied via a controlvm message */ - u64 data_sequence_number; - /* head of putfile_buffer_entry list, which describes the data to be * supplied as putfile data; * - this list is added to when controlvm messages come in that supply -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/10] staging: unisys: visorchannel: correct variable misspelling
From: David Binder Fixes the spelling of a global variable passed into a kernel macro. Signed-off-by: David Binder Signed-off-by: David Kershner --- drivers/staging/unisys/visorbus/visorchipset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 6d9bbae..7522559 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -2348,7 +2348,7 @@ module_param_named(major, visorchipset_major, int, S_IRUGO); MODULE_PARM_DESC(visorchipset_major, "major device number to use for the device node"); module_param_named(visorbusregwait, visorchipset_visorbusregwait, int, S_IRUGO); -MODULE_PARM_DESC(visorchipset_visorbusreqwait, +MODULE_PARM_DESC(visorchipset_visorbusregwait, "1 to have the module wait for the visor bus to register"); module_init(init_unisys); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/10] staging: unisys: visorhba: replace functionlike macro with function
From: Alexander Curtin The `set_no_disk_inquiry_request` function now uses the correct min macro. Also I removed an unnecessary conditional. Get rid of u8 casts, u32 len, and u32 lun (which is actually defined as a u64 in the scsidev->lun field from whence it originated). Signed-off-by: Alexander Curtin Signed-off-by: Tim Sell Signed-off-by: Erik Arfvidson Signed-off-by: David Kershner --- drivers/staging/unisys/include/iochannel.h | 42 - drivers/staging/unisys/visorhba/visorhba_main.c | 26 --- 2 files changed, 22 insertions(+), 46 deletions(-) diff --git a/drivers/staging/unisys/include/iochannel.h b/drivers/staging/unisys/include/iochannel.h index 880d9f0..5ccf814 100644 --- a/drivers/staging/unisys/include/iochannel.h +++ b/drivers/staging/unisys/include/iochannel.h @@ -253,48 +253,6 @@ struct uiscmdrsp_scsi { /* SCSI device version for no disk inquiry result */ #define SCSI_SPC2_VER 4/* indicates SCSI SPC2 (SPC3 is 5) */ -/* Windows and Linux want different things for a non-existent lun. So, we'll let - * caller pass in the peripheral qualifier and type. - * NOTE:[4] SCSI returns (n-4); so we return length-1-4 or length-5. - */ - -#define SET_NO_DISK_INQUIRY_RESULT(buf, len, lun, lun0notpresent, notpresent) \ - do {\ - memset(buf, 0, \ - MINNUM(len, \ - (unsigned int)NO_DISK_INQUIRY_RESULT_LEN)); \ - buf[2] = (u8)SCSI_SPC2_VER; \ - if (lun == 0) { \ - buf[0] = (u8)lun0notpresent;\ - buf[3] = (u8)DEV_HISUPPORT; \ - } else \ - buf[0] = (u8)notpresent;\ - buf[4] = (u8)( \ - MINNUM(len, \ - (unsigned int)NO_DISK_INQUIRY_RESULT_LEN) - 5);\ - if (len >= NO_DISK_INQUIRY_RESULT_LEN) {\ - buf[8] = 'D'; \ - buf[9] = 'E'; \ - buf[10] = 'L'; \ - buf[11] = 'L'; \ - buf[16] = 'P'; \ - buf[17] = 'S'; \ - buf[18] = 'E'; \ - buf[19] = 'U'; \ - buf[20] = 'D'; \ - buf[21] = 'O'; \ - buf[22] = ' '; \ - buf[23] = 'D'; \ - buf[24] = 'E'; \ - buf[25] = 'V'; \ - buf[26] = 'I'; \ - buf[27] = 'C'; \ - buf[28] = 'E'; \ - buf[30] = ' '; \ - buf[31] = '.'; \ - } \ - } while (0) - /* Struct & Defines to support sense information. */ /* The following struct is returned in sensebuf field in uiscmdrsp_scsi. It is diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c b/drivers/staging/unisys/visorhba/visorhba_main.c index e93bb1d..6f53f3d 100644 --- a/drivers/staging/unisys/visorhba/visorhba_main.c +++ b/drivers/staging/unisys/visorhba/visorhba_main.c @@ -52,6 +52,8 @@ static int visorhba_resume(struct visor_device *dev, static ssize_t info_debugfs_read(struct file *file, char __user *buf, size_t len, loff_t *offset); +static int set_no_disk_inquiry_result(unsigned char *buf, + size_t len, bool is_lun0); static struct dentry *visorhba_debugfs_dir; static const struct file_operations debugfs_info_fops = { .read = info_debugfs_read, @@ -772,6 +774,24 @@ do_scsi_linuxstat(struct uiscmdrsp *cmdrsp, struct scsi_cmnd *scsicmd) } } +static int set_no_disk_inquiry_result(unsigned char *buf, + size_t len, bool is_lun0) +{ + if (!buf || len < NO_DISK_INQUIRY_RESULT_LEN) +
[PATCH 04/10] staging: unisys: fix format string %Lx to %llx for u64
From: Erik Arfvidson this patch fixes the following sonarqube issue. %Lx in format string (no. 1) requires 'unsigned long long' but the argument type is 'unsigned long long' Signed-off-by: Erik Arfvidson Signed-off-by: David Kershner --- drivers/staging/unisys/visorbus/visorbus_main.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index 6216f4b..3a147db 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -252,7 +252,7 @@ static ssize_t physaddr_show(struct device *dev, struct device_attribute *attr, if (!vdev->visorchannel) return 0; - return snprintf(buf, PAGE_SIZE, "0x%Lx\n", + return snprintf(buf, PAGE_SIZE, "0x%llx\n", visorchannel_get_physaddr(vdev->visorchannel)); } @@ -274,7 +274,7 @@ static ssize_t clientpartition_show(struct device *dev, if (!vdev->visorchannel) return 0; - return snprintf(buf, PAGE_SIZE, "0x%Lx\n", + return snprintf(buf, PAGE_SIZE, "0x%llx\n", visorchannel_get_clientpartition(vdev->visorchannel)); } @@ -366,7 +366,7 @@ static ssize_t partition_handle_show(struct device *dev, struct visor_device *vdev = to_visor_device(dev); u64 handle = visorchannel_get_clientpartition(vdev->visorchannel); - return snprintf(buf, PAGE_SIZE, "0x%Lx\n", handle); + return snprintf(buf, PAGE_SIZE, "0x%llx\n", handle); } static ssize_t partition_guid_show(struct device *dev, @@ -391,7 +391,7 @@ static ssize_t channel_addr_show(struct device *dev, struct visor_device *vdev = to_visor_device(dev); u64 addr = visorchannel_get_physaddr(vdev->visorchannel); - return snprintf(buf, PAGE_SIZE, "0x%Lx\n", addr); + return snprintf(buf, PAGE_SIZE, "0x%llx\n", addr); } static ssize_t channel_bytes_show(struct device *dev, @@ -400,7 +400,7 @@ static ssize_t channel_bytes_show(struct device *dev, struct visor_device *vdev = to_visor_device(dev); u64 nbytes = visorchannel_get_nbytes(vdev->visorchannel); - return snprintf(buf, PAGE_SIZE, "0x%Lx\n", nbytes); + return snprintf(buf, PAGE_SIZE, "0x%llx\n", nbytes); } static ssize_t channel_id_show(struct device *dev, -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/10] staging: unisys: rename misleading var ii with frag
From: Erik Arfvidson This patch removes misleading variable name with a more appropriate name. Since ii is keeping track of fragments inside a for loop I renamed it frag. ii->frag Signed-off-by: Erik Arfvidson Signed-off-by: David Kershner --- drivers/staging/unisys/visornic/visornic_main.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/unisys/visornic/visornic_main.c b/drivers/staging/unisys/visornic/visornic_main.c index 2c43396..fd7c9a6 100644 --- a/drivers/staging/unisys/visornic/visornic_main.c +++ b/drivers/staging/unisys/visornic/visornic_main.c @@ -201,7 +201,7 @@ visor_copy_fragsinfo_from_skb(struct sk_buff *skb, unsigned int firstfraglen, unsigned int frags_max, struct phys_info frags[]) { - unsigned int count = 0, ii, size, offset = 0, numfrags; + unsigned int count = 0, frag, size, offset = 0, numfrags; unsigned int total_count; numfrags = skb_shinfo(skb)->nr_frags; @@ -243,12 +243,12 @@ visor_copy_fragsinfo_from_skb(struct sk_buff *skb, unsigned int firstfraglen, if ((count + numfrags) > frags_max) return -EINVAL; - for (ii = 0; ii < numfrags; ii++) { + for (frag = 0; frag < numfrags; frag++) { count = add_physinfo_entries(page_to_pfn( - skb_frag_page(&skb_shinfo(skb)->frags[ii])), - skb_shinfo(skb)->frags[ii]. + skb_frag_page(&skb_shinfo(skb)->frags[frag])), + skb_shinfo(skb)->frags[frag]. page_offset, - skb_shinfo(skb)->frags[ii]. + skb_shinfo(skb)->frags[frag]. size, count, frags_max, frags); /* add_physinfo_entries only returns * zero if the frags array is out of room -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/10] staging: unisys: visorhba: fail gracefully for thread creation failures
From: Tim Sell Previously, if visorhba ever failed to create its thread, it would have subsequently attempted to do a kthread_stop() on an invalid task_struct pointer. This was fixed via the new visor_thread_stop() function, which validates the task_struct pointer before doing the kthread_stop(). Also, the other thread-related fields in visor_thread_info (has_stopped and id) were not being used, so visor_thead_info was just removed. We also now spit out an error message if thread creation fails. Signed-off-by: Tim Sell Signed-off-by: David Kershner --- drivers/staging/unisys/visorhba/visorhba_main.c | 54 + 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c b/drivers/staging/unisys/visorhba/visorhba_main.c index 6f53f3d..176bcc3 100644 --- a/drivers/staging/unisys/visorhba/visorhba_main.c +++ b/drivers/staging/unisys/visorhba/visorhba_main.c @@ -85,12 +85,6 @@ static struct visor_driver visorhba_driver = { MODULE_DEVICE_TABLE(visorbus, visorhba_channel_types); MODULE_ALIAS("visorbus:" SPAR_VHBA_CHANNEL_PROTOCOL_UUID_STR); -struct visor_thread_info { - struct task_struct *task; - struct completion has_stopped; - int id; -}; - struct visordisk_info { u32 valid; u32 channel, id, lun; /* Disk Path */ @@ -137,7 +131,7 @@ struct visorhba_devdata { struct visordisk_info head; unsigned int max_buff_len; int devnum; - struct visor_thread_info threadinfo; + struct task_struct *thread; int thread_wait_ms; }; @@ -154,28 +148,36 @@ static struct visorhba_devices_open visorhbas_open[VISORHBA_OPEN_MAX]; (iter->lun == match->lun)) /** * visor_thread_start - starts a thread for the device - * @thrinfo: The thread to start * @threadfn: Function the thread starts * @thrcontext: Context to pass to the thread, i.e. devdata * @name: string describing name of thread * * Starts a thread for the device. * - * Return 0 on success; + * Return the task_struct * denoting the thread on success, + * or NULL on failure */ -static int visor_thread_start(struct visor_thread_info *thrinfo, - int (*threadfn)(void *), - void *thrcontext, char *name) +static struct task_struct *visor_thread_start +(int (*threadfn)(void *), void *thrcontext, char *name) { - /* used to stop the thread */ - init_completion(&thrinfo->has_stopped); - thrinfo->task = kthread_run(threadfn, thrcontext, "%s", name); - if (IS_ERR(thrinfo->task)) { - thrinfo->id = 0; - return PTR_ERR(thrinfo->task); + struct task_struct *task; + + task = kthread_run(threadfn, thrcontext, "%s", name); + if (IS_ERR(task)) { + pr_err("visorbus failed to start thread\n"); + return NULL; } - thrinfo->id = thrinfo->task->pid; - return 0; + return task; +} + +/** + * visor_thread_stop - stops the thread if it is running + */ +static void visor_thread_stop(struct task_struct *task) +{ + if (!task) + return; /* no thread running */ + kthread_stop(task); } /** @@ -683,7 +685,7 @@ static void visorhba_serverdown_complete(struct visorhba_devdata *devdata) /* Stop using the IOVM response queue (queue should be drained * by the end) */ - kthread_stop(devdata->threadinfo.task); + visor_thread_stop(devdata->thread); /* Fail commands that weren't completed */ spin_lock_irqsave(&devdata->privlock, flags); @@ -1082,8 +1084,8 @@ static int visorhba_resume(struct visor_device *dev, if (devdata->serverdown && !devdata->serverchangingstate) devdata->serverchangingstate = true; - visor_thread_start(&devdata->threadinfo, process_incoming_rsps, - devdata, "vhba_incming"); + devdata->thread = visor_thread_start(process_incoming_rsps, devdata, +"vhba_incming"); devdata->serverdown = false; devdata->serverchangingstate = false; @@ -1159,8 +1161,8 @@ static int visorhba_probe(struct visor_device *dev) goto err_scsi_remove_host; devdata->thread_wait_ms = 2; - visor_thread_start(&devdata->threadinfo, process_incoming_rsps, - devdata, "vhba_incoming"); + devdata->thread = visor_thread_start(process_incoming_rsps, devdata, +"vhba_incoming"); scsi_scan_host(scsihost); @@ -1190,7 +1192,7 @@ static void visorhba_remove(struct visor_device *dev) return; scsihost = devdata->scsihost; - kthread_stop(devdata->threadinfo.task); + visor_thread_stop(devdata->thread); scsi_remove_host(scsihost); scsi_host_put(s
[PATCH 05/10] staging: unisys: visornic: comment restructuring and removing bad diction
From: Erik Arfvidson The purpose of this patch is to clean up commenting and making the code with comments be pleasant to eyes. Also make commenting be consistent throughout the file. Signed-off-by: Erik Arfvidson Signed-off-by: David Kershner Reviewed-by: Luis de Bethencourt --- drivers/staging/unisys/visornic/visornic_main.c | 152 +--- 1 file changed, 58 insertions(+), 94 deletions(-) diff --git a/drivers/staging/unisys/visornic/visornic_main.c b/drivers/staging/unisys/visornic/visornic_main.c index de983d2..2c43396 100644 --- a/drivers/staging/unisys/visornic/visornic_main.c +++ b/drivers/staging/unisys/visornic/visornic_main.c @@ -109,51 +109,46 @@ struct chanstat { }; struct visornic_devdata { - unsigned short enabled; /* 0 disabled 1 enabled to receive */ - unsigned short enab_dis_acked; /* NET_RCV_ENABLE/DISABLE acked by -* IOPART -*/ + /* 0 disabled 1 enabled to receive */ + unsigned short enabled; + /* NET_RCV_ENABLE/DISABLE acked by IOPART */ + unsigned short enab_dis_acked; + struct visor_device *dev; struct net_device *netdev; struct net_device_stats net_stats; atomic_t interrupt_rcvd; wait_queue_head_t rsp_queue; struct sk_buff **rcvbuf; - u64 incarnation_id; /* lets IOPART know about re-birth */ - unsigned short old_flags; /* flags as they were prior to -* set_multicast_list -*/ - atomic_t usage; /* count of users */ - int num_rcv_bufs; /* indicates how many rcv buffers -* the vnic will post -*/ + /* incarnation_id lets IOPART know about re-birth */ + u64 incarnation_id; + /* flags as they were prior to set_multicast_list */ + unsigned short old_flags; + atomic_t usage; /* count of users */ + + /* number of rcv buffers the vnic will post */ + int num_rcv_bufs; int num_rcv_bufs_could_not_alloc; atomic_t num_rcvbuf_in_iovm; unsigned long alloc_failed_in_if_needed_cnt; unsigned long alloc_failed_in_repost_rtn_cnt; - unsigned long max_outstanding_net_xmits; /* absolute max number of - * outstanding xmits - should - * never hit this - */ - unsigned long upper_threshold_net_xmits; /* high water mark for - * calling netif_stop_queue() - */ - unsigned long lower_threshold_net_xmits; /* high water mark for calling - * netif_wake_queue() - */ - struct sk_buff_head xmitbufhead; /* xmitbufhead is the head of the - * xmit buffer list that have been - * sent to the IOPART end - */ + + /* absolute max number of outstanding xmits - should never hit this */ + unsigned long max_outstanding_net_xmits; + /* high water mark for calling netif_stop_queue() */ + unsigned long upper_threshold_net_xmits; + /* high water mark for calling netif_wake_queue() */ + unsigned long lower_threshold_net_xmits; + /* xmitbufhead - head of the xmit buffer list sent to the IOPART end */ + struct sk_buff_head xmitbufhead; + visorbus_state_complete_func server_down_complete_func; struct work_struct timeout_reset; - struct uiscmdrsp *cmdrsp_rcv;/* cmdrsp_rcv is used for - * posting/unposting rcv buffers - */ - struct uiscmdrsp *xmit_cmdrsp; /* used to issue NET_XMIT - there is - * never more that one xmit in - * progress at a time - */ + /* cmdrsp_rcv is used for posting/unposting rcv buffers */ + struct uiscmdrsp *cmdrsp_rcv; + /* xmit_cmdrsp - issues NET_XMIT - only one active xmit at a time */ + struct uiscmdrsp *xmit_cmdrsp; + bool server_down;/* IOPART is down */ bool server_change_state;/* Processing SERVER_CHANGESTATE msg */ bool going_away; /* device is being torn down */ @@ -173,18 +168,10 @@ struct visornic_devdata { unsigned long n_rcv1; /* # rcvs of 1 buffers */ unsigned long n_rcv2; /* # rcvs of 2 buffers */ unsigned long
[PATCH 07/10] staging: unisys: visorinput: handle_locking_key() simplifications
From: Tim Sell By directly returning for the error-case, a test was eliminated. Also, the old_state variable was removed as it was not necessary, and some redundant parens were removed. Signed-off-by: Tim Sell Signed-off-by: David Kershner --- drivers/staging/unisys/visorinput/visorinput.c | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/staging/unisys/visorinput/visorinput.c b/drivers/staging/unisys/visorinput/visorinput.c index dc94261..12a3570 100644 --- a/drivers/staging/unisys/visorinput/visorinput.c +++ b/drivers/staging/unisys/visorinput/visorinput.c @@ -467,18 +467,14 @@ handle_locking_key(struct input_dev *visorinput_dev, break; default: led = -1; - break; + return; } - if (led >= 0) { - int old_state = (test_bit(led, visorinput_dev->led)); - - if (old_state != desired_state) { - input_report_key(visorinput_dev, keycode, 1); - input_sync(visorinput_dev); - input_report_key(visorinput_dev, keycode, 0); - input_sync(visorinput_dev); - __change_bit(led, visorinput_dev->led); - } + if (test_bit(led, visorinput_dev->led) != desired_state) { + input_report_key(visorinput_dev, keycode, 1); + input_sync(visorinput_dev); + input_report_key(visorinput_dev, keycode, 0); + input_sync(visorinput_dev); + __change_bit(led, visorinput_dev->led); } } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/10] staging: unisys: visorhba: main path needs to flow down the left margin
From: Tim Sell In del_scsipending_ent(), the error-path and main-path were switched, so the error-path is handled like 'if (err) return;', and the main-path flows down the left margin. This also allowed us to remove the initialization of "sent". Signed-off-by: Tim Sell Signed-off-by: David Kershner --- drivers/staging/unisys/visorhba/visorhba_main.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c b/drivers/staging/unisys/visorhba/visorhba_main.c index 176bcc3..7a2c489 100644 --- a/drivers/staging/unisys/visorhba/visorhba_main.c +++ b/drivers/staging/unisys/visorhba/visorhba_main.c @@ -235,16 +235,17 @@ static void *del_scsipending_ent(struct visorhba_devdata *devdata, int del) { unsigned long flags; - void *sent = NULL; + void *sent; - if (del < MAX_PENDING_REQUESTS) { - spin_lock_irqsave(&devdata->privlock, flags); - sent = devdata->pending[del].sent; + if (del >= MAX_PENDING_REQUESTS) + return NULL; - devdata->pending[del].cmdtype = 0; - devdata->pending[del].sent = NULL; - spin_unlock_irqrestore(&devdata->privlock, flags); - } + spin_lock_irqsave(&devdata->privlock, flags); + sent = devdata->pending[del].sent; + + devdata->pending[del].cmdtype = 0; + devdata->pending[del].sent = NULL; + spin_unlock_irqrestore(&devdata->privlock, flags); return sent; } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/10] staging: unisys: visorhba: switch success handling to error handling
From: David Binder Addresses code audit feeback to switch from success handling to error handling in visorhba_main.c/process_disk_notify(). Signed-off-by: David Binder Signed-off-by: David Kershner --- drivers/staging/unisys/visorhba/visorhba_main.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c b/drivers/staging/unisys/visorhba/visorhba_main.c index 7a2c489..6a4570d 100644 --- a/drivers/staging/unisys/visorhba/visorhba_main.c +++ b/drivers/staging/unisys/visorhba/visorhba_main.c @@ -950,14 +950,15 @@ static void process_disk_notify(struct Scsi_Host *shost, struct diskaddremove *dar; dar = kzalloc(sizeof(*dar), GFP_ATOMIC); - if (dar) { - dar->add = cmdrsp->disknotify.add; - dar->shost = shost; - dar->channel = cmdrsp->disknotify.channel; - dar->id = cmdrsp->disknotify.id; - dar->lun = cmdrsp->disknotify.lun; - queue_disk_add_remove(dar); - } + if (!dar) + return; + + dar->add = cmdrsp->disknotify.add; + dar->shost = shost; + dar->channel = cmdrsp->disknotify.channel; + dar->id = cmdrsp->disknotify.id; + dar->lun = cmdrsp->disknotify.lun; + queue_disk_add_remove(dar); } /** -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] ION: Sys_heap: Makes ion buffer always alloc from page pool
On 05/05/2016 07:48 PM, Chen Feng wrote: On 2016/5/6 1:09, Laura Abbott wrote: On 05/04/2016 08:27 PM, Chen Feng wrote: Makes the ion buffer always alloced from page pool, no matter it's cached or not. In this way, it can improve the efficiency of it. Currently, there is no difference from cached or non-cached buffer for the page pool. The advantage of the uncached pool was that the pages in the pool were always clean in the cache. This is lost here with the addition of cached pages to the same pool as uncached pages I agree the cache path could benefit from pooling but we need to keep the caching model consistent. Yes, the buffer in the pool is non-cached. I found that the ion don't have a invalid cache ops. Currently, we use ioctl to keep the cache coherency. In this way, there is no difference between these. So, how do you think add a new cached pool in the system heap? If yes, I can file a new patch to do this. Yes, that sounds like a good approach. Signed-off-by: Chen Feng --- drivers/staging/android/ion/ion_system_heap.c | 19 ++- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c index b69dfc7..caf11fc 100644 --- a/drivers/staging/android/ion/ion_system_heap.c +++ b/drivers/staging/android/ion/ion_system_heap.c @@ -56,24 +56,10 @@ static struct page *alloc_buffer_page(struct ion_system_heap *heap, struct ion_buffer *buffer, unsigned long order) { -bool cached = ion_buffer_cached(buffer); struct ion_page_pool *pool = heap->pools[order_to_index(order)]; struct page *page; -if (!cached) { -page = ion_page_pool_alloc(pool); -} else { -gfp_t gfp_flags = low_order_gfp_flags; - -if (order > 4) -gfp_flags = high_order_gfp_flags; -page = alloc_pages(gfp_flags | __GFP_COMP, order); -if (!page) -return NULL; -ion_pages_sync_for_device(NULL, page, PAGE_SIZE << order, -DMA_BIDIRECTIONAL); -} - +page = ion_page_pool_alloc(pool); return page; } @@ -81,9 +67,8 @@ static void free_buffer_page(struct ion_system_heap *heap, struct ion_buffer *buffer, struct page *page) { unsigned int order = compound_order(page); -bool cached = ion_buffer_cached(buffer); -if (!cached && !(buffer->private_flags & ION_PRIV_FLAG_SHRINKER_FREE)) { +if (!(buffer->private_flags & ION_PRIV_FLAG_SHRINKER_FREE)) { struct ion_page_pool *pool = heap->pools[order_to_index(order)]; ion_page_pool_free(pool, page); . ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: gdm724x: fixing coding style problems listed by checkpatch
This patch is to fix some coding style issues pointed by scripts/checkpatch.pl Signed-off-by: Bruno Carvalho --- drivers/staging/gdm724x/gdm_mux.c | 6 -- drivers/staging/gdm724x/gdm_mux.h | 12 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/staging/gdm724x/gdm_mux.c b/drivers/staging/gdm724x/gdm_mux.c index 6bedd66..5e661d9 100644 --- a/drivers/staging/gdm724x/gdm_mux.c +++ b/drivers/staging/gdm724x/gdm_mux.c @@ -278,8 +278,10 @@ static void gdm_mux_rcv_complete(struct urb *urb) } } -static int gdm_mux_recv(void *priv_dev, int (*cb)(void *data, int len, - int tty_index, struct tty_dev *tty_dev, int complete)) +static int gdm_mux_recv(void *priv_dev, + int (*cb)(void *data, int len, + int tty_index, + struct tty_dev *tty_dev, int complete)) { struct mux_dev *mux_dev = priv_dev; struct usb_device *usbdev = mux_dev->usbdev; diff --git a/drivers/staging/gdm724x/gdm_mux.h b/drivers/staging/gdm724x/gdm_mux.h index 3d50383..49bb90d 100644 --- a/drivers/staging/gdm724x/gdm_mux.h +++ b/drivers/staging/gdm724x/gdm_mux.h @@ -27,8 +27,8 @@ #define START_FLAG 0xA512485A #define MUX_HEADER_SIZE 14 -#define MUX_TX_MAX_SIZE (1024*10) -#define MUX_RX_MAX_SIZE (1024*30) +#define MUX_TX_MAX_SIZE (1024 * 10) +#define MUX_RX_MAX_SIZE (1024 * 30) #define AT_PKT_TYPE 0xF011 #define DM_PKT_TYPE 0xF010 @@ -70,9 +70,9 @@ struct rx_cxt { struct list_head to_host_list; struct list_head rx_submit_list; struct list_head rx_free_list; - spinlock_t to_host_lock; - spinlock_t submit_list_lock; - spinlock_t free_list_lock; + spinlock_t to_host_lock; /* spinlock for host handling */ + spinlock_t submit_list_lock; /* spinlock for submit list handling */ + spinlock_t free_list_lock; /* spinlock for free list handling */ }; struct mux_dev { @@ -88,7 +88,7 @@ struct mux_dev { int tty_index, struct tty_dev *tty_dev, int complete); - spinlock_t write_lock; + spinlock_t write_lock; /* spinlock for write handling */ struct tty_dev *tty_dev; }; -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 00/10] staging: lustre: lnet: per NI map-on-demand value
Enables support of different map-on-demand values per NI. This is required to support OPA coexistence with MLX5 cards. MLX5 does not support FMR, which is enabled via map-on-demand. However OPA's performance is greatly enahanced when FMR is enabled. In order to enable coexistence of both of these two types of cards we need to be able to set different map-on-demand values for both NIs. This patch also lays the ground work for other per NI tunables to be added in future patches. Amir Shehata (10): staging: lustre: lnet: use struct lnet_ioctl_config_data for NI bring up staging: lustre: lnet: use struct lnet_ioctl_config_data for NI query staging: lustre: lnet: add per NI configuration structures staging: lustre: o2iblnd: convert macros to inline functions staging: lustre: o2iblnd: create default o2iblnd tunable settings staging: lustre: o2iblnd: use data in lnet_ni_t instead of kiblnd_tunables staging: lustre: o2iblnd: per NI map-on-demand value staging: lustre: o2iblnd: remove last of kiblnd_tunables_fini staging: lustre: o2iblnd: properly set ibr_why staging: lustre: lnet: enable configuration per NI interface .../staging/lustre/include/linux/lnet/lib-dlc.h| 29 - .../staging/lustre/include/linux/lnet/lib-lnet.h |9 +- .../staging/lustre/include/linux/lnet/lib-types.h |2 + .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c| 83 +++- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h| 101 -- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c | 36 +++--- .../lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c | 139 ++-- drivers/staging/lustre/lnet/lnet/api-ni.c | 139 drivers/staging/lustre/lnet/lnet/config.c |3 + drivers/staging/lustre/lnet/lnet/module.c |7 +- 10 files changed, 341 insertions(+), 207 deletions(-) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/10] staging: lustre: lnet: use struct lnet_ioctl_config_data for NI query
From: Amir Shehata The functions used to query the NI state passes around the individual fields of struct lnet_ioctl_config_data. To simplify the code lets just pass struct lnet_ioctl_config directly. Signed-off-by: Amir Shehata Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7101 Reviewed-on: http://review.whamcloud.com/16367 Reviewed-by: Doug Oucharek Reviewed-by: Olaf Weber Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/include/linux/lnet/lib-lnet.h |4 - drivers/staging/lustre/lnet/lnet/api-ni.c | 60 ++-- 2 files changed, 18 insertions(+), 46 deletions(-) diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h index 1865c85..513a822 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h @@ -463,10 +463,6 @@ int lnet_del_route(__u32 net, lnet_nid_t gw_nid); void lnet_destroy_routes(void); int lnet_get_route(int idx, __u32 *net, __u32 *hops, lnet_nid_t *gateway, __u32 *alive, __u32 *priority); -int lnet_get_net_config(int idx, __u32 *cpt_count, __u64 *nid, - int *peer_timeout, int *peer_tx_credits, - int *peer_rtr_cr, int *max_tx_credits, - struct lnet_ioctl_net_config *net_config); int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg); void lnet_router_debugfs_init(void); diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 6340ad1..01e1808 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -1648,25 +1648,18 @@ EXPORT_SYMBOL(LNetNIFini); * parameters * * \param[in] ni network interface structure - * \param[out] cpt_count the number of cpts the ni is on - * \param[out] nid Network Interface ID - * \param[out] peer_timeoutNI peer timeout - * \param[out] peer_tx_crdits NI peer transmit credits - * \param[out] peer_rtr_credits NI peer router credits - * \param[out] max_tx_credits NI max transmit credit - * \param[out] net_config Network configuration + * \param[out] config NI configuration */ static void -lnet_fill_ni_info(struct lnet_ni *ni, __u32 *cpt_count, __u64 *nid, - int *peer_timeout, int *peer_tx_credits, - int *peer_rtr_credits, int *max_tx_credits, - struct lnet_ioctl_net_config *net_config) +lnet_fill_ni_info(struct lnet_ni *ni, struct lnet_ioctl_config_data *config) { + struct lnet_ioctl_net_config *net_config; int i; - if (!ni) + if (!ni || !config) return; + net_config = (struct lnet_ioctl_net_config *) config->cfg_bulk; if (!net_config) return; @@ -1682,11 +1675,11 @@ lnet_fill_ni_info(struct lnet_ni *ni, __u32 *cpt_count, __u64 *nid, sizeof(net_config->ni_interfaces[i])); } - *nid = ni->ni_nid; - *peer_timeout = ni->ni_peertimeout; - *peer_tx_credits = ni->ni_peertxcredits; - *peer_rtr_credits = ni->ni_peerrtrcredits; - *max_tx_credits = ni->ni_maxtxcredits; + config->cfg_nid = ni->ni_nid; + config->cfg_config_u.cfg_net.net_peer_timeout = ni->ni_peertimeout; + config->cfg_config_u.cfg_net.net_max_tx_credits = ni->ni_maxtxcredits; + config->cfg_config_u.cfg_net.net_peer_tx_credits = ni->ni_peertxcredits; + config->cfg_config_u.cfg_net.net_peer_rtr_credits = ni->ni_peerrtrcredits; net_config->ni_status = ni->ni_status->ns_status; @@ -1696,18 +1689,16 @@ lnet_fill_ni_info(struct lnet_ni *ni, __u32 *cpt_count, __u64 *nid, for (i = 0; i < num_cpts; i++) net_config->ni_cpts[i] = ni->ni_cpts[i]; - *cpt_count = num_cpts; + config->cfg_ncpts = num_cpts; } } -int -lnet_get_net_config(int idx, __u32 *cpt_count, __u64 *nid, int *peer_timeout, - int *peer_tx_credits, int *peer_rtr_credits, - int *max_tx_credits, - struct lnet_ioctl_net_config *net_config) +static int +lnet_get_net_config(struct lnet_ioctl_config_data *config) { struct lnet_ni *ni; struct list_head *tmp; + int idx = config->cfg_count; int cpt, i = 0; int rc = -ENOENT; @@ -1719,9 +1710,7 @@ lnet_get_net_config(int idx, __u32 *cpt_count, __u64 *nid, int *peer_timeout, ni = list_entry(tmp, lnet_ni_t, ni_list); lnet_ni_lock(ni); - lnet_fill_ni_info(ni, cpt_count, nid, peer_timeout, - peer_tx_credits, peer_rtr_credits, - max_tx_credits, net_config); + lnet_fill_ni_info(ni, config); lnet_ni_unlo
[PATCH 05/10] staging: lustre: o2iblnd: create default o2iblnd tunable settings
From: Amir Shehata Create and set the default o2iblnd tunables when the ko2iblnd module loads. Move kiblnd_tunables_setup() to when the NI iterface is initialized. Signed-off-by: Amir Shehata Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7101 Reviewed-on: http://review.whamcloud.com/16367 Reviewed-by: Doug Oucharek Reviewed-by: Olaf Weber Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c|9 - .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h|3 ++- .../lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c | 16 ++-- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c index a2e188e..a06689b 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c @@ -2921,6 +2921,9 @@ static int kiblnd_startup(lnet_ni_t *ni) net->ibn_incarnation = tv.tv_sec * USEC_PER_SEC + tv.tv_nsec / NSEC_PER_USEC; + rc = kiblnd_tunables_setup(); + if (rc) + goto net_failed; ni->ni_peertimeout= *kiblnd_tunables.kib_peertimeout; ni->ni_maxtxcredits = *kiblnd_tunables.kib_credits; ni->ni_peertxcredits = *kiblnd_tunables.kib_peertxcredits; @@ -3006,8 +3009,6 @@ static void __exit ko2iblnd_exit(void) static int __init ko2iblnd_init(void) { - int rc; - CLASSERT(sizeof(kib_msg_t) <= IBLND_MSG_SIZE); CLASSERT(offsetof(kib_msg_t, ibm_u.get.ibgm_rd.rd_frags[IBLND_MAX_RDMA_FRAGS]) @@ -3016,9 +3017,7 @@ static int __init ko2iblnd_init(void) ibm_u.putack.ibpam_rd.rd_frags[IBLND_MAX_RDMA_FRAGS]) <= IBLND_MSG_SIZE); - rc = kiblnd_tunables_init(); - if (rc) - return rc; + kiblnd_tunables_init(); lnet_register_lnd(&the_o2iblnd); diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h index fab0ef9..80e11bc 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h @@ -994,7 +994,8 @@ int kiblnd_fmr_pool_map(kib_fmr_poolset_t *fps, kib_tx_t *tx, kib_fmr_t *fmr); void kiblnd_fmr_pool_unmap(kib_fmr_t *fmr, int status); -int kiblnd_tunables_init(void); +int kiblnd_tunables_setup(void); +void kiblnd_tunables_init(void); void kiblnd_tunables_fini(void); int kiblnd_connd(void *arg); diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c index a6415fc..cc1469d 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c @@ -171,6 +171,8 @@ kib_tunables_t kiblnd_tunables = { .kib_nscheds = &nscheds }; +static struct lnet_ioctl_config_o2iblnd_tunables default_tunables; + /* # messages/RDMAs in-flight */ int kiblnd_msg_queue_size(int version, lnet_ni_t *ni) { @@ -182,8 +184,7 @@ int kiblnd_msg_queue_size(int version, lnet_ni_t *ni) return peer_credits; } -int -kiblnd_tunables_init(void) +int kiblnd_tunables_setup(void) { if (kiblnd_translate_mtu(*kiblnd_tunables.kib_ib_mtu) < 0) { CERROR("Invalid ib_mtu %d, expected 256/512/1024/2048/4096\n", @@ -234,3 +235,14 @@ kiblnd_tunables_init(void) return 0; } + +void kiblnd_tunables_init(void) +{ + default_tunables.lnd_version = 0; + default_tunables.lnd_peercredits_hiw = peer_credits_hiw, + default_tunables.lnd_map_on_demand = map_on_demand; + default_tunables.lnd_concurrent_sends = concurrent_sends; + default_tunables.lnd_fmr_pool_size = fmr_pool_size; + default_tunables.lnd_fmr_flush_trigger = fmr_flush_trigger; + default_tunables.lnd_fmr_cache = fmr_cache; +} -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/10] staging: lustre: o2iblnd: convert macros to inline functions
From: Amir Shehata Convert a few macros in o2iblnd.h to inline functions. Signed-off-by: Amir Shehata Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7101 Reviewed-on: http://review.whamcloud.com/16367 Reviewed-by: Doug Oucharek Reviewed-by: Olaf Weber Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c|2 +- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h| 62 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c | 21 --- .../lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c | 11 4 files changed, 61 insertions(+), 35 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c index ddc3313..a2e188e 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c @@ -335,7 +335,7 @@ int kiblnd_create_peer(lnet_ni_t *ni, kib_peer_t **peerp, lnet_nid_t nid) peer->ibp_nid = nid; peer->ibp_error = 0; peer->ibp_last_alive = 0; - peer->ibp_max_frags = IBLND_CFG_RDMA_FRAGS; + peer->ibp_max_frags = kiblnd_cfg_rdma_frags(peer->ibp_ni); peer->ibp_queue_depth = *kiblnd_tunables.kib_peertxcredits; atomic_set(&peer->ibp_refcount, 1); /* 1 ref for caller */ diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h index 52245e0..fab0ef9 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h @@ -116,9 +116,6 @@ extern kib_tunables_t kiblnd_tunables; #define IBLND_CREDITS_DEFAULT 8 /* default # of peer credits */ #define IBLND_CREDITS_MAX((typeof(((kib_msg_t *) 0)->ibm_credits)) - 1) /* Max # of peer credits */ -#define IBLND_MSG_QUEUE_SIZE(v)((v) == IBLND_MSG_VERSION_1 ? \ -IBLND_MSG_QUEUE_SIZE_V1 : \ -*kiblnd_tunables.kib_peertxcredits) /* # messages/RDMAs in-flight */ #define IBLND_CREDITS_HIGHWATER(v) ((v) == IBLND_MSG_VERSION_1 ? \ IBLND_CREDIT_HIGHWATER_V1 : \ *kiblnd_tunables.kib_peercredits_hiw) /* when eagerly to return credits */ @@ -127,32 +124,12 @@ extern kib_tunables_t kiblnd_tunables; cb, dev, \ ps, qpt) -static inline int -kiblnd_concurrent_sends_v1(void) -{ - if (*kiblnd_tunables.kib_concurrent_sends > IBLND_MSG_QUEUE_SIZE_V1 * 2) - return IBLND_MSG_QUEUE_SIZE_V1 * 2; - - if (*kiblnd_tunables.kib_concurrent_sends < IBLND_MSG_QUEUE_SIZE_V1 / 2) - return IBLND_MSG_QUEUE_SIZE_V1 / 2; - - return *kiblnd_tunables.kib_concurrent_sends; -} - -#define IBLND_CONCURRENT_SENDS(v) ((v) == IBLND_MSG_VERSION_1 ? \ -kiblnd_concurrent_sends_v1() : \ -*kiblnd_tunables.kib_concurrent_sends) /* 2 OOB shall suffice for 1 keepalive and 1 returning credits */ #define IBLND_OOB_CAPABLE(v) ((v) != IBLND_MSG_VERSION_1) #define IBLND_OOB_MSGS(v) (IBLND_OOB_CAPABLE(v) ? 2 : 0) #define IBLND_MSG_SIZE (4 << 10)/* max size of queued messages (inc hdr) */ #define IBLND_MAX_RDMA_FRAGSLNET_MAX_IOV /* max # of fragments supported */ -#define IBLND_CFG_RDMA_FRAGS (*kiblnd_tunables.kib_map_on_demand ? \ - *kiblnd_tunables.kib_map_on_demand : \ -IBLND_MAX_RDMA_FRAGS) /* max # of fragments configured by user */ -#define IBLND_RDMA_FRAGS(v)((v) == IBLND_MSG_VERSION_1 ? \ -IBLND_MAX_RDMA_FRAGS : IBLND_CFG_RDMA_FRAGS) // /* derived constants... */ @@ -171,7 +148,8 @@ kiblnd_concurrent_sends_v1(void) /* WRs and CQEs (per connection) */ #define IBLND_RECV_WRS(c) IBLND_RX_MSGS(c) #define IBLND_SEND_WRS(c) \ - ((c->ibc_max_frags + 1) * IBLND_CONCURRENT_SENDS(c->ibc_version)) + ((c->ibc_max_frags + 1) * kiblnd_concurrent_sends(c->ibc_version, \ + c->ibc_peer->ibp_ni)) #define IBLND_CQ_ENTRIES(c)(IBLND_RECV_WRS(c) + IBLND_SEND_WRS(c)) struct kib_hca_dev; @@ -634,6 +612,42 @@ extern kib_data_t kiblnd_data; void kiblnd_hdev_destroy(kib_hca_dev_t *hdev); +int kiblnd_msg_queue_size(int version, struct lnet_ni *ni); + +/* max # of fragments configured by user */ +static inline int +kiblnd_cfg_rdma_frags(struct lnet_ni *ni) +{ + int mod = *kiblnd_tunables.kib_map_on_demand; + return mod ? mod : IBLND_MAX_RDMA_FRAGS; +} + +static inline int +kiblnd_rdma_frags(int version, struct lnet_ni *ni) +{
[PATCH 08/10] staging: lustre: o2iblnd: remove last of kiblnd_tunables_fini
From: Amir Shehata The function kibnd_tunables_fini() no longer exist. Remove it from o2iblnd.h Signed-off-by: Amir Shehata Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7101 Reviewed-on: http://review.whamcloud.com/16367 Reviewed-by: Doug Oucharek Reviewed-by: Olaf Weber Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h|1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h index d458773..b22984f 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h @@ -995,7 +995,6 @@ void kiblnd_fmr_pool_unmap(kib_fmr_t *fmr, int status); int kiblnd_tunables_setup(struct lnet_ni *ni); void kiblnd_tunables_init(void); -void kiblnd_tunables_fini(void); int kiblnd_connd(void *arg); int kiblnd_scheduler(void *arg); -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/10] staging: lustre: o2iblnd: use data in lnet_ni_t instead of kiblnd_tunables
From: Amir Shehata Currently the ko2iblnd creates a kib_tunable_t stucture to allow the ko2iblnd driver to access the module parameters throught the code. Some of those data fields also exist in lnet_ni_t. Migrate to using the lnet_ni_t data fields instead of kib_tunable_t. Signed-off-by: Amir Shehata Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7101 Reviewed-on: http://review.whamcloud.com/16367 Reviewed-by: Doug Oucharek Reviewed-by: Olaf Weber Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c|8 +-- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h|6 +-- .../lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c | 54 +++ 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c index a06689b..84a15d4 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c @@ -336,7 +336,7 @@ int kiblnd_create_peer(lnet_ni_t *ni, kib_peer_t **peerp, lnet_nid_t nid) peer->ibp_error = 0; peer->ibp_last_alive = 0; peer->ibp_max_frags = kiblnd_cfg_rdma_frags(peer->ibp_ni); - peer->ibp_queue_depth = *kiblnd_tunables.kib_peertxcredits; + peer->ibp_queue_depth = ni->ni_peertxcredits; atomic_set(&peer->ibp_refcount, 1); /* 1 ref for caller */ INIT_LIST_HEAD(&peer->ibp_list); /* not in the peer table yet */ @@ -2921,13 +2921,9 @@ static int kiblnd_startup(lnet_ni_t *ni) net->ibn_incarnation = tv.tv_sec * USEC_PER_SEC + tv.tv_nsec / NSEC_PER_USEC; - rc = kiblnd_tunables_setup(); + rc = kiblnd_tunables_setup(ni); if (rc) goto net_failed; - ni->ni_peertimeout= *kiblnd_tunables.kib_peertimeout; - ni->ni_maxtxcredits = *kiblnd_tunables.kib_credits; - ni->ni_peertxcredits = *kiblnd_tunables.kib_peertxcredits; - ni->ni_peerrtrcredits = *kiblnd_tunables.kib_peerrtrcredits; if (ni->ni_interfaces[0]) { /* Use the IPoIB interface specified in 'networks=' */ diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h index 80e11bc..fffae0c 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h @@ -87,11 +87,7 @@ typedef struct { int *kib_timeout;/* comms timeout (seconds) */ int *kib_keepalive; /* keepalive timeout (seconds) */ int *kib_ntx;/* # tx descs */ - int *kib_credits;/* # concurrent sends */ - int *kib_peertxcredits; /* # concurrent sends to 1 peer */ - int *kib_peerrtrcredits; /* # per-peer router buffer credits */ int *kib_peercredits_hiw;/* # when eagerly to return credits */ - int *kib_peertimeout;/* seconds to consider peer dead */ char **kib_default_ipif; /* default IPoIB interface */ int *kib_retry_count; int *kib_rnr_retry_count; @@ -994,7 +990,7 @@ int kiblnd_fmr_pool_map(kib_fmr_poolset_t *fps, kib_tx_t *tx, kib_fmr_t *fmr); void kiblnd_fmr_pool_unmap(kib_fmr_t *fmr, int status); -int kiblnd_tunables_setup(void); +int kiblnd_tunables_setup(struct lnet_ni *ni); void kiblnd_tunables_init(void); void kiblnd_tunables_fini(void); diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c index cc1469d..e50a9cf 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c @@ -152,11 +152,7 @@ kib_tunables_t kiblnd_tunables = { .kib_timeout = &timeout, .kib_keepalive = &keepalive, .kib_ntx = &ntx, - .kib_credits = &credits, - .kib_peertxcredits = &peer_credits, .kib_peercredits_hiw = &peer_credits_hiw, - .kib_peerrtrcredits= &peer_buffer_credits, - .kib_peertimeout = &peer_timeout, .kib_default_ipif = &ipif_name, .kib_retry_count = &retry_count, .kib_rnr_retry_count = &rnr_retry_count, @@ -184,7 +180,7 @@ int kiblnd_msg_queue_size(int version, lnet_ni_t *ni) return peer_credits; } -int kiblnd_tunables_setup(void) +int kiblnd_tunables_setup(struct lnet_ni *ni) { if (kiblnd_translate_mtu(*kiblnd_tunables.kib_ib_mtu) < 0) { CERROR("Invalid ib_mtu %d, expected 256/512/1024/2048/4096\n", @@ -192,20 +188,32 @@ int kiblnd_tunables_setup(void) return -EINVAL; } - if (*kiblnd_tunables.kib_peertxcredits < IBLND_CREDITS_
[PATCH 07/10] staging: lustre: o2iblnd: per NI map-on-demand value
From: Amir Shehata Enables support of different map-on-demand values per NI. This is required to support OPA coexistence with MLX5 cards. MLX5 does not support FMR, which is enabled via map-on-demand. However OPA's performance is greatly enahanced when FMR is enabled. In order to enable coexistence of both of these two types of cards we need to be able to set different map-on-demand values for both NIs. This patch also lays the ground work for other per NI tunables to be added in future patches. Signed-off-by: Amir Shehata Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7101 Reviewed-on: http://review.whamcloud.com/16367 Reviewed-by: Doug Oucharek Reviewed-by: Olaf Weber Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c| 66 ++-- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h| 35 + .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c | 13 ++- .../lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c | 84 +-- 4 files changed, 125 insertions(+), 73 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c index 84a15d4..7711d96 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c @@ -1283,16 +1283,22 @@ static void kiblnd_map_tx_pool(kib_tx_pool_t *tpo) } } -struct ib_mr *kiblnd_find_rd_dma_mr(kib_hca_dev_t *hdev, kib_rdma_desc_t *rd, +struct ib_mr *kiblnd_find_rd_dma_mr(struct lnet_ni *ni, kib_rdma_desc_t *rd, int negotiated_nfrags) { - __u16 nfrags = (negotiated_nfrags != -1) ? - negotiated_nfrags : *kiblnd_tunables.kib_map_on_demand; + kib_net_t *net = ni->ni_data; + kib_hca_dev_t *hdev = net->ibn_dev->ibd_hdev; + struct lnet_ioctl_config_o2iblnd_tunables *tunables; + __u16 nfrags; + int mod; + + tunables = &ni->ni_lnd_tunables->lt_tun_u.lt_o2ib; + mod = tunables->lnd_map_on_demand; + nfrags = (negotiated_nfrags != -1) ? negotiated_nfrags : mod; LASSERT(hdev->ibh_mrs); - if (*kiblnd_tunables.kib_map_on_demand > 0 && - nfrags <= rd->rd_nfrags) + if (mod > 0 && nfrags <= rd->rd_nfrags) return NULL; return hdev->ibh_mrs; @@ -1337,16 +1343,20 @@ static void kiblnd_destroy_fmr_pool_list(struct list_head *head) } } -static int kiblnd_fmr_pool_size(int ncpts) +static int +kiblnd_fmr_pool_size(struct lnet_ioctl_config_o2iblnd_tunables *tunables, +int ncpts) { - int size = *kiblnd_tunables.kib_fmr_pool_size / ncpts; + int size = tunables->lnd_fmr_pool_size / ncpts; return max(IBLND_FMR_POOL, size); } -static int kiblnd_fmr_flush_trigger(int ncpts) +static int +kiblnd_fmr_flush_trigger(struct lnet_ioctl_config_o2iblnd_tunables *tunables, +int ncpts) { - int size = *kiblnd_tunables.kib_fmr_flush_trigger / ncpts; + int size = tunables->lnd_fmr_flush_trigger / ncpts; return max(IBLND_FMR_POOL_FLUSH, size); } @@ -1362,7 +1372,7 @@ static int kiblnd_alloc_fmr_pool(kib_fmr_poolset_t *fps, kib_fmr_pool_t *fpo) .dirty_watermark = fps->fps_flush_trigger, .flush_function= NULL, .flush_arg = NULL, - .cache = !!*kiblnd_tunables.kib_fmr_cache}; + .cache = !!fps->fps_cache }; int rc = 0; fpo->fmr.fpo_fmr_pool = ib_create_fmr_pool(fpo->fpo_hdev->ibh_pd, @@ -1508,9 +1518,10 @@ static void kiblnd_fini_fmr_poolset(kib_fmr_poolset_t *fps) } } -static int kiblnd_init_fmr_poolset(kib_fmr_poolset_t *fps, int cpt, - kib_net_t *net, int pool_size, - int flush_trigger) +static int +kiblnd_init_fmr_poolset(kib_fmr_poolset_t *fps, int cpt, int ncpts, + kib_net_t *net, + struct lnet_ioctl_config_o2iblnd_tunables *tunables) { kib_fmr_pool_t *fpo; int rc; @@ -1519,8 +1530,11 @@ static int kiblnd_init_fmr_poolset(kib_fmr_poolset_t *fps, int cpt, fps->fps_net = net; fps->fps_cpt = cpt; - fps->fps_pool_size = pool_size; - fps->fps_flush_trigger = flush_trigger; + + fps->fps_pool_size = kiblnd_fmr_pool_size(tunables, ncpts); + fps->fps_flush_trigger = kiblnd_fmr_flush_trigger(tunables, ncpts); + fps->fps_cache = tunables->lnd_fmr_cache; + spin_lock_init(&fps->fps_lock); INIT_LIST_HEAD(&fps->fps_pool_list); INIT_LIST_HEAD(&fps->fps_failed_pool_list); @@ -2151,25 +2165,28 @@ static void kiblnd_net_fini_pools(kib_net_t *net) } } -static int kiblnd_net_init_pools(kib_net_t *net, __u32 *cpts, int ncpts) +static int kiblnd_net_in
[PATCH 10/10] staging: lustre: lnet: enable configuration per NI interface
From: Amir Shehata Add the ability to configure each NI interface at bring up. Also give the ability for user land utilities to query the configuration of each NI interface. Signed-off-by: Amir Shehata Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7101 Reviewed-on: http://review.whamcloud.com/16367 Reviewed-by: Doug Oucharek Reviewed-by: Olaf Weber Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lnet/lnet/api-ni.c | 42 + 1 files changed, 42 insertions(+), 0 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 01e1808..fe0dbe7 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -1217,6 +1217,7 @@ lnet_shutdown_lndni(struct lnet_ni *ni) static int lnet_startup_lndni(struct lnet_ni *ni, struct lnet_ioctl_config_data *conf) { + struct lnet_ioctl_config_lnd_tunables *lnd_tunables = NULL; int rc = -EINVAL; int lnd_type; lnd_t *lnd; @@ -1274,6 +1275,21 @@ lnet_startup_lndni(struct lnet_ni *ni, struct lnet_ioctl_config_data *conf) ni->ni_lnd = lnd; + if (conf && conf->cfg_hdr.ioc_len > sizeof(*conf)) + lnd_tunables = (struct lnet_ioctl_config_lnd_tunables *)conf->cfg_bulk; + + if (lnd_tunables) { + LIBCFS_ALLOC(ni->ni_lnd_tunables, +sizeof(*ni->ni_lnd_tunables)); + if (!ni->ni_lnd_tunables) { + mutex_unlock(&the_lnet.ln_lnd_mutex); + rc = -ENOMEM; + goto failed0; + } + memcpy(ni->ni_lnd_tunables, lnd_tunables, + sizeof(*ni->ni_lnd_tunables)); + } + rc = lnd->lnd_startup(ni); mutex_unlock(&the_lnet.ln_lnd_mutex); @@ -1653,7 +1669,9 @@ EXPORT_SYMBOL(LNetNIFini); static void lnet_fill_ni_info(struct lnet_ni *ni, struct lnet_ioctl_config_data *config) { + struct lnet_ioctl_config_lnd_tunables *lnd_cfg = NULL; struct lnet_ioctl_net_config *net_config; + size_t min_size, tunable_size = 0; int i; if (!ni || !config) @@ -1691,6 +1709,30 @@ lnet_fill_ni_info(struct lnet_ni *ni, struct lnet_ioctl_config_data *config) config->cfg_ncpts = num_cpts; } + + /* +* See if user land tools sent in a newer and larger version +* of struct lnet_tunables than what the kernel uses. +*/ + min_size = sizeof(*config) + sizeof(*net_config); + + if (config->cfg_hdr.ioc_len > min_size) + tunable_size = config->cfg_hdr.ioc_len - min_size; + + /* Don't copy to much data to user space */ + min_size = min(tunable_size, sizeof(*ni->ni_lnd_tunables)); + lnd_cfg = (struct lnet_ioctl_config_lnd_tunables *)net_config->cfg_bulk; + + if (ni->ni_lnd_tunables && lnd_cfg && min_size) { + memcpy(lnd_cfg, ni->ni_lnd_tunables, min_size); + config->cfg_config_u.cfg_net.net_interface_count = 1; + + /* Tell user land that kernel side has less data */ + if (tunable_size > sizeof(*ni->ni_lnd_tunables)) { + min_size = tunable_size - sizeof(ni->ni_lnd_tunables); + config->cfg_hdr.ioc_len -= min_size; + } + } } static int -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/10] staging: lustre: lnet: use struct lnet_ioctl_config_data for NI bring up
From: Amir Shehata The LNet layer passes around the individual fields of struct lnet_ioctl_config_data for the case of NI bring up. To simplify the code lets just pass struct lnet_ioctl_config directly. Signed-off-by: Amir Shehata Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7101 Reviewed-on: http://review.whamcloud.com/16367 Reviewed-by: Doug Oucharek Reviewed-by: Olaf Weber Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/include/linux/lnet/lib-lnet.h |5 +-- drivers/staging/lustre/lnet/lnet/api-ni.c | 37 +++ drivers/staging/lustre/lnet/lnet/module.c |7 +--- 3 files changed, 24 insertions(+), 25 deletions(-) diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h index dfc0208..1865c85 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h @@ -478,9 +478,8 @@ int lnet_rtrpools_enable(void); void lnet_rtrpools_disable(void); void lnet_rtrpools_free(int keep_pools); lnet_remotenet_t *lnet_find_net_locked(__u32 net); -int lnet_dyn_add_ni(lnet_pid_t requested_pid, char *nets, - __s32 peer_timeout, __s32 peer_cr, __s32 peer_buf_cr, - __s32 credits); +int lnet_dyn_add_ni(lnet_pid_t requested_pid, + struct lnet_ioctl_config_data *conf); int lnet_dyn_del_ni(__u32 net); int lnet_clear_lazy_portal(struct lnet_ni *ni, int portal, char *reason); diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index f825784..6340ad1 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -1215,8 +1215,7 @@ lnet_shutdown_lndni(struct lnet_ni *ni) } static int -lnet_startup_lndni(struct lnet_ni *ni, __s32 peer_timeout, - __s32 peer_cr, __s32 peer_buf_cr, __s32 credits) +lnet_startup_lndni(struct lnet_ni *ni, struct lnet_ioctl_config_data *conf) { int rc = -EINVAL; int lnd_type; @@ -1292,20 +1291,28 @@ lnet_startup_lndni(struct lnet_ni *ni, __s32 peer_timeout, * If given some LND tunable parameters, parse those now to * override the values in the NI structure. */ - if (peer_buf_cr >= 0) - ni->ni_peerrtrcredits = peer_buf_cr; - if (peer_timeout >= 0) - ni->ni_peertimeout = peer_timeout; + if (conf && conf->cfg_config_u.cfg_net.net_peer_rtr_credits >= 0) { + ni->ni_peerrtrcredits = + conf->cfg_config_u.cfg_net.net_peer_rtr_credits; + } + if (conf && conf->cfg_config_u.cfg_net.net_peer_timeout >= 0) { + ni->ni_peertimeout = + conf->cfg_config_u.cfg_net.net_peer_timeout; + } /* * TODO * Note: For now, don't allow the user to change * peertxcredits as this number is used in the * IB LND to control queue depth. -* if (peer_cr != -1) -* ni->ni_peertxcredits = peer_cr; +* +* if (conf && conf->cfg_config_u.cfg_net.net_peer_tx_credits != -1) +* ni->ni_peertxcredits = +* conf->cfg_config_u.cfg_net.net_peer_tx_credits; */ - if (credits >= 0) - ni->ni_maxtxcredits = credits; + if (conf && conf->cfg_config_u.cfg_net.net_max_tx_credits >= 0) { + ni->ni_maxtxcredits = + conf->cfg_config_u.cfg_net.net_max_tx_credits; + } LASSERT(ni->ni_peertimeout <= 0 || lnd->lnd_query); @@ -1367,7 +1374,7 @@ lnet_startup_lndnis(struct list_head *nilist) while (!list_empty(nilist)) { ni = list_entry(nilist->next, lnet_ni_t, ni_list); list_del(&ni->ni_list); - rc = lnet_startup_lndni(ni, -1, -1, -1, -1); + rc = lnet_startup_lndni(ni, NULL); if (rc < 0) goto failed; @@ -1725,10 +1732,9 @@ lnet_get_net_config(int idx, __u32 *cpt_count, __u64 *nid, int *peer_timeout, } int -lnet_dyn_add_ni(lnet_pid_t requested_pid, char *nets, - __s32 peer_timeout, __s32 peer_cr, __s32 peer_buf_cr, - __s32 credits) +lnet_dyn_add_ni(lnet_pid_t requested_pid, struct lnet_ioctl_config_data *conf) { + char *nets = conf->cfg_config_u.cfg_net.net_intf; lnet_ping_info_t *pinfo; lnet_handle_md_t md_handle; struct lnet_ni *ni; @@ -1773,8 +1779,7 @@ lnet_dyn_add_ni(lnet_pid_t requested_pid, char *nets, list_del_init(&ni->ni_list); - rc = lnet_startup_lndni(ni, peer_timeout, peer_cr, - peer_buf_cr, credits); + rc = lnet_startup_lndni(ni, conf); if (rc) goto failed1; diff --git a/drivers/staging/lustre/lnet/lnet/module.c b/drivers/staging/
[PATCH 09/10] staging: lustre: o2iblnd: properly set ibr_why
From: Amir Shehata For the case of when the connections supported fragment count is smaller than what is supported locally only set ibr_why to IBLND_REJECT_RDMA_FRAGS if the ko2iblnd protocol verison is IBLND_MSG_VERSION. Signed-off-by: Amir Shehata Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7101 Reviewed-on: http://review.whamcloud.com/16367 Reviewed-by: Doug Oucharek Reviewed-by: Olaf Weber Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c index c4daf95..0f7e3a1 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c @@ -2368,7 +2368,7 @@ kiblnd_passive_connect(struct rdma_cm_id *cmid, void *priv, int priv_nob) reqmsg->ibm_u.connparams.ibcp_max_frags, kiblnd_rdma_frags(version, ni)); - if (version >= IBLND_MSG_VERSION) + if (version == IBLND_MSG_VERSION) rej.ibr_why = IBLND_REJECT_RDMA_FRAGS; goto failed; -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/10] staging: lustre: lnet: add per NI configuration structures
From: Amir Shehata Currently for LNet all hardware configuration is done with the modprobe configuration file. These settings are applied to all hardware instances for a node. That makes it impossible to configure two different pieces of infiniband hardware that require very different settings to function. Here we introduce the infrastructre to allow applying per interface settings. Signed-off-by: Amir Shehata Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7101 Reviewed-on: http://review.whamcloud.com/16367 Reviewed-by: Doug Oucharek Reviewed-by: Olaf Weber Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/include/linux/lnet/lib-dlc.h| 29 +++- .../staging/lustre/include/linux/lnet/lib-types.h |2 + drivers/staging/lustre/lnet/lnet/config.c |3 ++ 3 files changed, 33 insertions(+), 1 deletions(-) diff --git a/drivers/staging/lustre/include/linux/lnet/lib-dlc.h b/drivers/staging/lustre/include/linux/lnet/lib-dlc.h index 84a19e9..6ce9acc 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-dlc.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-dlc.h @@ -37,10 +37,37 @@ #define LNET_MAX_SHOW_NUM_CPT 128 #define LNET_UNDEFINED_HOPS((__u32) -1) +struct lnet_ioctl_config_lnd_cmn_tunables { + __u32 lct_version; + __u32 lct_peer_timeout; + __u32 lct_peer_tx_credits; + __u32 lct_peer_rtr_credits; + __u32 lct_max_tx_credits; +}; + +struct lnet_ioctl_config_o2iblnd_tunables { + __u32 lnd_version; + __u32 lnd_peercredits_hiw; + __u32 lnd_map_on_demand; + __u32 lnd_concurrent_sends; + __u32 lnd_fmr_pool_size; + __u32 lnd_fmr_flush_trigger; + __u32 lnd_fmr_cache; + __u32 pad; +}; + +struct lnet_ioctl_config_lnd_tunables { + struct lnet_ioctl_config_lnd_cmn_tunables lt_cmn; + union { + struct lnet_ioctl_config_o2iblnd_tunables lt_o2ib; + } lt_tun_u; +}; + struct lnet_ioctl_net_config { char ni_interfaces[LNET_MAX_INTERFACES][LNET_MAX_STR_LEN]; __u32 ni_status; __u32 ni_cpts[LNET_MAX_SHOW_NUM_CPT]; + char cfg_bulk[0]; }; #define LNET_TINY_BUF_IDX 0 @@ -81,7 +108,7 @@ struct lnet_ioctl_config_data { __s32 net_peer_rtr_credits; __s32 net_max_tx_credits; __u32 net_cksum_algo; - __u32 net_pad; + __u32 net_interface_count; } cfg_net; struct { __u32 buf_enable; diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h index 29c72f8..24c4a08 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-types.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h @@ -273,6 +273,8 @@ typedef struct lnet_ni { int **ni_refs; /* percpt reference count */ time64_t ni_last_alive;/* when I was last alive */ lnet_ni_status_t *ni_status;/* my health status */ + /* per NI LND tunables */ + struct lnet_ioctl_config_lnd_tunables *ni_lnd_tunables; /* equivalent interfaces to use */ char *ni_interfaces[LNET_MAX_INTERFACES]; } lnet_ni_t; diff --git a/drivers/staging/lustre/lnet/lnet/config.c b/drivers/staging/lustre/lnet/lnet/config.c index 449069c..480cc9c 100644 --- a/drivers/staging/lustre/lnet/lnet/config.c +++ b/drivers/staging/lustre/lnet/lnet/config.c @@ -107,6 +107,9 @@ lnet_ni_free(struct lnet_ni *ni) if (ni->ni_cpts) cfs_expr_list_values_free(ni->ni_cpts, ni->ni_ncpts); + if (ni->ni_lnd_tunables) + LIBCFS_FREE(ni->ni_lnd_tunables, sizeof(*ni->ni_lnd_tunables)); + for (i = 0; i < LNET_MAX_INTERFACES && ni->ni_interfaces[i]; i++) { LIBCFS_FREE(ni->ni_interfaces[i], strlen(ni->ni_interfaces[i]) + 1); -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: gdm724x: fixing coding style problems listed by checkpatch
On Fri, May 06, 2016 at 06:46:32PM -0400, Bruno Carvalho wrote: > This patch is to fix some coding style issues pointed > by scripts/checkpatch.pl Which ones specifically? Please be descriptive, as other commits are for this driver, take a look at them for examples. And remember, only do one "type" of change per patch, don't mix us a bunch of different types of coding style cleanups in the same patch. Please fix this up and resend. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel