LU-13005 lnet: remove lib-eq. There is nothing of value in left in lib-eq. An 'lnet_eq' just holds a function pointer. So change all 'struct lnet_eq' pointers to function pointers, and bypass the "event queues". Signed-off-by: Mr NeilBrown <neilb@suse.de> Change-Id: I16786e44ab712a76860fe8d83543a292555cf557 Reviewed-on: https://review.whamcloud.com/36847 Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Chris Horn <chris.horn@hpe.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-13005 lnet: drop refcounting from event queues. The refcount is no longer incremented or decremented as there is no interesting state and no long term references. Nothing checks if LNetEQFree returns -EBUSY any more - though a few calls LASSERT() that the return value is 0. So discard the refcounting, change LNetEQFree to return 'void', and remove all the LASSERTs. Change-Id: I976834e7c6193765948e3b1a4f02069e33cdbe1e Signed-off-by: Mr NeilBrown <neilb@suse.de> Reviewed-on: https://review.whamcloud.com/36846 Reviewed-by: Chris Horn <chris.horn@hpe.com> Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com> Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Amir Shehata <ashehata@whamcloud.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-13005 lnet: remove the 'queue' from LNetEQ All calls to LNetEQAlloc pass a size of 0, so no queue is ever allocated. So remove the 'size' arg, and all code that depends on it being non-zero. Similarly remove eq_size, eq_deq_seq eq_enq_seq and eq_events as they are always 0/NULL. Signed-off-by: Mr NeilBrown <neilb@suse.de> Change-Id: Icb7bb352fa61cd6ea46847676e583e738eeeda8c Reviewed-on: https://review.whamcloud.com/36844 Tested-by: jenkins <devops@whamcloud.com> Reviewed-by: Chris Horn <chris.horn@hpe.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-13005 lnet: remove LNetEQPoll There are no longer any users for LNetEQPoll, so remove it and any mention of it. Also remove the ln_eq_waitq which is no longer used. Signed-off-by: Mr NeilBrown <neilb@suse.de> Change-Id: If0c1a2634e879c62925314a55b4c2ae0512d1837 Reviewed-on: https://review.whamcloud.com/36843 Reviewed-by: Chris Horn <chris.horn@hpe.com> Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com> Reviewed-by: Amir Shehata <ashehata@whamcloud.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-13005 lnet: eq: discard struct lnet_handle_eq The Portals API uses a cookie 'handle' to identify an EQ. This is appropriate for a user-space API for objects maintained by the kernel, but it brings no value when the API client and implementation are both in the kernel, as is the case with Lustre and LNet. Instead of using a 'handle', a pointer to the 'struct lnet_eq` can be used. This object is not reference counted and is always freed correctly, so there can be no case where the cookie becomes invalid while it is still held. So use 'struct lnet_eq *' directly instead of having indirection through a 'struct lnet_handle_eq'. Also: - have LNetEQAttach() return the pointer, using ERR_PTR() to return errors. - discard ln_eq_containers and don't store the me there-in. This means we don't free any eq that have not already been freed, but all eq that are allocated are properly freed, so that is not a problem. Signed-off-by: Mr NeilBrown <neilb@suse.de> Change-Id: I0d6e5b654e39e749b39d46f68d0fb3e47a3256e9 Reviewed-on: https://review.whamcloud.com/36841 Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Chris Horn <chris.horn@hpe.com> Reviewed-by: Amir Shehata <ashehata@whamcloud.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-13005 lnet: discard LNetEQGet and LNetEQWait These interfaces are never used and are not particularly useful, so discard them. Test-Parameters: trivial testlist=sanity-lnet Signed-off-by: Mr NeilBrown <neilb@suse.de> Change-Id: Iaf2bc9ec2638820c3e4334e40cf2cf6993237f7d Reviewed-on: https://review.whamcloud.com/36840 Tested-by: jenkins <devops@whamcloud.com> Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-9679 all: prefer sizeof(*var) for ALLOC/FREE The construct LIBCFS_ALLOC(var, sizeof(*var)); is more obviously correct than LIBCFS_ALLOC(var, sizeof(struct something)); and is preferred upstream (where it is actually kzalloc or similar of course). When it is that simple, and there is no multiplier for the size, CFS_ALLOC_PTR(var); is even better. The same logic applies to OBD_ALLOC(), LIBCFS_FREE(), and OBD_FREE(). So convert allocations and frees that use sizeof(struct..) to use one of the simpler constructs. In mgs_write_log_mdt0, uuid is better declared as a "struct obd_uuid *" which is a struct that contain a 'char' array. Test-Parameters: trivial Signed-off-by: Mr NeilBrown <neilb@suse.de> Change-Id: I8cd97c75241bbb87d15cc6b7c9ac2a7d6184d700 Reviewed-on: https://review.whamcloud.com/36661 Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-12080 lnet: clean mt_eqh properly There is a scenario where you have a peer on your recovery queue that's down. So you keep pinging it, but every ping times out after 10 seconds. In the middle of these 10 seconds you perform a shutdown. First you try to do the rsp_tracker_clean. It goes through and calls MDUnlink on the MD related to that ping. But because the message has a ref count on the MD, it doesn't go away. The MD gets zombied. And just waits for lnet_md_unlink to be called in lnet_finalize(). Then you hit clean_peer_ni_recovery. We see the peer on the queue, we try to call Unlink on it, but when we lookup the MD using lnet_handle2md() we can't find it. Afterwards we try to clean up the EQ and it asserts. Even if we remove the assert we end up with a resource leak since the EQ is not actually freed since we won't call LNetEQFree() again. The solution is to pull the EQ create in the LNetNIInit() and deletion happens in lnet_unprepare. By this point all the remaining messages would've been finalized and all references on the EQ are gone, allowing us to clean it up properly Test-Parameters: forbuildonly Signed-off-by: Amir Shehata <ashehata@whamcloud.com> Change-Id: I7fd6018ee2e57f82c649fc3658352e89a4309986 Reviewed-on: https://review.whamcloud.com/34477 Reviewed-by: Olaf Weber <olaf.weber@hpe.com> Reviewed-by: Chris Horn <hornc@cray.com> Tested-by: Jenkins
LU-10560 libcfs: handle rename to wait_queue_entry_t The 4.13 kernel renames wait_queue_t to wait_queue_entry_t. Add a probe and handle rename across the code base and have a define to translate to the new name when indicated. Test-Parameters: trivial Change-Id: I8f0f5ec4d02ccb270acb72ccffe13f0ecf6bd2f7 Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Reviewed-on: https://review.whamcloud.com/31153 Tested-by: Jenkins Tested-by: Maloo <hpdd-maloo@intel.com> Reviewed-by: James Simmons <uja.ornl@yahoo.com> Reviewed-by: Ben Evans <bevans@cray.com> Reviewed-by: Bob Glossman <bob.glossman@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-6142 lnet: remove most of typedefs from LNet headers Remove the majority of typedefs from the LNet headers. Change them into structures instead. Currently only lnet_nid_t, lnet_pid_t, and lnet_kiov_t are left. Test-Parameters: trivial Change-Id: Ib083d305ab945bab8d78ac96d17015550c0f9486 Signed-off-by: James Simmons <uja.ornl@yahoo.com> Reviewed-on: https://review.whamcloud.com/20831 Reviewed-by: Olaf Weber <olaf@sgi.com> Tested-by: Jenkins Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Tested-by: Maloo <hpdd-maloo@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-9019 lnet: simplify lnet_eq_wait_locked We can simplify the code by taking advantage of the behavior of schedule_timeout_interruptible(). Instead of testing if tms is less than zero we can pass in a signed long that schedule_timeout_interruptible is expecting and for the case of no timeout we can pass in MAX_SCHEDULE_TIMEOUT. Change-Id: I15126aab500e975ec34ee270d3a1f9b83cf50902 Signed-off-by: James Simmons <uja.ornl@yahoo.com> Reviewed-on: https://review.whamcloud.com/23147 Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Tested-by: Jenkins Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Tested-by: Maloo <hpdd-maloo@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-8901 misc: update Intel copyright messages for 2016 Update copyright messages for files updated in 2016, excluding trivial patches. Add trivial patches to updatecw.sh script exclude list. Improve the output of patches causing the most changes to include the patch summary instead of just the hash. Test-Parameters: trivial Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Change-Id: Ifb098e8126f698ea975e10ba13f5f47c449ae4ad Reviewed-on: https://review.whamcloud.com/24233 Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Tested-by: Oleg Drokin <oleg.drokin@intel.com>
LU-8648 all: remove all Sun license and URL references The link to the GPL license at Sun is no longer there. Also Sun Inc is gone so lets remove all references to it in our source code. Test-Parameters: trivial Change-Id: Ib47d07dcef49a1ef624d0d8a4a91b9731f486278 Signed-off-by: James Simmons <uja.ornl@yahoo.com> Reviewed-on: http://review.whamcloud.com/22800 Tested-by: Jenkins Tested-by: Maloo <hpdd-maloo@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Frank Zago <fzago@cray.com>
LU-6142 lnet: replace white spaces with tabs for LNet core This work converts all the remaining white spaces left in the LNet layer to the proper tab format. Fixed all space prohibited warnings reported by checkpatch. Any other space issues reported by checkpatch are also addressed for the code that was retabbed. Test-Parameters: trivial Change-Id: I12589439c9532d1d3989deee00aa68c29f84db85 Signed-off-by: James Simmons <uja.ornl@yahoo.com> Reviewed-on: http://review.whamcloud.com/19975 Tested-by: Jenkins Tested-by: Maloo <hpdd-maloo@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: Frank Zago <fzago@cray.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-7766 lnet: Don't call roundup_pow_of_two on zero in LNetEQAlloc roundup_pow_of_two return when called on a zero argument is undefined, so don't call it like that. This fixes a problem introduced by commit http://review.whamcloud.com/16914 since 0 is a valid count parameter for LNetEQAlloc. Also manifesting itself as an annoying kernel warning: LNet: 3486:0:(lib-eq.c:85:LNetEQAlloc()) EQ callback is guaranteed to get every event, do you still want to set eqcount 1 for polling event which will have locking overhead? Please contact with developer to confirm Change-Id: I9874d50807fff7bb3a039aa9c2eb4f9ca8565242 Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Reviewed-on: http://review.whamcloud.com/18370 Tested-by: Jenkins Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: James Simmons <uja.ornl@yahoo.com> Tested-by: Maloo <hpdd-maloo@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: Bob Glossman <bob.glossman@intel.com>
LU-6245 libcfs: remove userland headers from libcfs.h Currently libcfs.h is used as a master header that contains all the needed headers. Since Lustre user land utilities and applications no longer have a strong dependency on libcfs.h we can remove all the added user land headers contained in libcfs.h. Signed-off-by: James Simmons <uja.ornl@yahoo.com> Change-Id: I6403d109875a1d42d8490a3a1c7635f2dac9fc90 Reviewed-on: http://review.whamcloud.com/16914 Tested-by: Jenkins Tested-by: Maloo <hpdd-maloo@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-6142 lnet: return proper error code It is consider bad style in the linux kernel to return -1 or a positive number for an error. Instead return the appropriate error codes. Change-Id: Icd9729de84f162b07df17caab48e7693459a03e8 Signed-off-by: James Simmons <uja.ornl@yahoo.com> Reviewed-on: http://review.whamcloud.com/17626 Tested-by: Jenkins Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Tested-by: Maloo <hpdd-maloo@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-6245 libcfs: remove prim wrappers for libcfs The libcfs layer contains wrappers to handle primitive management for both kernel space and user land. Since libcfs is no longer built for user land we can remove the wrappers. For linux-prim.h we kept only what is needed to deal with different kernel versions. Also we separated out libcfs_string.h to util/string.h so we can remove the wrappers no longer needed. Signed-off-by: James Simmons <uja.ornl@gmail.com> Change-Id: I0bad836f20ef29bf2ed17f1f4e5e1234d193868e Reviewed-on: http://review.whamcloud.com/13874 Tested-by: Jenkins Tested-by: Maloo <hpdd-maloo@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2675 lnet: assume a kernel build In lnet/lnet/ and lnet/selftest/ assume a kernel build (assume that __KERNEL__ is defined). Remove some common code only needed for user space LNet. Signed-off-by: John L. Hammond <john.hammond@intel.com> Change-Id: I79d6f50bac895116628c93c35e23f64dd102780f Reviewed-on: http://review.whamcloud.com/13121 Tested-by: Jenkins Reviewed-by: James Simmons <uja.ornl@gmail.com> Reviewed-by: Amir Shehata <amir.shehata@intel.com> Tested-by: Maloo <hpdd-maloo@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5396 lnet: make some functions static Some functions and variables are only used in their C file, so reduce their scope. This reduces the code size, and fixes sparse warnings such as: warning: symbol 'proc_lnet_routes' was not declared. Should it be static? warning: symbol 'proc_lnet_routers' was not declared. Should it be static? Some prototypes were removed from C files and added to the proper header. Change-Id: I6b0c527d64ea9e3394cc686699d2e75eec5c16a2 Signed-off-by: Frank Zago <fzago@cray.com> Reviewed-on: http://review.whamcloud.com/12206 Tested-by: Jenkins Reviewed-by: James Simmons <uja.ornl@gmail.com> Tested-by: Maloo <hpdd-maloo@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>