Netdev List
 help / color / mirror / Atom feed
* Re: [patch iproute2 4/6] bridge/link: add new offload hwmode swdev
From: Stephen Hemminger @ 2014-12-24 20:37 UTC (permalink / raw)
  To: Jiri Pirko
  Cc: netdev, davem, nhorman, andy, tgraf, dborkman, ogerlitz, jesse,
	pshelar, azhou, ben, jeffrey.t.kirsher, vyasevic, xiyou.wangcong,
	john.r.fastabend, edumazet, jhs, sfeldma, f.fainelli, roopa,
	linville, jasowang, ebiederm, nicolas.dichtel, ryazanov.s.a,
	buytenh, aviadr, nbd, alexei.starovoitov, Neil.Jerram, ronye,
	simon.horman, alexander.h.duyck, john.ronciak, mleitner, shrijeet,
	gospo, bcrl, hemal
In-Reply-To: <1417683438-10935-5-git-send-email-jiri@resnulli.us>

On Thu,  4 Dec 2014 09:57:16 +0100
Jiri Pirko <jiri@resnulli.us> wrote:

> From: Scott Feldman <sfeldma@gmail.com>
> 
> To support full-featured switch devices offloading bridge funtionality,
> add new hwmode 'swdev'.  Like 'vepa' and 'veb', 'swdev' indicated bridge
> port functionality is being offloaded to hardware.
> 
> Signed-off-by: Scott Feldman <sfeldma@gmail.com>
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>

Please resubmit when the functionality is in net-next.

^ permalink raw reply

* Re: [PATCH iproute2 2/4] ip: Allow to easy change network namespace
From: Stephen Hemminger @ 2014-12-24 20:35 UTC (permalink / raw)
  To: Vadim Kochan; +Cc: netdev
In-Reply-To: <1418493334-23142-3-git-send-email-vadim4j@gmail.com>

On Sat, 13 Dec 2014 19:55:32 +0200
Vadim Kochan <vadim4j@gmail.com> wrote:

> From: Vadim Kochan <vadim4j@gmail.com>
> 
> Added new '-netns' option to simplify executing following cmd:
> 
>     ip netns exec NETNS ip OPTIONS COMMAND OBJECT
> 
>     to
> 
>     ip -n[etns] NETNS OPTIONS COMMAND OBJECT
> 
> e.g.:
> 
>     ip -net vnet0 link add br0 type bridge
>     ip -n vnet0 link
> 
> Signed-off-by: Vadim Kochan <vadim4j@gmail.com>

Needs to be rebased against current upstream code.
Will not apply clean any more.

Please resubmit whole patch series.

^ permalink raw reply

* Re: [PATCH v3 iproute2] bridge link: add option 'self'
From: Stephen Hemminger @ 2014-12-24 20:30 UTC (permalink / raw)
  To: Scott Feldman
  Cc: Roopa Prabhu, Jiří Pírko, Jamal Hadi Salim,
	Benjamin LaHaise, Thomas Graf, john fastabend, John Linville,
	vyasevic@redhat.com, Netdev, David S. Miller,
	shm@cumulusnetworks.com, Andy Gospodarek
In-Reply-To: <CAE4R7bCDTmR_zaVredZNzviaXc1YzXtSAK3dYj+BekiW9OKSpQ@mail.gmail.com>

On Sat, 6 Dec 2014 09:12:51 -0800
Scott Feldman <sfeldma@gmail.com> wrote:

> Signed-of-by: Scott Feldman <sfeldma@gmail.com>
> 
> On Sat, Dec 6, 2014 at 12:21 AM,  <roopa@cumulusnetworks.com> wrote:
> > From: Roopa Prabhu <roopa@cumulusnetworks.com>
> >
> > Currently self is set internally only if hwmode is set.
> > This makes it necessary for the hw to have a mode.
> > There is no hwmode really required to go to hardware. So, introduce
> > self for anybody who wants to target hardware.
> >
> > v1 -> v2
> >     - fix a few bugs. Initialize flags to zero: this was required to
> >     keep the current behaviour unchanged.
> >
> > v2 -> v3
> >     - fix comment
> >
> > Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>

Applied to post 3.18 current tree.

^ permalink raw reply

* Re: [PATCH iproute2] ip link: use addattr_nest()/addattr_nest_end()
From: Stephen Hemminger @ 2014-12-24 20:27 UTC (permalink / raw)
  To: Duan Jiong; +Cc: netdev
In-Reply-To: <549130AD.6090407@cn.fujitsu.com>

On Wed, 17 Dec 2014 15:28:45 +0800
Duan Jiong <duanj.fnst@cn.fujitsu.com> wrote:

> 
> Use addattr_nest() and addattr_nest_end() to simplify the code.
> 
> Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>

Applied to latest (which is after 3.18.0)

^ permalink raw reply

* Re: [PATCH] openvswitch: fix odd_ptr_err.cocci warnings
From: David Miller @ 2014-12-24 20:18 UTC (permalink / raw)
  To: pshelar; +Cc: fengguang.wu, kbuild-all, dev, netdev, linux-kernel
In-Reply-To: <CALnjE+qNmBekeS_vbSx23myvocShRE1mZ6nHew3Hr=dQt=rHSw@mail.gmail.com>

From: Pravin Shelar <pshelar@nicira.com>
Date: Wed, 24 Dec 2014 10:49:22 -0800

> On Tue, Dec 23, 2014 at 10:41 PM, kbuild test robot
> <fengguang.wu@intel.com> wrote:
>> net/openvswitch/vport-gre.c:188:5-11: inconsistent IS_ERR and PTR_ERR, PTR_ERR on line 189
>>
>>  PTR_ERR should access the value just tested by IS_ERR
>>
>> Semantic patch information:
>>  There can be false positives in the patch case, where it is the call
>>  IS_ERR that is wrong.
>>
>> Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci
>>
>> CC: Pravin B Shelar <pshelar@nicira.com>
>> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> 
> Thanks for the fix.
> 
> Acked-by: Pravin B Shelar <pshelar@nicira.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH iproute2] ip: allow ip address show to list addresses with certain flags not being set
From: Stephen Hemminger @ 2014-12-24 20:16 UTC (permalink / raw)
  To: Heiner Kallweit; +Cc: netdev
In-Reply-To: <54986E93.4030108@gmail.com>

On Mon, 22 Dec 2014 20:18:43 +0100
Heiner Kallweit <hkallweit1@gmail.com> wrote:

> Sometimes it's needed to have "ip address show" list only addresses
> with certain flags not being set, e.g. in network scripts.
> As an example one might want to exclude addresses in "tentative"
> or "deprecated" state.
> 
> Support listing addresses with flags tentative, deprecated, dadfailed
> not being set by prefixing the respective flag with a minus.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Applied, but please send another patch to update manual page.

^ permalink raw reply

* Re: [PATCH iproute2 v3] tc: Show classes in tree view
From: Stephen Hemminger @ 2014-12-24 20:14 UTC (permalink / raw)
  To: Vadim Kochan; +Cc: netdev
In-Reply-To: <1419381976-23986-1-git-send-email-vadim4j@gmail.com>

On Wed, 24 Dec 2014 02:46:16 +0200
Vadim Kochan <vadim4j@gmail.com> wrote:

> From: Vadim Kochan <vadim4j@gmail.com>
> 
> Added new '-t[ree]' which shows classes dependency
> in the tree view. Meanwhile only generic stats info
> is supported.
> 
> e.g.:
> 
> $ tc/tc -t class show dev tap0
> +---(1:2) htb rate 6Mbit ceil 6Mbit burst 15Kb cburst 1599b
> |    +---(1:40) htb prio 0 rate 5Mbit ceil 5Mbit burst 15Kb cburst 1600b
> |    +---(1:50) htb rate 3Mbit ceil 6Mbit burst 15Kb cburst 1599b
> |    |    +---(1:51) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
> |    |
> |    +---(1:60) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
> |
> +---(1:1) htb rate 6Mbit ceil 6Mbit burst 15Kb cburst 1599b
>      +---(1:10) htb prio 0 rate 5Mbit ceil 5Mbit burst 15Kb cburst 1600b
>      +---(1:20) htb prio 0 rate 3Mbit ceil 6Mbit burst 15Kb cburst 1599b
>      +---(1:30) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
> 
> $ tc/tc -t -s class show dev tap0
> +---(1:2) htb rate 6Mbit ceil 6Mbit burst 15Kb cburst 1599b
> |    |    Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
> |    |    rate 0bit 0pps backlog 0b 0p requeues 0
> |    |
> |    +---(1:40) htb prio 0 rate 5Mbit ceil 5Mbit burst 15Kb cburst 1600b
> |    |          Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
> |    |          rate 0bit 0pps backlog 0b 0p requeues 0
> |    |
> |    +---(1:50) htb rate 3Mbit ceil 6Mbit burst 15Kb cburst 1599b
> |    |    |     Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
> |    |    |     rate 0bit 0pps backlog 0b 0p requeues 0
> |    |    |
> |    |    +---(1:51) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
> |    |               Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
> |    |               rate 0bit 0pps backlog 0b 0p requeues 0
> |    |
> |    +---(1:60) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
> |               Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
> |               rate 0bit 0pps backlog 0b 0p requeues 0
> |
> +---(1:1) htb rate 6Mbit ceil 6Mbit burst 15Kb cburst 1599b
>      |    Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
>      |    rate 0bit 0pps backlog 0b 0p requeues 0
>      |
>      +---(1:10) htb prio 0 rate 5Mbit ceil 5Mbit burst 15Kb cburst 1600b
>      |          Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
>      |          rate 0bit 0pps backlog 0b 0p requeues 0
>      |
>      +---(1:20) htb prio 0 rate 3Mbit ceil 6Mbit burst 15Kb cburst 1599b
>      |          Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
>      |          rate 0bit 0pps backlog 0b 0p requeues 0
>      |
>      +---(1:30) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
>                 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
>                 rate 0bit 0pps backlog 0b 0p requeues 0
> 
> Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
> ---
> Changes v3:
>     Fixed wrong brackets style
> 
> Changes v2:
>     Removed "Date:" from commit message which was added by mistake.
> 
> Changes RFC -> PATCH:
>     #1 get rid of INIT_HLIST_NODE
>     #2 added sample output to commit message
>     #3 use "show_tree=1" instead of "show_tree++"
>     #4 no need update include/hlist.h (because of #1)
>     #5 changed a little tree output: parentheses around class id instead of qdisc name
> 
>  tc/tc.c        |   5 +-
>  tc/tc_class.c  | 161 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
>  tc/tc_common.h |   2 +
>  3 files changed, 165 insertions(+), 3 deletions(-)

I don't get strict about checkpatch. But ran this patch through and there are some minor
things that would be good to fix.
  1. Split long lines like:
WARNING: line over 80 characters
#198: FILE: tc/tc_class.c:219:
+static void tree_cls_show(FILE *fp, char *buf, struct hlist_head *root_list, int level)

  2. Don't use variable name 'childs', makes sense to call it children instead??

  3. Don't use space before * as in:
ERROR: "foo * bar" should be "foo *bar"
#285: FILE: tc/tc_class.c:305:
+	struct rtattr * tb[TCA_MAX+1] = {};

^ permalink raw reply

* Re: [PATCH iproute2 v2] ip lib: Added shorter timestamp option
From: Stephen Hemminger @ 2014-12-24 20:09 UTC (permalink / raw)
  To: Vadim Kochan; +Cc: netdev
In-Reply-To: <1419286438-21504-1-git-send-email-vadim4j@gmail.com>

On Tue, 23 Dec 2014 00:13:58 +0200
Vadim Kochan <vadim4j@gmail.com> wrote:

> From: Vadim Kochan <vadim4j@gmail.com>
> 
> Added another timestamp format to look like more logging info:
> 
> [2014-12-22T22:36:50.489 ] 2: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default
>     link/ether 3c:97:0e:a3:86:2e brd ff:ff:ff:ff:ff:ff
> 
> Signed-off-by: Vadim Kochan <vadim4j@gmail.com>

Applied with some minor changes, the code was initializing more than necessary.

^ permalink raw reply

* Re: [PATCH 00/10] Split UFO into v4 and v6 versions.
From: Michael S. Tsirkin @ 2014-12-24 18:59 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: netdev, Vladislav Yasevich, stefanha, virtualization
In-Reply-To: <1419444680.4705.129.camel@decadent.org.uk>

On Wed, Dec 24, 2014 at 07:11:20PM +0100, Ben Hutchings wrote:
> On Thu, 2014-12-18 at 00:28 -0500, Jason Wang wrote:
> > 
> > ----- Original Message -----
> > > UFO support in the kernel applies to both IPv4 and IPv6 protocols
> > > with the same device feature.  However some devices may not be able
> > > to support one of the offloads.  For this we split the UFO offload
> > > feature into 2 pieces.  NETIF_F_UFO now controlls the IPv4 part and
> > > this series introduces NETIF_F_UFO6.
> > > 
> > > As a result of this work, we can now re-enable NETIF_F_UFO on
> > > virtio_net devices and restore UDP over IPv4 performance for guests.
> > > We also continue to support legacy guests that assume that UFO6
> > > support included into UFO(4).
> > > 
> > > Without this work, migrating a guest to a 3.18 kernel fails.
> > > 
> > 
> > This series eliminate the ambiguous NETIF_F_UFO.
> > 
> > But VIRTIO_NET_F_{HOST|GUEST}_UFO and VIRTIO_NET_F_HDR_GSO_UDP is still
> > ambigious. I know it was used to keep compatibility for legacy guest. But
> > what's the future plan? Differentiate UFOv4 and UFOv6 in virtio features and
> > gso type in vnet header looks sufficient?
> [...]
> 
> The IPv6 fragmentation ID needs to be added to the vnet header, to do
> UFOv6 properly.  If it wasn't for that lack, we wouldn't have to split
> the feature flag.
> 
> Ben.


Right.

I think a good plan is as follows:

1. add code generating IDs on rx path for virtio,
   and re-enable UFO (4+6).

2. Ben's patch doing similar things for tun/macvtap

3. similarly for packet sockets

above seem appropriate for stable

4. 4+6 split, to make it easier for drivers
   to identify when fragment ID is needed

5. extend vnet header, and add ways to enable it,
   when enabled, use that to pass
   fragment ID for tun/virtio/vhost/macvtap/packet socket

4 is what this patchset does.


> -- 
> Ben Hutchings
> If more than one person is responsible for a bug, no one is at fault.

^ permalink raw reply

* Re: [PATCH] openvswitch: fix odd_ptr_err.cocci warnings
From: Pravin Shelar @ 2014-12-24 18:49 UTC (permalink / raw)
  To: kbuild test robot
  Cc: dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org, netdev,
	kbuild-all-JC7UmRfGjtg, LKML
In-Reply-To: <20141224064138.GA11360@athens>

On Tue, Dec 23, 2014 at 10:41 PM, kbuild test robot
<fengguang.wu@intel.com> wrote:
> net/openvswitch/vport-gre.c:188:5-11: inconsistent IS_ERR and PTR_ERR, PTR_ERR on line 189
>
>  PTR_ERR should access the value just tested by IS_ERR
>
> Semantic patch information:
>  There can be false positives in the patch case, where it is the call
>  IS_ERR that is wrong.
>
> Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci
>
> CC: Pravin B Shelar <pshelar@nicira.com>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>

Thanks for the fix.

Acked-by: Pravin B Shelar <pshelar@nicira.com>

> ---
>
>  vport-gre.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/net/openvswitch/vport-gre.c
> +++ b/net/openvswitch/vport-gre.c
> @@ -186,7 +186,7 @@ static int gre_tnl_send(struct vport *vp
>         /* Push Tunnel header. */
>         skb = __build_header(skb, tunnel_hlen);
>         if (IS_ERR(skb)) {
> -               err = PTR_ERR(rt);
> +               err = PTR_ERR(skb);
>                 skb = NULL;
>                 goto err_free_rt;
>         }
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

^ permalink raw reply

* Re: [PATCH 00/10] Split UFO into v4 and v6 versions.
From: Ben Hutchings @ 2014-12-24 18:11 UTC (permalink / raw)
  To: Jason Wang; +Cc: netdev, Vladislav Yasevich, virtualization, stefanha, mst
In-Reply-To: <586203981.237162.1418880532523.JavaMail.zimbra@redhat.com>


[-- Attachment #1.1: Type: text/plain, Size: 1359 bytes --]

On Thu, 2014-12-18 at 00:28 -0500, Jason Wang wrote:
> 
> ----- Original Message -----
> > UFO support in the kernel applies to both IPv4 and IPv6 protocols
> > with the same device feature.  However some devices may not be able
> > to support one of the offloads.  For this we split the UFO offload
> > feature into 2 pieces.  NETIF_F_UFO now controlls the IPv4 part and
> > this series introduces NETIF_F_UFO6.
> > 
> > As a result of this work, we can now re-enable NETIF_F_UFO on
> > virtio_net devices and restore UDP over IPv4 performance for guests.
> > We also continue to support legacy guests that assume that UFO6
> > support included into UFO(4).
> > 
> > Without this work, migrating a guest to a 3.18 kernel fails.
> > 
> 
> This series eliminate the ambiguous NETIF_F_UFO.
> 
> But VIRTIO_NET_F_{HOST|GUEST}_UFO and VIRTIO_NET_F_HDR_GSO_UDP is still
> ambigious. I know it was used to keep compatibility for legacy guest. But
> what's the future plan? Differentiate UFOv4 and UFOv6 in virtio features and
> gso type in vnet header looks sufficient?
[...]

The IPv6 fragmentation ID needs to be added to the vnet header, to do
UFOv6 properly.  If it wasn't for that lack, we wouldn't have to split
the feature flag.

Ben.

-- 
Ben Hutchings
If more than one person is responsible for a bug, no one is at fault.

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

[-- Attachment #2: Type: text/plain, Size: 183 bytes --]

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply

* Re: [PATCH] net: wireless: rtlwifi: rtl8723be: phy.c:  Remove unused function
From: Kalle Valo @ 2014-12-24 16:59 UTC (permalink / raw)
  To: Rickard Strandqvist
  Cc: Larry Finger, Chaoming Li, John W. Linville, linux-wireless,
	netdev, linux-kernel
In-Reply-To: <1419116358-13223-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> writes:

> Remove the function rtl8723be_phy_get_txpower_level() that is not used anywhere.
>
> This was partially found by using a static code analysis program called cppcheck.
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>

Thanks, applied to wireless-drivers-next.git.

-- 
Kalle Valo

^ permalink raw reply

* Re: [PATCH] net: wireless: rtlwifi: rtl8192ee: trx.c:  Remove unused function
From: Kalle Valo @ 2014-12-24 16:56 UTC (permalink / raw)
  To: Rickard Strandqvist
  Cc: Larry Finger, Chaoming Li, John W. Linville, Greg Kroah-Hartman,
	Rasmus Villemoes, Joe Perches,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1419079694-32476-1-git-send-email-rickard_strandqvist-IW2WV5XWFqGZkjO+N0TKoMugMpMbD5Xr@public.gmane.org>

Rickard Strandqvist <rickard_strandqvist-IW2WV5XWFqGZkjO+N0TKoMugMpMbD5Xr@public.gmane.org> writes:

> Remove the function rtl92ee_get_available_desc() that is not used anywhere.
>
> This was partially found by using a static code analysis program called cppcheck.
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist-IW2WV5XWFqGZkjO+N0TKoMugMpMbD5Xr@public.gmane.org>

Thanks, applied to wireless-drivers-next.git.

But I simplified the patch title:

commit 9898b77536b8569be2704964d3c519ef070e4a27
Author: Rickard Strandqvist <rickard_strandqvist-IW2WV5XWFqGZkjO+N0TKoMugMpMbD5Xr@public.gmane.org>
Date:   Sat Dec 20 13:48:14 2014 +0100

    rtlwifi: rtl8192ee: trx.c: Remove unused function

-- 
Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH v3 20/20] kbuild: add a new kselftest_install make target to install selftests
From: Shuah Khan @ 2014-12-24 16:27 UTC (permalink / raw)
  To: mmarek, gregkh, akpm, rostedt, mingo, davem, keescook,
	tranmanphong, mpe, cov, dh.herrmann, hughd, bobby.prani,
	serge.hallyn, ebiederm, tim.bird, josh, koct9i
  Cc: Shuah Khan, linux-kbuild, linux-kernel, linux-api, netdev
In-Reply-To: <cover.1419387513.git.shuahkh@osg.samsung.com>

Add a new make target to install to install kernel selftests.
This new target will build and install selftests. kselftest
target now depends on kselftest_install and runs the generated
kselftest script to reduce duplicate work and for common look
and feel when running tests.

make kselftest_target:
-- exports kselftest INSTALL_KSFT_PATH
   default $(INSTALL_MOD_PATH)/lib/kselftest/$(KERNELRELEASE)
-- exports INSTALL_KSFT_PATH
-- runs selftests make install target:

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
 Makefile | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index b1c3254..99fac47 100644
--- a/Makefile
+++ b/Makefile
@@ -1072,12 +1072,21 @@ headers_check: headers_install
 	$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) HDRCHECK=1
 
 # ---------------------------------------------------------------------------
-# Kernel selftest
+# Kernel selftest targets
+
+# Default base path for kselftest install
+INSTALL_KSFT_PATH = $(INSTALL_MOD_PATH)/lib/kselftest/$(KERNELRELEASE)
+export INSTALL_KSFT_PATH
 
 PHONY += kselftest
 kselftest:
 	$(Q)$(MAKE) -C tools/testing/selftests run_tests
 
+# Kernel selftest install
+PHONY += kselftest_install
+kselftest_install:
+	$(Q)$(MAKE) -C tools/testing/selftests install
+
 # ---------------------------------------------------------------------------
 # Modules
 
@@ -1286,6 +1295,9 @@ help:
 	@echo  '                    Build, install, and boot kernel before'
 	@echo  '                    running kselftest on it'
 	@echo  ''
+	@echo  '  kselftest_install - Install Kselftests to INSTALL_KSFT_PATH'
+	@echo  '                      default: $(INSTALL_MOD_PATH)/lib/kselftest/$(KERNELRELEASE)'
+	@echo  ''
 	@echo  'Kernel packaging:'
 	@$(MAKE) $(build)=$(package-dir) help
 	@echo  ''
-- 
2.1.0

^ permalink raw reply related

* [PATCH v3 19/20] selftests: add install target to enable test install
From: Shuah Khan @ 2014-12-24 16:27 UTC (permalink / raw)
  To: mmarek, gregkh, akpm, rostedt, mingo, davem, keescook,
	tranmanphong, mpe, cov, dh.herrmann, hughd, bobby.prani,
	serge.hallyn, ebiederm, tim.bird, josh, koct9i
  Cc: Shuah Khan, linux-kbuild, linux-kernel, linux-api, netdev
In-Reply-To: <cover.1419387513.git.shuahkh@osg.samsung.com>

Add a new make target to enable installing selftests. This
new target will call install targets for the tests that are
specified in INSTALL_TARGETS. During install, a script is
generated to run tests that are installed. This script will
be installed in the selftest install directory. Individual
test Makefiles are changed to add to the script. This will
allow new tests to add install and run test commands to the
generated kselftest script. run_tests target runs the
generated kselftest script to run tests when it is initiated
from from "make kselftest" from top level source directory.

Approach:

Add a new kselftest_install target:
-- exports kselftest INSTALL_KSFT_PATH
   default $(INSTALL_MOD_PATH)/lib/kselftest/$(KERNELRELEASE)
-- exports INSTALL_KSFT_PATH
-- runs selftests make kselftest_install target:

selftests make install target
-- Sets up environment for sub-makefiles
-- creates kselftest.sh script in install install dir
-- runs install targets for INSTALL_TARGETS
-- install target can be run only from top level source dir.

Individual test make install targets:
-- install test programs and/or scripts in install dir
-- append to the ksefltest.sh file to add commands to run test
-- install target can be run only from top level source dir.

Adds the following new ways to initiate selftests:
-- Installing and running kselftest from install directory
   by running  "make kselftest"
-- Running kselftest script from install directory

Maintains the following ways to run tests:
-- make TARGETS=net kselftest
-- make -C tools/testing/selftests run_tests
-- make -C tools/testing/selftests TARGETS=target run_tests
   Ability specify targets: e.g TARGETS=net
-- make run_tests from tools/testing/selftests
-- make run_tests from individual test directories:
   e.g: make run_tests in tools/testing/selftests/net

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
 tools/testing/selftests/Makefile | 54 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 53 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index 4e51122..e70cdc9 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -22,15 +22,67 @@ TARGETS += vm
 TARGETS_HOTPLUG = cpu-hotplug
 TARGETS_HOTPLUG += memory-hotplug
 
+# Used in only run_tests target when make kselftest is run in
+# top level source directory
+ifeq "$(origin TARGETS)" "command line"
+no_install_run=1
+endif
+
+ifdef INSTALL_KSFT_PATH
+KSELFTEST=$(INSTALL_KSFT_PATH)/kselftest.sh
+export KSELFTEST
+# TODO add install target for SKIP_INSTALL_TARGETS
+SKIP_INSTALL_TARGETS = exec powerpc
+INSTALL_TARGETS = $(filter-out $(SKIP_INSTALL_TARGETS),$(TARGETS)) ipc
+else
+no_install_run=1
+endif
+
+INSTALL_KSFT_ERR = Run make kselftest_install in top level source directory
+
 all:
 	for TARGET in $(TARGETS); do \
 		make -C $$TARGET; \
 	done;
 
-run_tests: all
+install:
+ifdef INSTALL_KSFT_PATH
+	rm -rf $(INSTALL_KSFT_PATH)
+	mkdir -p $(INSTALL_KSFT_PATH)
+
+	make all
+	@echo "#!/bin/sh\n# Kselftest Run Tests ...." >> $(KSELFTEST)
+	@echo "# This file is generated by kselftest_install" >> $(KSELFTEST)
+	@echo "# Please don't change it !!\n"  >> $(KSELFTEST)
+	@echo echo ============================== >> $(KSELFTEST)
+	for TARGET in $(INSTALL_TARGETS); do \
+		echo Installing $$TARGET; \
+		echo echo Start $$TARGET test .... >> $(KSELFTEST); \
+		make -C $$TARGET install; \
+		echo echo End $$TARGET test .... >> $(KSELFTEST); \
+		echo echo ============================== >> $(KSELFTEST); \
+	done;
+	chmod +x $(KSELFTEST)
+else
+	@echo $(INSTALL_KSFT_ERR)
+endif
+
+run_tests:
+ifndef no_install_run
+# ifdef INSTALL_KSFT_PATH
+	make install
+	@cd $(INSTALL_KSFT_PATH); ./kselftest.sh; cd -
+# invoke run_tests for SKIP_INSTALL_TARGETS
+	for TARGET in $(SKIP_INSTALL_TARGETS); do \
+		make -C $$TARGET run_tests; \
+	done;
+# endif
+else
+	make all
 	for TARGET in $(TARGETS); do \
 		make -C $$TARGET run_tests; \
 	done;
+endif
 
 hotplug:
 	for TARGET in $(TARGETS_HOTPLUG); do \
-- 
2.1.0

^ permalink raw reply related

* [PATCH v3 18/20] selftests/vm: add install target to enable test install
From: Shuah Khan @ 2014-12-24 16:27 UTC (permalink / raw)
  To: mmarek, gregkh, akpm, rostedt, mingo, davem, keescook,
	tranmanphong, mpe, cov, dh.herrmann, hughd, bobby.prani,
	serge.hallyn, ebiederm, tim.bird, josh, koct9i
  Cc: Shuah Khan, linux-kbuild, linux-kernel, linux-api, netdev
In-Reply-To: <cover.1419387513.git.shuahkh@osg.samsung.com>

Add a new make target to enable installing test. This target
installs test in the kselftest install location and add to the
kselftest script to run the test. Install target can be run
only from top level kernel source directory.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
 tools/testing/selftests/vm/Makefile | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile
index 4c4b1f6..761d17d 100644
--- a/tools/testing/selftests/vm/Makefile
+++ b/tools/testing/selftests/vm/Makefile
@@ -4,13 +4,22 @@ CC = $(CROSS_COMPILE)gcc
 CFLAGS = -Wall
 BINARIES = hugepage-mmap hugepage-shm map_hugetlb thuge-gen hugetlbfstest
 BINARIES += transhuge-stress
+TEST_STR = /bin/sh ./run_vmtests || echo vmtests: [FAIL]
 
 all: $(BINARIES)
 %: %.c
 	$(CC) $(CFLAGS) -o $@ $^
 
+install:
+ifdef INSTALL_KSFT_PATH
+	install run_vmtests $(BINARIES) $(INSTALL_KSFT_PATH)
+	@echo "$(TEST_STR)" >> $(KSELFTEST)
+else
+	@echo Run make kselftest_install in top level source directory
+endif
+
 run_tests: all
-	@/bin/sh ./run_vmtests || (echo "vmtests: [FAIL]"; exit 1)
+	@$(TEST_STR)
 
 clean:
 	$(RM) $(BINARIES)
-- 
2.1.0

^ permalink raw reply related

* [PATCH v3 17/20] selftests/user: add install target to enable test install
From: Shuah Khan @ 2014-12-24 16:27 UTC (permalink / raw)
  To: mmarek, gregkh, akpm, rostedt, mingo, davem, keescook,
	tranmanphong, mpe, cov, dh.herrmann, hughd, bobby.prani,
	serge.hallyn, ebiederm, tim.bird, josh, koct9i
  Cc: Shuah Khan, linux-kbuild, linux-kernel, linux-api, netdev
In-Reply-To: <cover.1419387513.git.shuahkh@osg.samsung.com>

Add a new make target to enable installing test. This target
installs test in the kselftest install location and add to the
kselftest script to run the test. Install target can be run
only from top level kernel source directory.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
 tools/testing/selftests/user/Makefile | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/user/Makefile b/tools/testing/selftests/user/Makefile
index 12c9d15..218c5aa 100644
--- a/tools/testing/selftests/user/Makefile
+++ b/tools/testing/selftests/user/Makefile
@@ -1,7 +1,17 @@
 # Makefile for user memory selftests
 
+TEST_STR = ./test_user_copy.sh
+
 # No binaries, but make sure arg-less "make" doesn't trigger "run_tests"
 all:
 
+install:
+ifdef INSTALL_KSFT_PATH
+	install ./test_user_copy.sh $(INSTALL_KSFT_PATH)
+	@echo "$(TEST_STR)" >> $(KSELFTEST)
+else
+	@echo Run make kselftest_install in top level source directory
+endif
+
 run_tests: all
-	./test_user_copy.sh
+	@$(TEST_STR)
-- 
2.1.0

^ permalink raw reply related

* [PATCH v3 16/20] selftests/timers: add install target to enable test install
From: Shuah Khan @ 2014-12-24 16:27 UTC (permalink / raw)
  To: mmarek, gregkh, akpm, rostedt, mingo, davem, keescook,
	tranmanphong, mpe, cov, dh.herrmann, hughd, bobby.prani,
	serge.hallyn, ebiederm, tim.bird, josh, koct9i
  Cc: Shuah Khan, linux-kbuild, linux-kernel, linux-api, netdev
In-Reply-To: <cover.1419387513.git.shuahkh@osg.samsung.com>

Add a new make target to enable installing test. This target
installs test in the kselftest install location and add to the
kselftest script to run the test. Install target can be run
only from top level kernel source directory.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
 tools/testing/selftests/timers/Makefile | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/timers/Makefile b/tools/testing/selftests/timers/Makefile
index eb2859f..922bad5 100644
--- a/tools/testing/selftests/timers/Makefile
+++ b/tools/testing/selftests/timers/Makefile
@@ -1,8 +1,18 @@
+TEST_STR = ./posix_timers
+
 all:
 	gcc posix_timers.c -o posix_timers -lrt
 
+install:
+ifdef INSTALL_KSFT_PATH
+	install ./posix_timers $(INSTALL_KSFT_PATH)
+	@echo "$(TEST_STR)" >> $(KSELFTEST)
+else
+	@echo Run make kselftest_install in top level source directory
+endif
+
 run_tests: all
-	./posix_timers
+	@$(TEST_STR)
 
 clean:
 	rm -f ./posix_timers
-- 
2.1.0

^ permalink raw reply related

* [PATCH v3 15/20] selftests/sysctl: add install target to enable test install
From: Shuah Khan @ 2014-12-24 16:27 UTC (permalink / raw)
  To: mmarek, gregkh, akpm, rostedt, mingo, davem, keescook,
	tranmanphong, mpe, cov, dh.herrmann, hughd, bobby.prani,
	serge.hallyn, ebiederm, tim.bird, josh, koct9i
  Cc: Shuah Khan, linux-kbuild, linux-kernel, linux-api, netdev
In-Reply-To: <cover.1419387513.git.shuahkh@osg.samsung.com>

Add a new make target to enable installing test. This target
installs test in the kselftest install location and add to the
kselftest script to run the test. Install target can be run
only from top level kernel source directory.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
 tools/testing/selftests/sysctl/Makefile | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/sysctl/Makefile b/tools/testing/selftests/sysctl/Makefile
index 0a92ada..dfbaa58 100644
--- a/tools/testing/selftests/sysctl/Makefile
+++ b/tools/testing/selftests/sysctl/Makefile
@@ -4,12 +4,25 @@
 # No binaries, but make sure arg-less "make" doesn't trigger "run_tests".
 all:
 
+INSTALL_PROGS = common_tests run_numerictests run_stringtests
+NUMERIC_TEST_STR = /bin/sh ./run_numerictests
+STRING_TEST_STR = /bin/sh ./run_stringtests
+
 # Allow specific tests to be selected.
 test_num:
-	@/bin/sh ./run_numerictests
+	@$(NUMERIC_TEST_STR)
 
 test_string:
-	@/bin/sh ./run_stringtests
+	@$(STRING_TEST_STR)
+
+install: all
+ifdef INSTALL_KSFT_PATH
+	install $(INSTALL_PROGS) $(INSTALL_KSFT_PATH)
+	@echo "$(NUMERIC_TEST_STR)" >> $(KSELFTEST)
+	@echo "$(STRING_TEST_STR)" >> $(KSELFTEST)
+else
+	@echo Run make kselftest_install in top level source directory
+endif
 
 run_tests: all test_num test_string
 
-- 
2.1.0

^ permalink raw reply related

* [PATCH v3 14/20] selftests/size: add install target to enable test install
From: Shuah Khan @ 2014-12-24 16:27 UTC (permalink / raw)
  To: mmarek, gregkh, akpm, rostedt, mingo, davem, keescook,
	tranmanphong, mpe, cov, dh.herrmann, hughd, bobby.prani,
	serge.hallyn, ebiederm, tim.bird, josh, koct9i
  Cc: Shuah Khan, linux-kbuild, linux-kernel, linux-api, netdev
In-Reply-To: <cover.1419387513.git.shuahkh@osg.samsung.com>

Add a new make target to enable installing test. This target
installs test in the kselftest install location and add to the
kselftest script to run the test. Install target can be run
only from top level kernel source directory.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
 tools/testing/selftests/size/Makefile | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/size/Makefile b/tools/testing/selftests/size/Makefile
index 04dc25e..bb7113b 100644
--- a/tools/testing/selftests/size/Makefile
+++ b/tools/testing/selftests/size/Makefile
@@ -1,12 +1,22 @@
 CC = $(CROSS_COMPILE)gcc
 
+TEST_STR = ./get_size || echo get_size selftests: [FAIL]
+
 all: get_size
 
 get_size: get_size.c
 	$(CC) -static -ffreestanding -nostartfiles -s $< -o $@
 
+install:
+ifdef INSTALL_KSFT_PATH
+	install ./get_size $(INSTALL_KSFT_PATH)
+	@echo "$(TEST_STR)" >> $(KSELFTEST)
+else
+	@echo Run make kselftest_install in top level source directory
+endif
+
 run_tests: all
-	./get_size
+	@$(TEST_STR)
 
 clean:
 	$(RM) get_size
-- 
2.1.0

^ permalink raw reply related

* [PATCH v3 13/20] selftests/ptrace: add install target to enable test install
From: Shuah Khan @ 2014-12-24 16:27 UTC (permalink / raw)
  To: mmarek, gregkh, akpm, rostedt, mingo, davem, keescook,
	tranmanphong, mpe, cov, dh.herrmann, hughd, bobby.prani,
	serge.hallyn, ebiederm, tim.bird, josh, koct9i
  Cc: Shuah Khan, linux-kbuild, linux-kernel, linux-api, netdev
In-Reply-To: <cover.1419387513.git.shuahkh@osg.samsung.com>

Add a new make target to enable installing test. This target
installs test in the kselftest install location and add to the
kselftest script to run the test. Install target can be run
only from top level kernel source directory.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
 tools/testing/selftests/ptrace/Makefile | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/ptrace/Makefile b/tools/testing/selftests/ptrace/Makefile
index 47ae2d3..f238212 100644
--- a/tools/testing/selftests/ptrace/Makefile
+++ b/tools/testing/selftests/ptrace/Makefile
@@ -1,10 +1,20 @@
 CFLAGS += -iquote../../../../include/uapi -Wall
-peeksiginfo: peeksiginfo.c
 
-all: peeksiginfo
+TEST_STR = ./peeksiginfo || echo peeksiginfo selftests: [FAIL]
+
+all:
+	gcc peeksiginfo.c -o peeksiginfo
+
+install:
+ifdef INSTALL_KSFT_PATH
+	install ./peeksiginfo $(INSTALL_KSFT_PATH)
+	@echo "$(TEST_STR)" >> $(KSELFTEST)
+else
+	@echo Run make kselftest_install in top level source directory
+endif
 
 clean:
 	rm -f peeksiginfo
 
 run_tests: all
-	@./peeksiginfo || echo "peeksiginfo selftests: [FAIL]"
+	@$(TEST_STR)
-- 
2.1.0

^ permalink raw reply related

* [PATCH v3 12/20] selftests/net: add install target to enable test install
From: Shuah Khan @ 2014-12-24 16:27 UTC (permalink / raw)
  To: mmarek, gregkh, akpm, rostedt, mingo, davem, keescook,
	tranmanphong, mpe, cov, dh.herrmann, hughd, bobby.prani,
	serge.hallyn, ebiederm, tim.bird, josh, koct9i
  Cc: Shuah Khan, linux-kbuild, linux-kernel, linux-api, netdev
In-Reply-To: <cover.1419387513.git.shuahkh@osg.samsung.com>

Add a new make target to enable installing test. This target
installs test in the kselftest install location and add to the
kselftest script to run the test. Install target can be run
only from top level kernel source directory.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
 tools/testing/selftests/net/Makefile | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile
index 62f22cc..2ffc96f 100644
--- a/tools/testing/selftests/net/Makefile
+++ b/tools/testing/selftests/net/Makefile
@@ -6,14 +6,28 @@ CFLAGS = -Wall -O2 -g
 CFLAGS += -I../../../../usr/include/
 
 NET_PROGS = socket psock_fanout psock_tpacket
+INSTALL_PROGS = run_netsocktests run_afpackettests test_bpf.sh $(NET_PROGS)
+NETSOCK_TEST_STR = /bin/sh ./run_netsocktests || echo sockettests: [FAIL]
+AFPKT_TEST_STR = /bin/sh ./run_afpackettests || echo afpackettests: [FAIL]
+BFP_TEST_STR = ./test_bpf.sh
 
 all: $(NET_PROGS)
 %: %.c
 	$(CC) $(CFLAGS) -o $@ $^
 
+install:
+ifdef INSTALL_KSFT_PATH
+	install $(INSTALL_PROGS) $(INSTALL_KSFT_PATH)
+	@echo "$(NETSOCK_TEST_STR)" >> $(KSELFTEST)
+	@echo "$(AFPKT_TEST_STR)" >> $(KSELFTEST)
+	@echo "$(BFP_TEST_STR)" >> $(KSELFTEST)
+else
+	@echo Run make kselftest_install in top level source directory
+endif
+
 run_tests: all
-	@/bin/sh ./run_netsocktests || echo "sockettests: [FAIL]"
-	@/bin/sh ./run_afpackettests || echo "afpackettests: [FAIL]"
-	./test_bpf.sh
+	@$(NETSOCK_TEST_STR)
+	@$(AFPKT_TEST_STR)
+	@$(BFP_TEST_STR)
 clean:
 	$(RM) $(NET_PROGS)
-- 
2.1.0

^ permalink raw reply related

* [PATCH v3 11/20] selftests/mqueue: add install target to enable test install
From: Shuah Khan @ 2014-12-24 16:27 UTC (permalink / raw)
  To: mmarek, gregkh, akpm, rostedt, mingo, davem, keescook,
	tranmanphong, mpe, cov, dh.herrmann, hughd, bobby.prani,
	serge.hallyn, ebiederm, tim.bird, josh, koct9i
  Cc: Shuah Khan, linux-kbuild, linux-kernel, linux-api, netdev
In-Reply-To: <cover.1419387513.git.shuahkh@osg.samsung.com>

Add a new make target to enable installing test. This target
installs test in the kselftest install location and add to the
kselftest script to run the test. Install target can be run
only from top level kernel source directory.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
 tools/testing/selftests/mqueue/Makefile | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/mqueue/Makefile b/tools/testing/selftests/mqueue/Makefile
index 8056e2e..27757b9 100644
--- a/tools/testing/selftests/mqueue/Makefile
+++ b/tools/testing/selftests/mqueue/Makefile
@@ -1,10 +1,22 @@
+MQ_OPEN_TEST_STR = ./mq_open_tests /test1 || echo mq_open_tests: [FAIL]
+MQ_PERF_TEST_STR = ./mq_perf_tests || echo mq_perf_tests: [FAIL]
+
 all:
 	gcc -O2 mq_open_tests.c -o mq_open_tests -lrt
 	gcc -O2 -o mq_perf_tests mq_perf_tests.c -lrt -lpthread -lpopt
 
-run_tests:
-	@./mq_open_tests /test1 || echo "mq_open_tests: [FAIL]"
-	@./mq_perf_tests || echo "mq_perf_tests: [FAIL]"
+install:
+ifdef INSTALL_KSFT_PATH
+	install ./mq_open_tests ./mq_perf_tests $(INSTALL_KSFT_PATH)
+	@echo "$(MQ_OPEN_TEST_STR)" >> $(KSELFTEST)
+	@echo "$(MQ_PERF_TEST_STR)" >> $(KSELFTEST)
+else
+	@echo Run make kselftest_install in top level source directory
+endif
+
+run_tests: all
+	@$(MQ_OPEN_TEST_STR)
+	@$(MQ_PERF_TEST_STR)
 
 clean:
 	rm -f mq_open_tests mq_perf_tests
-- 
2.1.0

^ permalink raw reply related

* [PATCH v3 10/20] selftests/mount: add install target to enable test install
From: Shuah Khan @ 2014-12-24 16:27 UTC (permalink / raw)
  To: mmarek, gregkh, akpm, rostedt, mingo, davem, keescook,
	tranmanphong, mpe, cov, dh.herrmann, hughd, bobby.prani,
	serge.hallyn, ebiederm, tim.bird, josh, koct9i
  Cc: Shuah Khan, linux-kbuild, linux-kernel, linux-api, netdev
In-Reply-To: <cover.1419387513.git.shuahkh@osg.samsung.com>

Add a new make target to enable installing test. This target
installs test in the kselftest install location and add to the
kselftest script to run the test. Install target can be run
only from top level kernel source directory.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
 tools/testing/selftests/mount/Makefile | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/mount/Makefile b/tools/testing/selftests/mount/Makefile
index 337d853..607de4c 100644
--- a/tools/testing/selftests/mount/Makefile
+++ b/tools/testing/selftests/mount/Makefile
@@ -1,5 +1,7 @@
 # Makefile for mount selftests.
 
+TEST_STR = if [ -f /proc/self/uid_map ] ; then ./unprivileged-remount-test ; fi
+
 all: unprivileged-remount-test
 
 unprivileged-remount-test: unprivileged-remount-test.c
@@ -7,7 +9,15 @@ unprivileged-remount-test: unprivileged-remount-test.c
 
 # Allow specific tests to be selected.
 test_unprivileged_remount: unprivileged-remount-test
-	@if [ -f /proc/self/uid_map ] ; then ./unprivileged-remount-test ; fi
+	@$(TEST_STR)
+
+install:
+ifdef INSTALL_KSFT_PATH
+	install ./unprivileged-remount-test $(INSTALL_KSFT_PATH)
+	@echo "$(TEST_STR)" >> $(KSELFTEST)
+else
+	@echo Run make kselftest_install in top level source directory
+endif
 
 run_tests: all test_unprivileged_remount
 
-- 
2.1.0

^ permalink raw reply related

* [PATCH v3 09/20] selftests/memory-hotplug: add install target to enable test install
From: Shuah Khan @ 2014-12-24 16:27 UTC (permalink / raw)
  To: mmarek, gregkh, akpm, rostedt, mingo, davem, keescook,
	tranmanphong, mpe, cov, dh.herrmann, hughd, bobby.prani,
	serge.hallyn, ebiederm, tim.bird, josh, koct9i
  Cc: Shuah Khan, linux-kbuild, linux-kernel, linux-api, netdev
In-Reply-To: <cover.1419387513.git.shuahkh@osg.samsung.com>

Add a new make target to enable installing test. This target
installs test in the kselftest install location and add to the
kselftest script to run the test. Install target can be run
only from top level kernel source directory.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
 tools/testing/selftests/memory-hotplug/Makefile            | 14 ++++++++++++--
 .../memory-hotplug/{on-off-test.sh => mem-on-off-test.sh}  |  0
 2 files changed, 12 insertions(+), 2 deletions(-)
 rename tools/testing/selftests/memory-hotplug/{on-off-test.sh => mem-on-off-test.sh} (100%)

diff --git a/tools/testing/selftests/memory-hotplug/Makefile b/tools/testing/selftests/memory-hotplug/Makefile
index d46b8d4..561ee2b 100644
--- a/tools/testing/selftests/memory-hotplug/Makefile
+++ b/tools/testing/selftests/memory-hotplug/Makefile
@@ -1,9 +1,19 @@
+TEST_STR=/bin/bash ./mem-on-off-test.sh -r 2 || echo memory-hotplug selftests: [FAIL]
+
 all:
 
+install:
+ifdef INSTALL_KSFT_PATH
+	install ./mem-on-off-test.sh $(INSTALL_KSFT_PATH)/mem-on-off-test.sh
+	@echo "$(TEST_STR)" >> $(KSELFTEST) >> $(KSELFTEST)
+else
+	@echo Run make kselftest_install in top level source directory
+endif
+
 run_tests:
-	@/bin/bash ./on-off-test.sh -r 2 || echo "memory-hotplug selftests: [FAIL]"
+	@$(TEST_STR)
 
 run_full_test:
-	@/bin/bash ./on-off-test.sh || echo "memory-hotplug selftests: [FAIL]"
+	@/bin/bash ./mem-on-off-test.sh || echo "memory-hotplug selftests: [FAIL]"
 
 clean:
diff --git a/tools/testing/selftests/memory-hotplug/on-off-test.sh b/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh
similarity index 100%
rename from tools/testing/selftests/memory-hotplug/on-off-test.sh
rename to tools/testing/selftests/memory-hotplug/mem-on-off-test.sh
-- 
2.1.0

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox