* Re: [PATCH net-net 0/4] Increase the limit of tuntap queues
From: David Miller @ 2014-11-23 18:43 UTC (permalink / raw)
To: mst
Cc: pagupta, linux-kernel, netdev, jasowang, dgibson, vfalico,
edumazet, vyasevic, hkchu, wuzhy, xemul, therbert, bhutchings,
xii, stephen, jiri, sergei.shtylyov
In-Reply-To: <20141123104623.GA31915@redhat.com>
From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Sun, 23 Nov 2014 12:46:23 +0200
> At the moment attaching/detaching queues is an unpriveledged operation.
>
> Shouldn't we worry that an application can cause large
> allocations, and provide a way to limit these?
>
> David, could you comment on this please?
I don't want arbitrary limits imposed.
Where does this "application" run? If it's in the host, then who
cares? If they suck up all of their available memory with queue
resources, it's their problem.
^ permalink raw reply
* Re: [PATCH 0/6] kernel tinification: optionally compile out splice family of syscalls (splice, vmsplice, tee and sendfile)
From: David Miller @ 2014-11-23 18:46 UTC (permalink / raw)
To: pieter-qeJ+1H9vRZbz+pZb47iToQ
Cc: josh-iaAMLnmF4UmaiuxdJuQwMA,
alexander.h.duyck-ral2JQCrhuEAvxtiuMwx3w,
viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn, ast-uqk4Ao+rVK5Wk0Htik3J/w,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
beber-2YnHqweIUXrk1uMJSBkQmQ,
catalina.mocanu-Re5JQEeQqe8AvxtiuMwx3w,
dborkman-H+wXaHxf7aLQT0dZR+AlfA, edumazet-hpIqsD4AKlfQT0dZR+AlfA,
ebiederm-aS9lmoZGLiVWk0Htik3J/w, fabf-AgBVmzD5pcezQB+pC5nmwQ,
fuse-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
geert-Td1EMuHUCqxL1ZNQvxDV9g, hughd-hpIqsD4AKlfQT0dZR+AlfA,
iulia.manda21-Re5JQEeQqe8AvxtiuMwx3w, JBeulich-IBi9RG/b67k,
bfields-uC3wQj2KruNg9hUCZPvPmw, jlayton-vpEMnDpepFuMZCB2o+C8xQ,
linux-api-u79uwXL29TY76Z2rM5mHXA,
linux-fsdevel-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, mcgrof-IBi9RG/b67k,
mattst88-Re5JQEeQqe8AvxtiuMwx3w, mgorman-l3A5Bk7waGM,
mst-H+wXaHxf7aLQT0dZR+AlfA, miklos-sUDqSbJrdHQHWmgEVkV9KA,
netdev-u79uwXL29TY76Z2rM5mHXA, oleg-H+wXaHxf7aLQT0dZR+AlfA,
Paul.Durrant-Sxgqhf6Nn4DQT0dZR+AlfA,
paulmck-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8,
pefoley2-lY0TAiDIAFlBDgjK7y7TUQ, tgraf-G/eBtMaohhA,
therbert-hpIqsD4AKlfQT0dZR+AlfA, willemb-hpIqsD4AKlfQT0dZR+AlfA,
xiaoguangrong-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8,
zhenglong.cai-TJRtMXcVgQTM1kAEIRd3EQ
In-Reply-To: <1416752468-1626-1-git-send-email-pieter-qeJ+1H9vRZbz+pZb47iToQ@public.gmane.org>
Truly removing sendfile/sendpage means that you can't even compile NFS
into the tree.
I cannot take this patch series seriously, sorry.
^ permalink raw reply
* Re: [PATCH net-next] vlan: Pass ethtool get_ts_info queries to real device.
From: David Miller @ 2014-11-23 18:48 UTC (permalink / raw)
To: richardcochran; +Cc: ben, netdev, stefan.sorensen
In-Reply-To: <20141123160533.GA4562@netboy>
From: Richard Cochran <richardcochran@gmail.com>
Date: Sun, 23 Nov 2014 17:05:35 +0100
> On Sun, Nov 23, 2014 at 03:15:12AM +0000, Ben Hutchings wrote:
>> This assumes that the same PTP capabilities apply to VLAN-tagged frames.
>> I don't think it's at all safe to assume that RX filter modes other than
>> HWTSTAMP_FILTER_ALL will include VLAN-tagged frames. I think it is
>> necessary to define additional modes that explicitly include VLAN-tagged
>> frames.
>
> Unsafe? How?
>
> Do you mean that some HW cannot identify and time stamp PTP frames
> when VLAN tagged? That is surely disappointing for people who shell
> out money for such cards, but it is hardly unsafe.
Ben, you will have to provide a concrete example of a chip that will
do the wrong thing with Richard's change.
Hypotheticals won't cut it.
Thanks.
^ permalink raw reply
* Re: [PATCH net-next] mlx4: fix mlx4_en_set_rxfh()
From: David Miller @ 2014-11-23 18:49 UTC (permalink / raw)
To: eric.dumazet; +Cc: ben, netdev, amirv
In-Reply-To: <1416705859.17888.7.camel@edumazet-glaptop2.roam.corp.google.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 22 Nov 2014 17:24:19 -0800
> From: Eric Dumazet <edumazet@google.com>
>
> mlx4_en_set_rxfh() can crash if no RSS indir table is provided.
>
> While we are at it, allow RSS key to be changed with ethtool -X
>
> Tested:
...
> Reported-by: Ben Hutchings <ben@decadent.org.uk>
> Fixes: b9d1ab7eb42e ("mlx4: use netdev_rss_key_fill() helper")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied, thanks Eric.
^ permalink raw reply
* Re: [PATCH net-next] vlan: Pass ethtool get_ts_info queries to real device.
From: Ben Hutchings @ 2014-11-23 19:04 UTC (permalink / raw)
To: David Miller; +Cc: richardcochran, netdev, stefan.sorensen
In-Reply-To: <20141123.134809.1311687203339230014.davem@davemloft.net>
[-- Attachment #1: Type: text/plain, Size: 1502 bytes --]
On Sun, 2014-11-23 at 13:48 -0500, David Miller wrote:
> From: Richard Cochran <richardcochran@gmail.com>
> Date: Sun, 23 Nov 2014 17:05:35 +0100
>
> > On Sun, Nov 23, 2014 at 03:15:12AM +0000, Ben Hutchings wrote:
> >> This assumes that the same PTP capabilities apply to VLAN-tagged frames.
> >> I don't think it's at all safe to assume that RX filter modes other than
> >> HWTSTAMP_FILTER_ALL will include VLAN-tagged frames. I think it is
> >> necessary to define additional modes that explicitly include VLAN-tagged
> >> frames.
> >
> > Unsafe? How?
> >
> > Do you mean that some HW cannot identify and time stamp PTP frames
> > when VLAN tagged? That is surely disappointing for people who shell
> > out money for such cards, but it is hardly unsafe.
>
> Ben, you will have to provide a concrete example of a chip that will
> do the wrong thing with Richard's change.
>
> Hypotheticals won't cut it.
The two datasheets I've looked at so far (EG20T for pch_gbe driver,
BF518 for bfin_mac driver) mention support for 802.1q but not 802.1ad.
I already mentioned ptp_classify.c doesn't support 802.1ad, and I can't
see how it would ever make sense to run PTP directly over 802.1ad
anyway.
I'll read some more datasheets to see whether 802.1q is generally
supported, but for 802.1ad VLAN devices I think we should pass-through
only the NONE and ALL filter capabilities.
Ben.
--
Ben Hutchings
Never put off till tomorrow what you can avoid all together.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]
^ permalink raw reply
* Re: [net PATCH] ipv6: Do not treat a GSO_TCPV4 request from UDP tunnel over IPv6 as invalid
From: David Miller @ 2014-11-23 19:18 UTC (permalink / raw)
To: alexander.h.duyck; +Cc: netdev
In-Reply-To: <20141122033603.22361.28896.stgit@ahduyck-server>
From: Alexander Duyck <alexander.h.duyck@redhat.com>
Date: Fri, 21 Nov 2014 19:37:09 -0800
> This patch adds SKB_GSO_TCPV4 to the list of supported GSO types handled by
> the IPv6 GSO offloads. Without this change VXLAN tunnels running over IPv6
> do not currently handle IPv4 TCP TSO requests correctly and end up handing
> the non-segmented frame off to the device.
>
> Below is the before and after for a simple netperf TCP_STREAM test between
> two endpoints tunneling IPv4 over a VXLAN tunnel running on IPv6 on top of
> a 1Gb/s network adapter.
>
> Recv Send Send
> Socket Socket Message Elapsed
> Size Size Size Time Throughput
> bytes bytes bytes secs. 10^6bits/sec
>
> 87380 16384 16384 10.29 0.88 Before
> 87380 16384 16384 10.03 895.69 After
>
> Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
Applied, thank you.
^ permalink raw reply
* Re: [net-next 00/17][pull request] Intel Wired LAN Driver Updates 2014-11-21
From: David Miller @ 2014-11-23 19:22 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, nhorman, sassmann, jogreene
In-Reply-To: <1416635708-4765-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 21 Nov 2014 21:54:50 -0800
> This series contains updates to i40e and i40evf.
As Ben mentioned, patches #13 and #14 at a minimum need to add a NULL
check against 'indir' in the ethtool handlers in question.
^ permalink raw reply
* Re: [PATCH 1/1] fix return code from fib_rules_lookup()
From: David Miller @ 2014-11-23 19:24 UTC (permalink / raw)
To: ani; +Cc: maze, edumazet, netdev, fruggeri
In-Reply-To: <1416637521-20173-1-git-send-email-ani@arista.com>
From: Ani Sinha <ani@arista.com>
Date: Fri, 21 Nov 2014 22:25:21 -0800
> fib_lookup() api returns two different types of error
> codes. When no custom FIB rules are installed and
> lookup fails, it returns ENETUNREACH. However, when
> custom rules are installed, __fib_lookup() calls
> fib_rules_lookup() which returns ESRCH when the rule
> lookup fails. This patch makes both code paths return
> identical error codes under lookup failure.
>
> Signed-off-by: Ani Sinha <ani@arista.com>
How does this relate to the already committed:
commit 49dd18ba4615eaa72f15c9087dea1c2ab4744cf5
Author: Panu Matilainen <pmatilai@redhat.com>
Date: Fri Nov 14 13:14:32 2014 +0200
ipv4: Fix incorrect error code when adding an unreachable route
Trying to add an unreachable route incorrectly returns -ESRCH if
if custom FIB rules are present:
[root@localhost ~]# ip route add 74.125.31.199 dev eth0 via 1.2.3.4
RTNETLINK answers: Network is unreachable
[root@localhost ~]# ip rule add to 55.66.77.88 table 200
[root@localhost ~]# ip route add 74.125.31.199 dev eth0 via 1.2.3.4
RTNETLINK answers: No such process
[root@localhost ~]#
Commit 83886b6b636173b206f475929e58fac75c6f2446 ("[NET]: Change "not found"
return value for rule lookup") changed fib_rules_lookup()
to use -ESRCH as a "not found" code internally, but for user space it
should be translated into -ENETUNREACH. Handle the translation centrally in
ipv4-specific fib_lookup(), leaving the DECnet case alone.
On a related note, commit b7a71b51ee37d919e4098cd961d59a883fd272d8
("ipv4: removed redundant conditional") removed a similar translation from
ip_route_input_slow() prematurely AIUI.
Fixes: b7a71b51ee37 ("ipv4: removed redundant conditional")
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c
index f2e1573..8f7bd56 100644
--- a/net/ipv4/fib_rules.c
+++ b/net/ipv4/fib_rules.c
@@ -62,6 +62,10 @@ int __fib_lookup(struct net *net, struct flowi4 *flp, struct fib_result *res)
else
res->tclassid = 0;
#endif
+
+ if (err == -ESRCH)
+ err = -ENETUNREACH;
+
return err;
}
EXPORT_SYMBOL_GPL(__fib_lookup);
^ permalink raw reply related
* Re: [net 1/3] ixgbe: Correctly disable VLAN filter in promiscuous mode
From: David Miller @ 2014-11-23 19:26 UTC (permalink / raw)
To: jeffrey.t.kirsher
Cc: vyasevich, netdev, nhorman, sassmann, jogreene, stable,
jacob.e.keller, vyasevic
In-Reply-To: <1416642774-17077-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 21 Nov 2014 23:52:52 -0800
> From: Vlad Yasevich <vyasevich@gmail.com>
>
> IXGBE adapter seems to require that VLAN filtering be enabled if
> VMDQ or SRIOV are enabled. When those functions are disabled,
> VLAN filtering may be disabled in promiscuous mode.
>
> Prior to commit a9b8943ee129 ("ixgbe: remove vlan_filter_disable
> and enable functions")
>
> The logic was correct. However, after the commit the logic
> got reversed and VLAN filtered in now turned on when VMDQ/SRIOV
> is disabled.
>
> This patch changes the condition to enable hw vlan filtered
> when VMDQ or SRIOV is enabled.
>
> Fixes: a9b8943ee129 ("ixgbe: remove vlan_filter_disable and enable functions")
> Cc: stable <stable@vger.kernel.org>
> CC: Jacob Keller <jacob.e.keller@intel.com>
> Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
> Acked-by: Emil Tantilov <emil.s.tantilov@intel.com>
> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply
* Re: [net 2/3] ixgbe: fix use after free adapter->state test in ixgbe_remove/ixgbe_probe
From: David Miller @ 2014-11-23 19:27 UTC (permalink / raw)
To: jeffrey.t.kirsher
Cc: dborkman, netdev, nhorman, sassmann, jogreene, stable,
mark.d.rustad
In-Reply-To: <1416642774-17077-2-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 21 Nov 2014 23:52:53 -0800
> From: Daniel Borkmann <dborkman@redhat.com>
>
> While working on a different issue, I noticed an annoying use
> after free bug on my machine when unloading the ixgbe driver:
...
> The issue is that test_and_set_bit() done on adapter->state is being
> performed *after* the netdevice has been freed via free_netdev().
>
> When netdev is being allocated on initialization time, it allocates
> a private area, here struct ixgbe_adapter, that resides after the
> net_device structure. In ixgbe_probe(), the device init routine,
> we set up the adapter after alloc_etherdev_mq() on the private area
> and add a reference for the pci_dev as well via pci_set_drvdata().
>
> Both in the error path of ixgbe_probe(), but also on module unload
> when ixgbe_remove() is being called, commit 41c62843eb6a ("ixgbe:
> Fix rcu warnings induced by LER") accesses adapter after free_netdev().
> The patch stores the result in a bool and thus fixes above oops on my
> side.
>
> Fixes: 41c62843eb6a ("ixgbe: Fix rcu warnings induced by LER")
> Cc: stable <stable@vger.kernel.org>
> Cc: Mark Rustad <mark.d.rustad@intel.com>
> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply
* Re: [net 3/3] igb: Fixes needed for surprise removal support
From: David Miller @ 2014-11-23 19:27 UTC (permalink / raw)
To: jeffrey.t.kirsher
Cc: carolyn.wyborny, netdev, nhorman, sassmann, jogreene,
yanirx.lubetkin
In-Reply-To: <1416642774-17077-3-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 21 Nov 2014 23:52:54 -0800
> From: Carolyn Wyborny <carolyn.wyborny@intel.com>
>
> This patch adds some checks in order to prevent panic's on surprise
> removal of devices during S0, S3, S4. Without this patch, Thunderbolt
> type device removal will panic the system.
>
> Signed-off-by: Yanir Lubetkin <yanirx.lubetkin@intel.com>
> Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
> Tested-by: Aaron Brown <aaron.f.brown@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] ipv6: coding style improvements (remove assignment in if statements)
From: David Miller @ 2014-11-23 19:29 UTC (permalink / raw)
To: ipm; +Cc: netdev
In-Reply-To: <1416657725-7829-1-git-send-email-ipm@chirality.org.uk>
From: Ian Morris <ipm@chirality.org.uk>
Date: Sat, 22 Nov 2014 12:02:05 +0000
> diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
> index 7226697..7d7733a 100644
> --- a/net/ipv6/ip6mr.c
> +++ b/net/ipv6/ip6mr.c
> @@ -2410,8 +2410,7 @@ static int mr6_msgsize(bool unresolved, int maxvif)
> + nla_total_size(0) /* RTA_MULTIPATH */
> + maxvif * NLA_ALIGN(sizeof(struct rtnexthop))
> /* RTA_MFC_STATS */
> - + nla_total_size(sizeof(struct rta_mfc_stats))
> - ;
> + + nla_total_size(sizeof(struct rta_mfc_stats));
>
> return len;
> }
This first of all has absolutely nothing to do with your patch, it is
not eliminating an assignment from an if statement.
Second of all, this layout is absolutely intentional.
It makes it such that when new netlink attributed are added, the
patch to add them to this calculation is minimized to one line.
Therefore, please keep that semicolon on a line all by itself.
^ permalink raw reply
* Re: [PATCH 4/6] solos-pci: fix error return code
From: David Miller @ 2014-11-23 19:30 UTC (permalink / raw)
To: Julia.Lawall
Cc: chas, kernel-janitors, linux-atm-general, netdev, linux-kernel
In-Reply-To: <1416667159-9808-5-git-send-email-Julia.Lawall@lip6.fr>
From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Sat, 22 Nov 2014 15:39:17 +0100
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> Return a negative error code on failure.
>
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)
...
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Applied, thanks Julia.
^ permalink raw reply
* Re: [PATCH 0/6] kernel tinification: optionally compile out splice family of syscalls (splice, vmsplice, tee and sendfile)
From: Josh Triplett @ 2014-11-23 19:43 UTC (permalink / raw)
To: David Miller
Cc: pieter-qeJ+1H9vRZbz+pZb47iToQ,
alexander.h.duyck-ral2JQCrhuEAvxtiuMwx3w,
viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn, ast-uqk4Ao+rVK5Wk0Htik3J/w,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
beber-2YnHqweIUXrk1uMJSBkQmQ,
catalina.mocanu-Re5JQEeQqe8AvxtiuMwx3w,
dborkman-H+wXaHxf7aLQT0dZR+AlfA, edumazet-hpIqsD4AKlfQT0dZR+AlfA,
ebiederm-aS9lmoZGLiVWk0Htik3J/w, fabf-AgBVmzD5pcezQB+pC5nmwQ,
fuse-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
geert-Td1EMuHUCqxL1ZNQvxDV9g, hughd-hpIqsD4AKlfQT0dZR+AlfA,
iulia.manda21-Re5JQEeQqe8AvxtiuMwx3w, JBeulich-IBi9RG/b67k,
bfields-uC3wQj2KruNg9hUCZPvPmw, jlayton-vpEMnDpepFuMZCB2o+C8xQ,
linux-api-u79uwXL29TY76Z2rM5mHXA,
linux-fsdevel-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, mcgrof-IBi9RG/b67k,
mattst88-Re5JQEeQqe8AvxtiuMwx3w, mgorman-l3A5Bk7waGM,
mst-H+wXaHxf7aLQT0dZR+AlfA, miklos-sUDqSbJrdHQHWmgEVkV9KA,
netdev-u79uwXL29TY76Z2rM5mHXA, oleg-H+wXaHxf7aLQT0dZR+AlfA,
Paul.Durrant-Sxgqhf6Nn4DQT0dZR+AlfA,
paulmck-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8,
pefoley2-lY0TAiDIAFlBDgjK7y7TUQ, tgraf-G/eBtMaohhA,
therbert-hpIqsD4AKlfQT0dZR+AlfA, willemb-hpIqsD4AKlfQT0dZR+AlfA,
xiaoguangrong-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8,
zhenglong.cai-TJRtMXcVgQTM1kAEIRd3EQ
In-Reply-To: <20141123.134623.2061031332250984539.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
On Sun, Nov 23, 2014 at 01:46:23PM -0500, David Miller wrote:
> Truly removing sendfile/sendpage means that you can't even compile NFS
> into the tree.
If you mean the in-kernel nfsd (CONFIG_NFSD), that already has a large
stack of "select" and "depends on", both directly and indirectly; adding
a "select SPLICE_SYSCALL" to it seems fine. (That select does need
adding, though. Pieter, you need to test-compile more than just
tinyconfig and defconfig. Try an allyesconfig with *just* splice turned
off, and make sure that compiles.)
Given the requirements of running a file server in the kernel, I'd
expect CONFIG_NFSD to end up with several more selects of optional
functionality in the future. It seems rather likely that the average
embedded system will be compiling out NFS. :)
Also, this patch series compiles out splice and sendfile, including
several *users* of sendpage; it doesn't compile out the sendpage
support/infrastructure itself.
- Josh Triplett
^ permalink raw reply
* [PATCH net-next] enic: use netdev_rss_key_fill() helper
From: Eric Dumazet @ 2014-11-23 20:27 UTC (permalink / raw)
To: David Miller
Cc: Christian Benvenuti, Govindarajulu Varadarajan, netdev,
Sujith Sankar
From: Eric Dumazet <edumazet@google.com>
Use of well known RSS key might increase attack surface.
Switch to a random one, using generic helper so that all
ports share a common key.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Christian Benvenuti <benve@cisco.com>
Cc: Govindarajulu Varadarajan <_govind@gmx.com>
Cc: Sujith Sankar <ssujith@cisco.com>
---
drivers/net/ethernet/cisco/enic/enic_main.c | 24 +++++++++---------
| 9 +++++-
2 files changed, 19 insertions(+), 14 deletions(-)
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
index 46647407d585b54dba0baa5ef357401f17b7c167..86ee350e57f0e03bd79908ade0782d9af99646b4 100644
--- a/drivers/net/ethernet/cisco/enic/enic_main.c
+++ b/drivers/net/ethernet/cisco/enic/enic_main.c
@@ -1890,23 +1890,23 @@ static int enic_dev_hang_reset(struct enic *enic)
static int enic_set_rsskey(struct enic *enic)
{
+ union vnic_rss_key *rss_key_buf_va;
dma_addr_t rss_key_buf_pa;
- union vnic_rss_key *rss_key_buf_va = NULL;
- union vnic_rss_key rss_key = {
- .key[0].b = {85, 67, 83, 97, 119, 101, 115, 111, 109, 101},
- .key[1].b = {80, 65, 76, 79, 117, 110, 105, 113, 117, 101},
- .key[2].b = {76, 73, 78, 85, 88, 114, 111, 99, 107, 115},
- .key[3].b = {69, 78, 73, 67, 105, 115, 99, 111, 111, 108},
- };
- int err;
+ u8 rss_key[ENIC_RSS_LEN];
+ int i, kidx, bidx, err;
- rss_key_buf_va = pci_alloc_consistent(enic->pdev,
- sizeof(union vnic_rss_key), &rss_key_buf_pa);
+ rss_key_buf_va = pci_zalloc_consistent(enic->pdev,
+ sizeof(union vnic_rss_key),
+ &rss_key_buf_pa);
if (!rss_key_buf_va)
return -ENOMEM;
- memcpy(rss_key_buf_va, &rss_key, sizeof(union vnic_rss_key));
-
+ netdev_rss_key_fill(rss_key, ENIC_RSS_LEN);
+ for (i = 0; i < ENIC_RSS_LEN; i++) {
+ kidx = i / ENIC_RSS_BYTES_PER_KEY;
+ bidx = i % ENIC_RSS_BYTES_PER_KEY;
+ rss_key_buf_va->key[kidx].b[bidx] = rss_key[i];
+ }
spin_lock_bh(&enic->devcmd_lock);
err = enic_set_rss_key(enic,
rss_key_buf_pa,
--git a/drivers/net/ethernet/cisco/enic/vnic_rss.h b/drivers/net/ethernet/cisco/enic/vnic_rss.h
index fa421baf45b87eadbf5857843869f1bbcabcdb08..881fa18542b382bc52e222dc4ff47114d052fb00 100644
--- a/drivers/net/ethernet/cisco/enic/vnic_rss.h
+++ b/drivers/net/ethernet/cisco/enic/vnic_rss.h
@@ -20,11 +20,16 @@
#define _VNIC_RSS_H_
/* RSS key array */
+
+#define ENIC_RSS_BYTES_PER_KEY 10
+#define ENIC_RSS_KEYS 4
+#define ENIC_RSS_LEN (ENIC_RSS_BYTES_PER_KEY * ENIC_RSS_KEYS)
+
union vnic_rss_key {
struct {
- u8 b[10];
+ u8 b[ENIC_RSS_BYTES_PER_KEY];
u8 b_pad[6];
- } key[4];
+ } key[ENIC_RSS_KEYS];
u64 raw[8];
};
^ permalink raw reply related
* Re: [PATCH net-net 0/4] Increase the limit of tuntap queues
From: Michael S. Tsirkin @ 2014-11-23 20:30 UTC (permalink / raw)
To: David Miller
Cc: pagupta, linux-kernel, netdev, jasowang, dgibson, vfalico,
edumazet, vyasevic, hkchu, wuzhy, xemul, therbert, bhutchings,
xii, stephen, jiri, sergei.shtylyov
In-Reply-To: <20141123.134323.1154795102254868842.davem@davemloft.net>
On Sun, Nov 23, 2014 at 01:43:23PM -0500, David Miller wrote:
> From: "Michael S. Tsirkin" <mst@redhat.com>
> Date: Sun, 23 Nov 2014 12:46:23 +0200
>
> > At the moment attaching/detaching queues is an unpriveledged operation.
> >
> > Shouldn't we worry that an application can cause large
> > allocations, and provide a way to limit these?
> >
> > David, could you comment on this please?
>
> I don't want arbitrary limits imposed.
>
> Where does this "application" run? If it's in the host, then who
> cares? If they suck up all of their available memory with queue
> resources, it's their problem.
qemu runs in the host, but it's unpriveledged: it gets
passed tun FDs by a priveledged daemon, and it only
has the rights to some operations,
in particular to attach and detach queues.
The assumption always was that this operation is safe
and can't make kernel run out of resources.
--
MST
^ permalink raw reply
* Re: [PATCH 0/6] kernel tinification: optionally compile out splice family of syscalls (splice, vmsplice, tee and sendfile)
From: Pieter Smith @ 2014-11-23 20:30 UTC (permalink / raw)
To: Josh Triplett
Cc: David Miller, alexander.h.duyck, viro, ast, akpm, beber,
catalina.mocanu, dborkman, edumazet, ebiederm, fabf, fuse-devel,
geert, hughd, iulia.manda21, JBeulich, bfields, jlayton,
linux-api, linux-fsdevel, linux-kernel, mcgrof, mattst88, mgorman,
mst, miklos, netdev, oleg, Paul.Durrant, paulmck, pefoley2, tgraf,
therbert, willemb, xiaoguangrong, zhenglong.cai
In-Reply-To: <20141123194326.GB8517@thin>
On Sun, Nov 23, 2014 at 11:43:26AM -0800, Josh Triplett wrote:
> On Sun, Nov 23, 2014 at 01:46:23PM -0500, David Miller wrote:
> > Truly removing sendfile/sendpage means that you can't even compile NFS
> > into the tree.
>
> If you mean the in-kernel nfsd (CONFIG_NFSD), that already has a large
> stack of "select" and "depends on", both directly and indirectly; adding
> a "select SPLICE_SYSCALL" to it seems fine. (That select does need
> adding, though. Pieter, you need to test-compile more than just
> tinyconfig and defconfig. Try an allyesconfig with *just* splice turned
> off, and make sure that compiles.)
Did exacly that. Took forever on my hardware, but no problems.
> Given the requirements of running a file server in the kernel, I'd
> expect CONFIG_NFSD to end up with several more selects of optional
> functionality in the future. It seems rather likely that the average
> embedded system will be compiling out NFS. :)
>
> Also, this patch series compiles out splice and sendfile, including
> several *users* of sendpage; it doesn't compile out the sendpage
> support/infrastructure itself.
>
> - Josh Triplett
^ permalink raw reply
* Re: [PATCH net-next] mlx4: fix mlx4_en_set_rxfh()
From: Joe Perches @ 2014-11-23 20:56 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Amir Vadai, Ben Hutchings, David S. Miller, netdev
In-Reply-To: <1416762320.17888.21.camel@edumazet-glaptop2.roam.corp.google.com>
On Sun, 2014-11-23 at 09:05 -0800, Eric Dumazet wrote:
> On Sun, 2014-11-23 at 18:53 +0200, Amir Vadai wrote:
> > > */
> > > for (i = 0; i < priv->rx_ring_num; i++) {
> > > + if (!ring_index)
> > > + continue;
> >
> > Why didn't you put the whole loop under the 'if'?
>
> To avoid adding one indentation on the block, and ease this code review.
>
> This is hardly fast path, and compiler does the optim for us anyway.
It might have been more sensible
to use break instead of continue
^ permalink raw reply
* [PATCH net-next v2] ipv6: coding style improvements (remove assignment in if statements)
From: Ian Morris @ 2014-11-23 21:28 UTC (permalink / raw)
To: netdev; +Cc: Ian Morris
This change has no functional impact and simply addresses some coding
style issues detected by checkpatch. Specifically this change
adjusts "if" statements which also include the assignment of a
variable.
No changes to the resultant object files result as determined by objdiff.
Signed-off-by: Ian Morris <ipm@chirality.org.uk>
---
net/ipv6/addrconf.c | 12 ++++++++----
net/ipv6/ah6.c | 7 ++++---
net/ipv6/esp6.c | 3 ++-
net/ipv6/icmp.c | 3 ++-
net/ipv6/ip6_flowlabel.c | 6 +++++-
net/ipv6/ip6_input.c | 3 ++-
net/ipv6/ip6_output.c | 12 ++++++++----
net/ipv6/ip6_tunnel.c | 15 ++++++++-------
net/ipv6/ip6_vti.c | 4 ++--
net/ipv6/ndisc.c | 7 ++++---
net/ipv6/reassembly.c | 3 ++-
net/ipv6/sit.c | 7 ++++---
net/ipv6/udp.c | 6 ++++--
13 files changed, 55 insertions(+), 33 deletions(-)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 251fcb4..9eac3a7 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -2543,7 +2543,8 @@ static int inet6_addr_del(struct net *net, int ifindex, u32 ifa_flags,
if (!dev)
return -ENODEV;
- if ((idev = __in6_dev_get(dev)) == NULL)
+ idev = __in6_dev_get(dev);
+ if (idev == NULL)
return -ENXIO;
read_lock_bh(&idev->lock);
@@ -2690,7 +2691,8 @@ static void init_loopback(struct net_device *dev)
ASSERT_RTNL();
- if ((idev = ipv6_find_idev(dev)) == NULL) {
+ idev = ipv6_find_idev(dev);
+ if (idev == NULL) {
pr_debug("%s: add_dev failed\n", __func__);
return;
}
@@ -2813,7 +2815,8 @@ static void addrconf_sit_config(struct net_device *dev)
* our v4 addrs in the tunnel
*/
- if ((idev = ipv6_find_idev(dev)) == NULL) {
+ idev = ipv6_find_idev(dev);
+ if (idev == NULL) {
pr_debug("%s: add_dev failed\n", __func__);
return;
}
@@ -2837,7 +2840,8 @@ static void addrconf_gre_config(struct net_device *dev)
ASSERT_RTNL();
- if ((idev = ipv6_find_idev(dev)) == NULL) {
+ idev = ipv6_find_idev(dev);
+ if (idev == NULL) {
pr_debug("%s: add_dev failed\n", __func__);
return;
}
diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c
index 8ab1989..a6727ad 100644
--- a/net/ipv6/ah6.c
+++ b/net/ipv6/ah6.c
@@ -353,7 +353,8 @@ static int ah6_output(struct xfrm_state *x, struct sk_buff *skb)
ahp = x->data;
ahash = ahp->ahash;
- if ((err = skb_cow_data(skb, 0, &trailer)) < 0)
+ err = skb_cow_data(skb, 0, &trailer);
+ if (err < 0)
goto out;
nfrags = err;
@@ -559,8 +560,8 @@ static int ah6_input(struct xfrm_state *x, struct sk_buff *skb)
if (!pskb_may_pull(skb, ah_hlen))
goto out;
-
- if ((err = skb_cow_data(skb, 0, &trailer)) < 0)
+ err = skb_cow_data(skb, 0, &trailer);
+ if (err < 0)
goto out;
nfrags = err;
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index d2c2d74..e48f2c7 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -345,7 +345,8 @@ static int esp6_input(struct xfrm_state *x, struct sk_buff *skb)
goto out;
}
- if ((nfrags = skb_cow_data(skb, 0, &trailer)) < 0) {
+ nfrags = skb_cow_data(skb, 0, &trailer);
+ if (nfrags < 0) {
ret = -EINVAL;
goto out;
}
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 39b3ff9..d674152 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -243,7 +243,8 @@ int icmpv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6,
struct icmp6hdr *icmp6h;
int err = 0;
- if ((skb = skb_peek(&sk->sk_write_queue)) == NULL)
+ skb = skb_peek(&sk->sk_write_queue);
+ if (skb == NULL)
goto out;
icmp6h = icmp6_hdr(skb);
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
index 7221021..2f780cb 100644
--- a/net/ipv6/ip6_flowlabel.c
+++ b/net/ipv6/ip6_flowlabel.c
@@ -654,7 +654,11 @@ release:
goto done;
err = -ENOMEM;
- if (sfl1 == NULL || (err = mem_check(sk)) != 0)
+ if (sfl1 == NULL)
+ goto done;
+
+ err = mem_check(sk);
+ if (err != 0)
goto done;
fl1 = fl_intern(net, fl, freq.flr_label);
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
index a3084ab..aacdcb4 100644
--- a/net/ipv6/ip6_input.c
+++ b/net/ipv6/ip6_input.c
@@ -220,7 +220,8 @@ resubmit:
nexthdr = skb_network_header(skb)[nhoff];
raw = raw6_local_deliver(skb, nexthdr);
- if ((ipprot = rcu_dereference(inet6_protos[nexthdr])) != NULL) {
+ ipprot = rcu_dereference(inet6_protos[nexthdr]);
+ if (ipprot != NULL) {
int ret;
if (ipprot->flags & INET6_PROTO_FINAL) {
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 916d2a1..ce69a12 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -898,7 +898,8 @@ static int ip6_dst_lookup_tail(struct sock *sk,
if (*dst == NULL)
*dst = ip6_route_output(net, sk, fl6);
- if ((err = (*dst)->error))
+ err = (*dst)->error;
+ if (err)
goto out_err_release;
if (ipv6_addr_any(&fl6->saddr)) {
@@ -946,7 +947,8 @@ static int ip6_dst_lookup_tail(struct sock *sk,
memcpy(&fl_gw6, fl6, sizeof(struct flowi6));
memset(&fl_gw6.daddr, 0, sizeof(struct in6_addr));
*dst = ip6_route_output(net, sk, &fl_gw6);
- if ((err = (*dst)->error))
+ err = (*dst)->error;
+ if (err)
goto out_err_release;
}
}
@@ -1054,7 +1056,8 @@ static inline int ip6_ufo_append_data(struct sock *sk,
* device, so create one single skb packet containing complete
* udp datagram
*/
- if ((skb = skb_peek_tail(&sk->sk_write_queue)) == NULL) {
+ skb = skb_peek_tail(&sk->sk_write_queue);
+ if (skb == NULL) {
skb = sock_alloc_send_skb(sk,
hh_len + fragheaderlen + transhdrlen + 20,
(flags & MSG_DONTWAIT), &err);
@@ -1534,7 +1537,8 @@ int ip6_push_pending_frames(struct sock *sk)
unsigned char proto = fl6->flowi6_proto;
int err = 0;
- if ((skb = __skb_dequeue(&sk->sk_write_queue)) == NULL)
+ skb = __skb_dequeue(&sk->sk_write_queue);
+ if (skb == NULL)
goto out;
tail_skb = &(skb_shinfo(skb)->frag_list);
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index e2b6cfb..92b3da5 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -501,8 +501,8 @@ ip6_tnl_err(struct sk_buff *skb, __u8 ipproto, struct inet6_skb_parm *opt,
processing of the error. */
rcu_read_lock();
- if ((t = ip6_tnl_lookup(dev_net(skb->dev), &ipv6h->daddr,
- &ipv6h->saddr)) == NULL)
+ t = ip6_tnl_lookup(dev_net(skb->dev), &ipv6h->daddr, &ipv6h->saddr);
+ if (t == NULL)
goto out;
tproto = ACCESS_ONCE(t->parms.proto);
@@ -550,7 +550,8 @@ ip6_tnl_err(struct sk_buff *skb, __u8 ipproto, struct inet6_skb_parm *opt,
mtu = IPV6_MIN_MTU;
t->dev->mtu = mtu;
- if ((len = sizeof(*ipv6h) + ntohs(ipv6h->payload_len)) > mtu) {
+ len = sizeof(*ipv6h) + ntohs(ipv6h->payload_len);
+ if (len > mtu) {
rel_type = ICMPV6_PKT_TOOBIG;
rel_code = 0;
rel_info = mtu;
@@ -811,9 +812,8 @@ static int ip6_tnl_rcv(struct sk_buff *skb, __u16 protocol,
int err;
rcu_read_lock();
-
- if ((t = ip6_tnl_lookup(dev_net(skb->dev), &ipv6h->saddr,
- &ipv6h->daddr)) != NULL) {
+ t = ip6_tnl_lookup(dev_net(skb->dev), &ipv6h->saddr, &ipv6h->daddr);
+ if (t != NULL) {
struct pcpu_sw_netstats *tstats;
tproto = ACCESS_ONCE(t->parms.proto);
@@ -1069,7 +1069,8 @@ static int ip6_tnl_xmit2(struct sk_buff *skb,
(skb_cloned(skb) && !skb_clone_writable(skb, 0))) {
struct sk_buff *new_skb;
- if (!(new_skb = skb_realloc_headroom(skb, max_headroom)))
+ new_skb = skb_realloc_headroom(skb, max_headroom);
+ if (!new_skb)
goto tx_err_dst_release;
if (skb->sk)
diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c
index ec84d03..8308216 100644
--- a/net/ipv6/ip6_vti.c
+++ b/net/ipv6/ip6_vti.c
@@ -287,8 +287,8 @@ static int vti6_rcv(struct sk_buff *skb)
const struct ipv6hdr *ipv6h = ipv6_hdr(skb);
rcu_read_lock();
- if ((t = vti6_tnl_lookup(dev_net(skb->dev), &ipv6h->saddr,
- &ipv6h->daddr)) != NULL) {
+ t = vti6_tnl_lookup(dev_net(skb->dev), &ipv6h->saddr, &ipv6h->daddr);
+ if (t != NULL) {
if (t->parms.proto != IPPROTO_IPV6 && t->parms.proto != 0) {
rcu_read_unlock();
goto discard;
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 2c9f6bf..6828667 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -162,7 +162,8 @@ static void ndisc_fill_addr_option(struct sk_buff *skb, int type, void *data)
memcpy(opt+2, data, data_len);
data_len += 2;
opt += data_len;
- if ((space -= data_len) > 0)
+ space -= data_len;
+ if (space > 0)
memset(opt, 0, space);
}
@@ -656,8 +657,8 @@ static void ndisc_solicit(struct neighbour *neigh, struct sk_buff *skb)
if (skb && ipv6_chk_addr(dev_net(dev), &ipv6_hdr(skb)->saddr, dev, 1))
saddr = &ipv6_hdr(skb)->saddr;
-
- if ((probes -= NEIGH_VAR(neigh->parms, UCAST_PROBES)) < 0) {
+ probes -= NEIGH_VAR(neigh->parms, UCAST_PROBES);
+ if (probes < 0) {
if (!(neigh->nud_state & NUD_VALID)) {
ND_PRINTK(1, dbg,
"%s: trying to ucast probe in NUD_INVALID: %pI6\n",
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 51ab096..d7d70e6 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -429,7 +429,8 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev,
struct sk_buff *clone;
int i, plen = 0;
- if ((clone = alloc_skb(0, GFP_ATOMIC)) == NULL)
+ clone = alloc_skb(0, GFP_ATOMIC);
+ if (clone == NULL)
goto out_oom;
clone->next = head->next;
head->next = clone;
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 660496d..213546b 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -1241,7 +1241,8 @@ ipip6_tunnel_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof(p)))
goto done;
err = -ENOENT;
- if ((t = ipip6_tunnel_locate(net, &p, 0)) == NULL)
+ t = ipip6_tunnel_locate(net, &p, 0);
+ if (t == NULL)
goto done;
err = -EPERM;
if (t == netdev_priv(sitn->fb_tunnel_dev))
@@ -1836,8 +1837,8 @@ static int __net_init sit_init_net(struct net *net)
goto err_dev_free;
ipip6_tunnel_clone_6rd(sitn->fb_tunnel_dev, sitn);
-
- if ((err = register_netdev(sitn->fb_tunnel_dev)))
+ err = register_netdev(sitn->fb_tunnel_dev);
+ if (err)
goto err_reg_dev;
t = netdev_priv(sitn->fb_tunnel_dev);
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 0ba3de4..dbc0b04 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -357,7 +357,8 @@ static struct sock *__udp6_lib_lookup_skb(struct sk_buff *skb,
struct sock *sk;
const struct ipv6hdr *iph = ipv6_hdr(skb);
- if (unlikely(sk = skb_steal_sock(skb)))
+ sk = skb_steal_sock(skb);
+ if (unlikely(sk))
return sk;
return __udp6_lib_lookup(dev_net(skb_dst(skb)->dev), &iph->saddr, sport,
&iph->daddr, dport, inet6_iif(skb),
@@ -1026,7 +1027,8 @@ static int udp_v6_push_pending_frames(struct sock *sk)
fl6 = &inet->cork.fl.u.ip6;
/* Grab the skbuff where UDP header space exists. */
- if ((skb = skb_peek(&sk->sk_write_queue)) == NULL)
+ skb = skb_peek(&sk->sk_write_queue);
+ if (skb == NULL)
goto out;
/*
--
1.9.1
^ permalink raw reply related
* Personal
From: Patrick McSweeney @ 2014-11-23 21:31 UTC (permalink / raw)
--
I have a proposal with mutual benefit for you, contact me for more
information.
Regards
Patrick
^ permalink raw reply
* Re: [PATCH net-next v2] ipv6: coding style improvements (remove assignment in if statements)
From: Joe Perches @ 2014-11-23 21:50 UTC (permalink / raw)
To: Ian Morris; +Cc: netdev
In-Reply-To: <1416778123-5803-1-git-send-email-ipm@chirality.org.uk>
On Sun, 2014-11-23 at 21:28 +0000, Ian Morris wrote:
> This change has no functional impact and simply addresses some coding
> style issues detected by checkpatch. Specifically this change
> adjusts "if" statements which also include the assignment of a
> variable.
Unrelated trivia:
> net/ipv6/addrconf.c | 12 ++++++++----
[]
> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
[]
> @@ -2690,7 +2691,8 @@ static void init_loopback(struct net_device *dev)
>
> ASSERT_RTNL();
>
> - if ((idev = ipv6_find_idev(dev)) == NULL) {
> + idev = ipv6_find_idev(dev);
> + if (idev == NULL) {
> pr_debug("%s: add_dev failed\n", __func__);
> return;
> }
> @@ -2813,7 +2815,8 @@ static void addrconf_sit_config(struct net_device *dev)
> * our v4 addrs in the tunnel
> */
>
> - if ((idev = ipv6_find_idev(dev)) == NULL) {
> + idev = ipv6_find_idev(dev);
> + if (idev == NULL) {
> pr_debug("%s: add_dev failed\n", __func__);
> return;
> }
> @@ -2837,7 +2840,8 @@ static void addrconf_gre_config(struct net_device *dev)
>
> ASSERT_RTNL();
>
> - if ((idev = ipv6_find_idev(dev)) == NULL) {
> + idev = ipv6_find_idev(dev);
> + if (idev == NULL) {
> pr_debug("%s: add_dev failed\n", __func__);
> return;
> }
It looks like these should not be "add_dev failed"
but "ipv6_find_idev failed"
^ permalink raw reply
* Re: [fuse-devel] [PATCH 4/6] fs/fuse: support compiling out splice
From: Richard Weinberger @ 2014-11-23 22:29 UTC (permalink / raw)
To: Pieter Smith
Cc: Michael S. Tsirkin, Bertrand Jacquin, Oleg Nesterov,
J. Bruce Fields, Eric Dumazet, 蔡正龙,
Jeff Layton, Tom Herbert, Alexei Starovoitov, Miklos Szeredi,
Peter Foley, Hugh Dickins, Xiao Guangrong, Geert Uytterhoeven,
Mel Gorman, Matt Turner, Paul E. McKenney, Alexander Duyck,
open list:FUSE: FILESYSTEM..., Luis R. Rodriguez, Josh Triplett
In-Reply-To: <1416752468-1626-5-git-send-email-pieter-qeJ+1H9vRZbz+pZb47iToQ@public.gmane.org>
On Sun, Nov 23, 2014 at 3:20 PM, Pieter Smith <pieter-qeJ+1H9vRZbz+pZb47iToQ@public.gmane.org> wrote:
> To implement splice support, fs/fuse makes use of nosteal_pipe_buf_ops. This
> struct is exported by fs/splice. The goal of the larger patch set is to
> completely compile out fs/splice, so uses of the exported struct need to be
> compiled out along with fs/splice.
>
> This patch therefore compiles out splice support in fs/fuse when
> CONFIG_SYSCALL_SPLICE is undefined.
>
> Signed-off-by: Pieter Smith <pieter-qeJ+1H9vRZbz+pZb47iToQ@public.gmane.org>
> ---
> fs/fuse/dev.c | 4 ++--
> include/linux/fs.h | 6 ++++++
> 2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
> index ca88731..f8f92a4 100644
> --- a/fs/fuse/dev.c
> +++ b/fs/fuse/dev.c
> @@ -1291,7 +1291,7 @@ static ssize_t fuse_dev_read(struct kiocb *iocb, const struct iovec *iov,
> return fuse_dev_do_read(fc, file, &cs, iov_length(iov, nr_segs));
> }
>
> -static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos,
> +static ssize_t __maybe_unused fuse_dev_splice_read(struct file *in, loff_t *ppos,
> struct pipe_inode_info *pipe,
> size_t len, unsigned int flags)
> {
> @@ -2144,7 +2144,7 @@ const struct file_operations fuse_dev_operations = {
> .llseek = no_llseek,
> .read = do_sync_read,
> .aio_read = fuse_dev_read,
> - .splice_read = fuse_dev_splice_read,
> + .splice_read = __splice_p(fuse_dev_splice_read),
> .write = do_sync_write,
> .aio_write = fuse_dev_write,
> .splice_write = fuse_dev_splice_write,
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index a957d43..04c0975 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -2443,6 +2443,12 @@ extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end,
> int datasync);
> extern void block_sync_page(struct page *page);
>
> +#ifdef CONFIG_SYSCALL_SPLICE
> +#define __splice_p(x) x
> +#else
> +#define __splice_p(x) NULL
> +#endif
> +
This needs to go into a different patch.
One logical change per patch please. :-)
--
Thanks,
//richard
^ permalink raw reply
* Re: [fuse-devel] [PATCH 4/6] fs/fuse: support compiling out splice
From: Josh Triplett @ 2014-11-23 23:23 UTC (permalink / raw)
To: Richard Weinberger
Cc: Pieter Smith, Michael S. Tsirkin, Bertrand Jacquin, Oleg Nesterov,
J. Bruce Fields, Eric Dumazet, 蔡正龙,
Jeff Layton, Tom Herbert, Alexei Starovoitov, Miklos Szeredi,
Peter Foley, Hugh Dickins, Xiao Guangrong, Geert Uytterhoeven,
Mel Gorman, Matt Turner, Paul E. McKenney, Alexander Duyck,
open list:FUSE: FILESYSTEM..., Luis R. Rodriguez
In-Reply-To: <CAFLxGvxq3Mr9n8xMO_fPZDhrGmBh=WKyU0+RF13JBdjssX6qfw@mail.gmail.com>
On Sun, Nov 23, 2014 at 11:29:08PM +0100, Richard Weinberger wrote:
> On Sun, Nov 23, 2014 at 3:20 PM, Pieter Smith <pieter@boesman.nl> wrote:
> > To implement splice support, fs/fuse makes use of nosteal_pipe_buf_ops. This
> > struct is exported by fs/splice. The goal of the larger patch set is to
> > completely compile out fs/splice, so uses of the exported struct need to be
> > compiled out along with fs/splice.
> >
> > This patch therefore compiles out splice support in fs/fuse when
> > CONFIG_SYSCALL_SPLICE is undefined.
> >
> > Signed-off-by: Pieter Smith <pieter@boesman.nl>
> > ---
> > fs/fuse/dev.c | 4 ++--
> > include/linux/fs.h | 6 ++++++
> > 2 files changed, 8 insertions(+), 2 deletions(-)
> >
> > diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
> > index ca88731..f8f92a4 100644
> > --- a/fs/fuse/dev.c
> > +++ b/fs/fuse/dev.c
> > @@ -1291,7 +1291,7 @@ static ssize_t fuse_dev_read(struct kiocb *iocb, const struct iovec *iov,
> > return fuse_dev_do_read(fc, file, &cs, iov_length(iov, nr_segs));
> > }
> >
> > -static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos,
> > +static ssize_t __maybe_unused fuse_dev_splice_read(struct file *in, loff_t *ppos,
> > struct pipe_inode_info *pipe,
> > size_t len, unsigned int flags)
> > {
> > @@ -2144,7 +2144,7 @@ const struct file_operations fuse_dev_operations = {
> > .llseek = no_llseek,
> > .read = do_sync_read,
> > .aio_read = fuse_dev_read,
> > - .splice_read = fuse_dev_splice_read,
> > + .splice_read = __splice_p(fuse_dev_splice_read),
> > .write = do_sync_write,
> > .aio_write = fuse_dev_write,
> > .splice_write = fuse_dev_splice_write,
> > diff --git a/include/linux/fs.h b/include/linux/fs.h
> > index a957d43..04c0975 100644
> > --- a/include/linux/fs.h
> > +++ b/include/linux/fs.h
> > @@ -2443,6 +2443,12 @@ extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end,
> > int datasync);
> > extern void block_sync_page(struct page *page);
> >
> > +#ifdef CONFIG_SYSCALL_SPLICE
> > +#define __splice_p(x) x
> > +#else
> > +#define __splice_p(x) NULL
> > +#endif
> > +
>
> This needs to go into a different patch.
> One logical change per patch please. :-)
Easy enough to merge this one into the patch introducing
CONFIG_SYSCALL_SPLICE, then.
- Josh Triplett
^ permalink raw reply
* Re: [PATCH 06/17] switch macvtap to ->read_iter()
From: Ben Hutchings @ 2014-11-23 23:29 UTC (permalink / raw)
To: Al Viro
Cc: David Miller, torvalds, netdev, linux-kernel, target-devel, nab,
hch
In-Reply-To: <20141122043230.GF30478@ZenIV.linux.org.uk>
[-- Attachment #1: Type: text/plain, Size: 1533 bytes --]
On Sat, 2014-11-22 at 04:32 +0000, Al Viro wrote:
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> ---
> drivers/net/macvtap.c | 39 ++++++++++++++++-----------------------
> 1 file changed, 16 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
> index cea99d4..cdd820f 100644
> --- a/drivers/net/macvtap.c
> +++ b/drivers/net/macvtap.c
> @@ -829,16 +829,17 @@ done:
> }
>
> static ssize_t macvtap_do_read(struct macvtap_queue *q,
> - const struct iovec *iv, unsigned long segs,
> - unsigned long len,
> + struct iov_iter *to,
> int noblock)
> {
> DEFINE_WAIT(wait);
> struct sk_buff *skb;
> ssize_t ret = 0;
> - struct iov_iter iter;
>
> - while (len) {
> + if (!iov_iter_count(to))
> + return 0;
> +
> + while (1) {
> if (!noblock)
> prepare_to_wait(sk_sleep(&q->sk), &wait,
> TASK_INTERRUPTIBLE);
> @@ -856,37 +857,27 @@ static ssize_t macvtap_do_read(struct macvtap_queue *q,
> }
> /* Nothing to read, let's sleep */
> schedule();
> - continue;
> }
> - iov_iter_init(&iter, READ, iv, segs, len);
> - ret = macvtap_put_user(q, skb, &iter);
> + }
> + if (skb) {
> + ret = macvtap_put_user(q, skb, to);
> kfree_skb(skb);
> - break;
[...]
You need to leave this break at the bottom of the loop body, or change
it to:
do {
...
} while (!skb);
Ben.
--
Ben Hutchings
Never put off till tomorrow what you can avoid all together.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]
^ permalink raw reply
* Re: [PATCH 0/6] kernel tinification: optionally compile out splice family of syscalls (splice, vmsplice, tee and sendfile)
From: Josh Triplett @ 2014-11-23 23:36 UTC (permalink / raw)
To: Pieter Smith
Cc: David Miller, alexander.h.duyck-ral2JQCrhuEAvxtiuMwx3w,
viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn, ast-uqk4Ao+rVK5Wk0Htik3J/w,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
beber-2YnHqweIUXrk1uMJSBkQmQ,
catalina.mocanu-Re5JQEeQqe8AvxtiuMwx3w,
dborkman-H+wXaHxf7aLQT0dZR+AlfA, edumazet-hpIqsD4AKlfQT0dZR+AlfA,
ebiederm-aS9lmoZGLiVWk0Htik3J/w, fabf-AgBVmzD5pcezQB+pC5nmwQ,
fuse-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
geert-Td1EMuHUCqxL1ZNQvxDV9g, hughd-hpIqsD4AKlfQT0dZR+AlfA,
iulia.manda21-Re5JQEeQqe8AvxtiuMwx3w, JBeulich-IBi9RG/b67k,
bfields-uC3wQj2KruNg9hUCZPvPmw, jlayton-vpEMnDpepFuMZCB2o+C8xQ,
linux-api-u79uwXL29TY76Z2rM5mHXA,
linux-fsdevel-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, mcgrof-IBi9RG/b67k,
mattst88-Re5JQEeQqe8AvxtiuMwx3w, mgorman-l3A5Bk7waGM,
mst-H+wXaHxf7aLQT0dZR+AlfA, miklos-sUDqSbJrdHQHWmgEVkV9KA,
netdev-u79uwXL29TY76Z2rM5mHXA, oleg-H+wXaHxf7aLQT0dZR+AlfA,
Paul.Durrant-Sxgqhf6Nn4DQT0dZR+AlfA,
paulmck-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8,
pefoley2-lY0TAiDIAFlBDgjK7y7TUQ, tgraf-G/eBtMaohhA,
therbert-hpIqsD4AKlfQT0dZR+AlfA, willemb-hpIqsD4AKlfQT0dZR+AlfA,
xiaoguangrong-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8,
zhenglong.cai-TJRtMXcVgQTM1kAEIRd3EQ
In-Reply-To: <20141123203040.GB26749@smipidev>
On Sun, Nov 23, 2014 at 09:30:40PM +0100, Pieter Smith wrote:
> On Sun, Nov 23, 2014 at 11:43:26AM -0800, Josh Triplett wrote:
> > On Sun, Nov 23, 2014 at 01:46:23PM -0500, David Miller wrote:
> > > Truly removing sendfile/sendpage means that you can't even compile NFS
> > > into the tree.
> >
> > If you mean the in-kernel nfsd (CONFIG_NFSD), that already has a large
> > stack of "select" and "depends on", both directly and indirectly; adding
> > a "select SPLICE_SYSCALL" to it seems fine. (That select does need
> > adding, though. Pieter, you need to test-compile more than just
> > tinyconfig and defconfig. Try an allyesconfig with *just* splice turned
> > off, and make sure that compiles.)
>
> Did exacly that. Took forever on my hardware, but no problems.
Ah, I see. Looking more closely at nfsd, it looks like it already has a
code path for filesystems that don't do splice. I think, rather than
making nfsd select SPLICE_SYSCALL, that it would suffice to change the
"rqstp->rq_splice_ok = true;" in svc_process_common (net/sunrpc/svc.c)
to:
rqstp->rq_splice_ok = IS_ENABLED(CONFIG_SPLICE_SYSCALL);
Then nfsd should simply *always* fall back to its non-splice support.
That said, given that it seems exceedingly unlikely that anyone would
use the in-kernel nfsd on a system trying to minimize kernel size, it
still seems cleaner to just "select SPLICE_SYSCALL" from NFSD in
Kconfig. That avoids making any changes at all to the nfsd source in
this patch series.
- Josh Triplett
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox