* Re: [PATCH v2] ipv6: fix inconsistent prefix route handling
From: Steven Barth @ 2014-02-17 6:41 UTC (permalink / raw)
To: netdev; +Cc: Hannes Frederic Sowa
In-Reply-To: <20140216165128.GF8634@order.stressinduktion.org>
Hannes Frederic Sowa wrote:
> This could too easily clean up valid on-link information if the address
> just happens to be in the same subnet. Would (ifp-flags &
> (IFA_F_PERMANENET|IFA_F_TEMPORARY) && !(...)) solve the problem, too?
No, that doesn't do the trick unfortunately. Seems that the
(non-permanent) address created by "ip" don't have IFA_F_TEMPORARY set.
Any other good ideas?
Cheers,
Steven
^ permalink raw reply
* Re: [PATCH net-next v2 3/3] sch_netem: replace magic numbers with enumerate in GE model
From: Yang Yingliang @ 2014-02-17 6:38 UTC (permalink / raw)
To: Ben Hutchings; +Cc: netdev, davem, stephen
In-Reply-To: <1392554670.15615.93.camel@deadeye.wl.decadent.org.uk>
On 2014/2/16 20:44, Ben Hutchings wrote:
> On Fri, 2014-02-14 at 10:30 +0800, Yang Yingliang wrote:
>> Replace some magic numbers which describe states of GE model
>> loss generator with enumerate.
> [...]
>
> The name GOOD_STATE should also be used in get_loss_clg() where
> clgstate::state is initialised.
>
> Ben.
>
OK, thanks!
Regards,
Yang
^ permalink raw reply
* Re: [PATCH net 0/3] pf_packet fix
From: David Miller @ 2014-02-17 5:49 UTC (permalink / raw)
To: dborkman; +Cc: brouer, mathias.kretschmer, netdev
In-Reply-To: <1392562522-15585-1-git-send-email-dborkman@redhat.com>
From: Daniel Borkmann <dborkman@redhat.com>
Date: Sun, 16 Feb 2014 15:55:19 +0100
> Addressed all feedback from Dave and reworked the original patch
> from [1]. Set is intended for 3.14.
Looks great, series applied, thanks Daniel.
^ permalink raw reply
* Re: [PATCH 10/13] staging: r8188eu: Remove wrapper _enter_critical_mutex()
From: Larry Finger @ 2014-02-17 5:35 UTC (permalink / raw)
To: Greg KH; +Cc: devel, netdev
In-Reply-To: <20140215204112.GA14963@kroah.com>
On 02/15/2014 02:41 PM, Greg KH wrote:
> On Sat, Feb 15, 2014 at 12:38:11PM -0800, Greg KH wrote:
>> I've applied this series up to here.
>
> Nevermind, the others applied, so I've merged them, just not this patch.
I have split this patch into two parts that I will send tomorrow. The first one
just replaces the wrapper. The second uses the returned value to report any
errors that occur, a step that original code skipped.
Larry
^ permalink raw reply
* Re: [PATCH v3] net:cpsw: Pass unhandled ioctl's on to generic phy ioctl
From: David Miller @ 2014-02-17 5:30 UTC (permalink / raw)
To: stefan.sorensen; +Cc: mugunthanvnm, netdev
In-Reply-To: <1392558865-18388-1-git-send-email-stefan.sorensen@spectralink.com>
From: Stefan Sørensen <stefan.sorensen@spectralink.com>
Date: Sun, 16 Feb 2014 14:54:25 +0100
> This patch allows the use of a generic timestamping phy connected
> to the cpsw if CPTS support is not enabled. This also adds support
> of the SIOCGMIIREG and SIOCSMIIREG, and moves handling of SIOCGMIIPHY
> to the generic driver.
>
> Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
Applied to net-next, thanks.
^ permalink raw reply
* Re: [PATCH net-next 0/4] bonding cleaning
From: David Miller @ 2014-02-17 5:29 UTC (permalink / raw)
To: joe; +Cc: netdev, linux-kernel
In-Reply-To: <cover.1392508410.git.joe@perches.com>
From: Joe Perches <joe@perches.com>
Date: Sat, 15 Feb 2014 15:57:03 -0800
> Miscellaneous cleanups
>
> Joe Perches (4):
> bonding: Convert pr_warning to pr_warn, neatening
> bonding: Neaten pr_<level>
> bonding: Convert c99 comments
> bonding: Convert memcpy(foo, bar, ETH_ALEN) to ether_addr_copy(foo, bar)
Series applied, thanks.
^ permalink raw reply
* Re: [PATCH 3/3] caif: delete unnecessary field initialization
From: David Miller @ 2014-02-17 5:29 UTC (permalink / raw)
To: Julia.Lawall; +Cc: dmitry.tarnyagin, kernel-janitors, netdev, linux-kernel
In-Reply-To: <1392449773-23429-3-git-send-email-Julia.Lawall@lip6.fr>
From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Sat, 15 Feb 2014 08:36:13 +0100
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> On success, the function netdev_alloc_skb initializes the dev field of its
> result to its first argument, so this doesn't have to be done in the
> calling context.
>
> The semantic patch that fixes this problem is as follows:
> (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@
> expression skb,privn,e;
> @@
>
> skb = netdev_alloc_skb(privn,...);
> ... when strict
> (
> -skb->dev = privn;
> |
> ?skb = e
> )
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Applied to net-next, thanks.
^ permalink raw reply
* Re: [PATCH net-next] Documentation: broadcom-bcmgenet: add better clocks documentation
From: David Miller @ 2014-02-17 5:27 UTC (permalink / raw)
To: f.fainelli; +Cc: netdev, mark.rutland
In-Reply-To: <1392420102-8785-1-git-send-email-f.fainelli@gmail.com>
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Fri, 14 Feb 2014 15:21:42 -0800
> Document the required "clocks" phandles and their corresponding
> "clock-names" properties for the two clocks used by the GENET hardware
> block ("enet" and "enet-wol").
>
> CC: Mark Rutland <mark.rutland@arm.com>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net-next 0/2] tipc: eliminate smatch warnings
From: David Miller @ 2014-02-17 5:26 UTC (permalink / raw)
To: jon.maloy; +Cc: netdev, tipc-discussion
In-Reply-To: <1392414044-14326-1-git-send-email-jon.maloy@ericsson.com>
From: Jon Maloy <jon.maloy@ericsson.com>
Date: Fri, 14 Feb 2014 16:40:42 -0500
> We fix a couple of issues introduced by the series
> "tipc: clean up media and bearer layer".
>
> Thanks to Dan Carpenter and Walter Harms for highlighting this.
Both patches applied, thanks.
------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience. Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
^ permalink raw reply
* Re: Getting a NIC's MTU size
From: David Miller @ 2014-02-17 5:21 UTC (permalink / raw)
To: dhowells; +Cc: hannes, netdev
In-Reply-To: <27696.1392392957@warthog.procyon.org.uk>
From: David Howells <dhowells@redhat.com>
Date: Fri, 14 Feb 2014 15:49:17 +0000
> One further question: If I want to get the MTU size of the NIC through which
> packets will go to get to a particular peer, can I do:
As has been suggested or at least hinted to by others, you have to use
the route dst's device pointer.
Practically speaking, this means you'll have to cache the route, just
like we do in ipv4 sockets. And on each packet send 1) validate the
route and relookup if it's become obsolute 2) dereference the dst->dev
to get the mtu.
This is because routes can change dynamically as can the physical
device's MTU setting, you'll therefore have to evaluate everything
on every packet send.
^ permalink raw reply
* Re: drivers/net: tulip_remove_one needs to call pci_disable_device()
From: David Miller @ 2014-02-17 5:19 UTC (permalink / raw)
To: bigeasy; +Cc: grundler, netdev, mingo, tglx
In-Reply-To: <1392388340-6527-1-git-send-email-bigeasy@linutronix.de>
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Fri, 14 Feb 2014 15:32:20 +0100
> From: Ingo Molnar <mingo@elte.hu>
>
> Otherwise the device is not completely shut down.
>
> Signed-off-by: Ingo Molnar <mingo@elte.hu>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Looks good, applied, thanks.
^ permalink raw reply
* Re: [PATCH v3] net: sctp: Fix a_rwnd/rwnd management to reflect real state of the receiver's buffer
From: David Miller @ 2014-02-17 5:17 UTC (permalink / raw)
To: matija.glavinic-pecotic.ext; +Cc: linux-sctp, netdev, alexander.sverdlin
In-Reply-To: <52FE1F56.2020007@nsn.com>
From: Matija Glavinic Pecotic <matija.glavinic-pecotic.ext@nsn.com>
Date: Fri, 14 Feb 2014 14:51:18 +0100
> Implementation of (a)rwnd calculation might lead to severe performance issues
> and associations completely stalling. These problems are described and solution
> is proposed which improves lksctp's robustness in congestion state.
...
> Signed-off-by: Matija Glavinic Pecotic <matija.glavinic-pecotic.ext@nsn.com>
> Reviewed-by: Alexander Sverdlin <alexander.sverdlin@nsn.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net-next v2] IPv6: enable bind() to assign an anycast address
From: David Miller @ 2014-02-17 5:15 UTC (permalink / raw)
To: hannes; +Cc: fx.lebail, netdev, kuznet, christoph.paasch, eric.dumazet
In-Reply-To: <20140213001624.GJ11150@order.stressinduktion.org>
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
Date: Thu, 13 Feb 2014 01:16:24 +0100
> [added Cc list from old thread]
>
> On Wed, Feb 12, 2014 at 02:38:51PM +0100, Francois-Xavier Le Bail wrote:
>> - Use ipv6_chk_acast_addr_src() in inet6_bind().
>>
>> Signed-off-by: Francois-Xavier Le Bail <fx.lebail@yahoo.com>
>
> I would agree with the change but would like to see some people from the old
> thread about this change to agree with it, too.
I hear crickets... instead of other reviews :-)
^ permalink raw reply
* Re: [PATCH] ipv4: validate source address if the packet is for us
From: David Miller @ 2014-02-17 5:13 UTC (permalink / raw)
To: duanj.fnst; +Cc: netdev
In-Reply-To: <53019823.20700@cn.fujitsu.com>
From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Date: Mon, 17 Feb 2014 13:03:31 +0800
> otherwise the host may deal with the invaild packet.
>
> Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Locally bound packets are in fact the one case we do not
want source address validation to occur for performance
reasons, it's the whole reason this is coded the way that
it is.
Turn on rpfilter if you have a machine directly exposed
to the internet with no ingress firewalls/routers there
to validate the source address.
I am not applying this patch.
^ permalink raw reply
* Re: [PATCH net-next v2 01/10] ieee802154: add basic support for RF212 to at86rf230 driver
From: David Miller @ 2014-02-17 5:09 UTC (permalink / raw)
To: phoebe.buckheister-mPn0NPGs4xGatNDF+KUbs4QuADTiUCJX
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
In-Reply-To: <1392418172-5305-2-git-send-email-phoebe.buckheister-mPn0NPGs4xGatNDF+KUbs4QuADTiUCJX@public.gmane.org>
From: Phoebe Buckheister <phoebe.buckheister-mPn0NPGs4xGatNDF+KUbs4QuADTiUCJX@public.gmane.org>
Date: Fri, 14 Feb 2014 23:49:23 +0100
> - if (page != 0 || channel < 11 || channel > 26) {
> + if (page < 0
> + || page > 31
> + || !(lp->dev->phy->channels_supported[page] & BIT(channel))) {
This is not indented properly.
The first character on the second and subsequent lines should start
exactly at the first column after the openning parenthesis of the top-level
if() statement.
You must use the appropriate number of TAB and SPACE characters necessary
to achieve this.
In general, if you are indenting using only TAB characters, you are doing
it wrong.
------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience. Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
^ permalink raw reply
* Re: [PATCH -next V3] ip_tunnel: return more precise errno value when adding tunnel fails
From: David Miller @ 2014-02-17 5:07 UTC (permalink / raw)
To: fw; +Cc: netdev
In-Reply-To: <1392380079-3226-1-git-send-email-fw@strlen.de>
From: Florian Westphal <fw@strlen.de>
Date: Fri, 14 Feb 2014 13:14:39 +0100
> Currently this always returns ENOBUFS, because the return value of
> __ip_tunnel_create is discarded.
>
> A more common failure is a duplicate name (EEXIST). Propagate the real
> error code so userspace can display a more meaningful error message.
>
> Signed-off-by: Florian Westphal <fw@strlen.de>
Applied, thanks Florian.
^ permalink raw reply
* [PATCH] ipv4: validate source address if the packet is for us
From: Duan Jiong @ 2014-02-17 5:03 UTC (permalink / raw)
To: David Miller; +Cc: netdev
otherwise the host may deal with the invaild packet.
Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
---
net/ipv4/fib_frontend.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index c7539e2..4423a1a 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -321,6 +321,7 @@ int fib_validate_source(struct sk_buff *skb, __be32 src, __be32 dst,
int r = secpath_exists(skb) ? 0 : IN_DEV_RPFILTER(idev);
if (!r && !fib_num_tclassid_users(dev_net(dev)) &&
+ oif != LOOPBACK_IFINDEX &&
(dev->ifindex != oif || !IN_DEV_TX_REDIRECTS(idev))) {
*itag = 0;
return 0;
--
1.8.3.1
^ permalink raw reply related
* Re: [PATCH net-next 2/6] gianfar: Replace sysfs stubs with module params (fix)
From: David Miller @ 2014-02-17 4:48 UTC (permalink / raw)
To: claudiu.manoil; +Cc: netdev
In-Reply-To: <1392379445-28358-3-git-send-email-claudiu.manoil@freescale.com>
From: Claudiu Manoil <claudiu.manoil@freescale.com>
Date: Fri, 14 Feb 2014 14:04:01 +0200
> Removing the sysfs stubs for the Tx FIFOCFG and ATTRELI
> (stashing) config registers, as these registers may only
> be configured after a MAC reset, with the controller stopped
> (i.e. during hw init, at probe() time). The current sysfs
> stubs allow on-the-fly updates of these registers (the locking
> measures are useless and only add unecessary code).
>
> Changing these registers on-the-fly is strogly discouraged.
> In this regard, this patch may be seen as a security fix.
>
> To address this issue and not lose entirely these config
> params, they are now accessible as driver module parameters,
> and their names and default values have been preserved.
>
> Moreover, the stasing configuration options were effectively
> disabled (didn't get to the hw anyway if changed) because
> the stashing device_flags (HAS_BD_STASHING|HAS_BUF_STASHING)
> were "accidentally" cleared during probe(). The patch fixes
> this bug as well.
>
> Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
Sorry, no new module parameters.
And as you state these never actually reached the hardware so they
_never worked_. Please just remove them.
^ permalink raw reply
* Re: [PATCH] ipv4: distinguish EHOSTUNREACH from the ENETUNREACH
From: David Miller @ 2014-02-17 4:46 UTC (permalink / raw)
To: duanj.fnst; +Cc: netdev
In-Reply-To: <52FDEF4E.3010806@cn.fujitsu.com>
From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Date: Fri, 14 Feb 2014 18:26:22 +0800
> since commit 251da413("ipv4: Cache ip_error() routes even when not forwarding."),
> the counter IPSTATS_MIB_INADDRERRORS can't work correctly, because the value of
> err was always set to ENETUNREACH.
>
> Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Applied, thanks.
^ permalink raw reply
* [PATCH net-next] unix: add read side socket memory accounting for dgram sockets
From: Hannes Frederic Sowa @ 2014-02-17 3:58 UTC (permalink / raw)
To: netdev; +Cc: yannick, eric.dumazet, davem, xiyou.wangcong, dan
The current situation:
We allocate memory with sock_alloc_send_pskb which accounts skb to the
sending socket's sk_wmem_alloc. The skb->destructor does a sock_wfree
as soon as the recipient retrieves the data and skb is destroyed.
The problem with this implementation is that an unconnected unix dgram
server could get blocked sending further data, if a client does not
retrieve its frames from its sk_receive_queue because sk_wmem_alloc is
under control of the client.
This patch does the following improvment:
We still allocate dgram packets with sock_alloc_send_pskb, which now
does normally not block if the socket has too many packets in flight.
While delivering the skb to the client in unix_dgram_sendmsg we check
for the recipients sockets rmem and block there if sk_rcvbuf is surpassed.
As the sender socket is not attached to the skb while retrieving it any
more, we must attach the unix dgram peers address to the skb directly,
this is done via a new field in unix_skb_parms.
Note, socket buffer limitation is already in place from the generic
socket layer. The client cannot request more than sysctl_rmem_max
(/proc/sys/net/core/rmem_max) bytes of receive buffer.
The (unix_peer(other) != sk) checks are removed as we now no longer block
in in sock_alloc_send_pskb if we try to send data to ourself, as send
buffer will always be free. To avoid DoS we need to bring the sender
to a stop trying to deliver skbs to its own socket receive queue here.
The same logic applies to the unix_dgram_poll change.
So, currently the following protections are in place to not get a victim
of a DoS:
* sk_receive_queue length limitation by sk_max_ack_backlog
* sk_rcvbuf length limiting on the receiving socket
* sending buffer limitations in case of too may concurrent send requests
With this patch it is possible to maybe relax the unix_recq_full check in
future or make the sk_max_ack_backlog configurable in future on a per-socket
basis.
Reported-by: Yannick Koehler <yannick@koehler.name>
CC: Yannick Koehler <yannick@koehler.name>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>
Cc: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Dan Ballard <dan@mindstab.net>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
include/net/af_unix.h | 1 +
net/unix/af_unix.c | 79 ++++++++++++++++++++++++++++++++++++++++-----------
2 files changed, 63 insertions(+), 17 deletions(-)
diff --git a/include/net/af_unix.h b/include/net/af_unix.h
index a175ba4..52fbabd 100644
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -36,6 +36,7 @@ struct unix_skb_parms {
u32 secid; /* Security ID */
#endif
u32 consumed;
+ struct unix_address *dgram_peer;
};
#define UNIXCB(skb) (*(struct unix_skb_parms *)&((skb)->cb))
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 29fc8be..5583c02 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -187,6 +187,12 @@ static inline int unix_recvq_full(struct sock const *sk)
return skb_queue_len(&sk->sk_receive_queue) > sk->sk_max_ack_backlog;
}
+static bool unix_rmem_full(const struct sock *sk,
+ const struct sk_buff *skb)
+{
+ return sk_rmem_alloc_get(sk) + skb->truesize > sk->sk_rcvbuf;
+}
+
struct sock *unix_peer_get(struct sock *s)
{
struct sock *peer;
@@ -322,6 +328,11 @@ static inline int unix_writable(struct sock *sk)
return (atomic_read(&sk->sk_wmem_alloc) << 2) <= sk->sk_sndbuf;
}
+static int unix_other_writable(const struct sock *other)
+{
+ return (atomic_read(&other->sk_rmem_alloc) << 2) <= other->sk_rcvbuf;
+}
+
static void unix_write_space(struct sock *sk)
{
struct socket_wq *wq;
@@ -1048,8 +1059,13 @@ static long unix_wait_for_peer(struct sock *other, long timeo)
prepare_to_wait_exclusive(&u->peer_wait, &wait, TASK_INTERRUPTIBLE);
sched = !sock_flag(other, SOCK_DEAD) &&
- !(other->sk_shutdown & RCV_SHUTDOWN) &&
- unix_recvq_full(other);
+ !(other->sk_shutdown & RCV_SHUTDOWN);
+
+ if (other->sk_type == SOCK_STREAM)
+ sched = sched && unix_recvq_full(other);
+ else
+ sched = sched && (unix_recvq_full(other) ||
+ unix_other_writable(other));
unix_state_unlock(other);
@@ -1367,9 +1383,33 @@ static void unix_destruct_scm(struct sk_buff *skb)
/* Alas, it calls VFS */
/* So fscking what? fput() had been SMP-safe since the last Summer */
scm_destroy(&scm);
+}
+
+static void unix_skb_destruct_r(struct sk_buff *skb)
+{
+ unix_destruct_scm(skb);
+ if (UNIXCB(skb).dgram_peer)
+ unix_release_addr(UNIXCB(skb).dgram_peer);
+ sock_rfree(skb);
+}
+
+static void unix_skb_destruct_w(struct sk_buff *skb)
+{
+ unix_destruct_scm(skb);
+ if (UNIXCB(skb).dgram_peer)
+ unix_release_addr(UNIXCB(skb).dgram_peer);
sock_wfree(skb);
}
+static void unix_skb_set_owner_r(struct sk_buff *skb, struct sock *sk,
+ struct sock *other)
+{
+ sock_wfree(skb);
+ skb->sk = other;
+ skb->destructor = unix_skb_destruct_r;
+ atomic_add(skb->truesize, &other->sk_rmem_alloc);
+}
+
#define MAX_RECURSION_LEVEL 4
static int unix_attach_fds(struct scm_cookie *scm, struct sk_buff *skb)
@@ -1417,7 +1457,6 @@ static int unix_scm_to_skb(struct scm_cookie *scm, struct sk_buff *skb, bool sen
if (scm->fp && send_fds)
err = unix_attach_fds(scm, skb);
- skb->destructor = unix_destruct_scm;
return err;
}
@@ -1504,6 +1543,12 @@ static int unix_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock,
if (skb == NULL)
goto out;
+ if (u->addr) {
+ UNIXCB(skb).dgram_peer = u->addr;
+ atomic_inc(&UNIXCB(skb).dgram_peer->refcnt);
+ }
+ skb->destructor = unix_skb_destruct_w;
+
err = unix_scm_to_skb(siocb->scm, skb, true);
if (err < 0)
goto out_free;
@@ -1579,7 +1624,7 @@ restart:
goto out_unlock;
}
- if (unix_peer(other) != sk && unix_recvq_full(other)) {
+ if (unix_recvq_full(other) || unix_rmem_full(other, skb)) {
if (!timeo) {
err = -EAGAIN;
goto out_unlock;
@@ -1597,6 +1642,7 @@ restart:
if (sock_flag(other, SOCK_RCVTSTAMP))
__net_timestamp(skb);
maybe_add_creds(skb, sock, other);
+ unix_skb_set_owner_r(skb, sk, other);
skb_queue_tail(&other->sk_receive_queue, skb);
if (max_level > unix_sk(other)->recursion_level)
unix_sk(other)->recursion_level = max_level;
@@ -1677,6 +1723,8 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock,
if (!skb)
goto out_err;
+ skb->destructor = unix_skb_destruct_w;
+
/* Only send the fds in the first buffer */
err = unix_scm_to_skb(siocb->scm, skb, !fds_sent);
if (err < 0) {
@@ -1760,13 +1808,12 @@ static int unix_seqpacket_recvmsg(struct kiocb *iocb, struct socket *sock,
return unix_dgram_recvmsg(iocb, sock, msg, size, flags);
}
-static void unix_copy_addr(struct msghdr *msg, struct sock *sk)
+static void unix_copy_addr(struct msghdr *msg,
+ struct unix_address *ua)
{
- struct unix_sock *u = unix_sk(sk);
-
- if (u->addr) {
- msg->msg_namelen = u->addr->len;
- memcpy(msg->msg_name, u->addr->name, u->addr->len);
+ if (ua) {
+ msg->msg_namelen = ua->len;
+ memcpy(msg->msg_name, ua->name, ua->len);
}
}
@@ -1810,7 +1857,7 @@ static int unix_dgram_recvmsg(struct kiocb *iocb, struct socket *sock,
POLLOUT | POLLWRNORM | POLLWRBAND);
if (msg->msg_name)
- unix_copy_addr(msg, skb->sk);
+ unix_copy_addr(msg, UNIXCB(skb).dgram_peer);
if (size > skb->len - skip)
size = skb->len - skip;
@@ -2013,7 +2060,7 @@ again:
/* Copy address just once */
if (sunaddr) {
- unix_copy_addr(msg, skb->sk);
+ unix_copy_addr(msg, unix_sk(skb->sk)->addr);
sunaddr = NULL;
}
@@ -2237,11 +2284,9 @@ static unsigned int unix_dgram_poll(struct file *file, struct socket *sock,
writable = unix_writable(sk);
other = unix_peer_get(sk);
if (other) {
- if (unix_peer(other) != sk) {
- sock_poll_wait(file, &unix_sk(other)->peer_wait, wait);
- if (unix_recvq_full(other))
- writable = 0;
- }
+ sock_poll_wait(file, &unix_sk(other)->peer_wait, wait);
+ if (unix_recvq_full(other) || !unix_other_writable(other))
+ writable = 0;
sock_put(other);
}
--
1.8.5.3
^ permalink raw reply related
* Re: Get an online loan
From: Skye Loan Finance Limited @ 2014-02-16 22:48 UTC (permalink / raw)
To: fun
Get an online loan at Skye Loan Finance Limited is favorably disposed to
broker and facilitate the transfer of a Loan(s) to vise nominated account(s) of fund destination upon authentication and compliance of all procedural guidelines. Our loans are available from GBP 50,000.00, GBP 750,000.00 to GBP 950 Millions over 3-20 years at rates ranging from 3.5% to 6.5% APR E-mail: loanapplication_department2222@slf-online.com
^ permalink raw reply
* Re: Get an online loan
From: Skye Loan Finance Limited @ 2014-02-16 22:49 UTC (permalink / raw)
To: fun
Get an online loan at Skye Loan Finance Limited is favorably disposed to
broker and facilitate the transfer of a Loan(s) to vise nominated account(s) of fund destination upon authentication and compliance of all procedural guidelines. Our loans are available from GBP 50,000.00, GBP 750,000.00 to GBP 950 Millions over 3-20 years at rates ranging from 3.5% to 6.5% APR E-mail: loanapplication_department2222@slf-online.com
^ permalink raw reply
* Re: [PATCH net-next 0/4] bonding cleaning
From: Ding Tianhong @ 2014-02-17 1:00 UTC (permalink / raw)
To: Joe Perches, netdev; +Cc: linux-kernel
In-Reply-To: <cover.1392508410.git.joe@perches.com>
On 2014/2/16 7:57, Joe Perches wrote:
> Miscellaneous cleanups
>
> Joe Perches (4):
> bonding: Convert pr_warning to pr_warn, neatening
> bonding: Neaten pr_<level>
> bonding: Convert c99 comments
> bonding: Convert memcpy(foo, bar, ETH_ALEN) to ether_addr_copy(foo, bar)
>
> drivers/net/bonding/bond_3ad.c | 19 +--
> drivers/net/bonding/bond_3ad.h | 175 ++++++++++++++--------------
> drivers/net/bonding/bond_alb.c | 36 +++---
> drivers/net/bonding/bond_debugfs.c | 10 +-
> drivers/net/bonding/bond_main.c | 231 ++++++++++++++++++-------------------
> drivers/net/bonding/bond_netlink.c | 6 +-
> drivers/net/bonding/bond_options.c | 102 ++++++++--------
> drivers/net/bonding/bond_procfs.c | 8 +-
> drivers/net/bonding/bond_sysfs.c | 8 +-
> 9 files changed, 288 insertions(+), 307 deletions(-)
>
Reviewed-by: Ding Tianhong <dingtianhong@huawei.com>
^ permalink raw reply
* [PATCH 3/3] Drivers: net: hyperv: Cleanup the netvsc receive callback functio
From: K. Y. Srinivasan @ 2014-02-17 0:38 UTC (permalink / raw)
To: davem, netdev, linux-kernel, devel, olaf, apw, jasowang
In-Reply-To: <1392597525-13346-1-git-send-email-kys@microsoft.com>
Get rid of the buffer allocation in the receive path for normal packets.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
drivers/net/hyperv/hyperv_net.h | 2 ++
drivers/net/hyperv/netvsc.c | 33 ++++++++++-----------------------
2 files changed, 12 insertions(+), 23 deletions(-)
diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
index 7645ba3..01a16ea 100644
--- a/drivers/net/hyperv/hyperv_net.h
+++ b/drivers/net/hyperv/hyperv_net.h
@@ -506,6 +506,8 @@ struct netvsc_device {
/* Holds rndis device info */
void *extension;
+ /* The recive buffer for this device */
+ unsigned char cb_buffer[NETVSC_PACKET_SIZE];
};
/* NdisInitialize message */
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 7fa2bba..9a0e9c6 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -795,22 +795,16 @@ static void netvsc_channel_cb(void *context)
struct netvsc_device *net_device;
u32 bytes_recvd;
u64 request_id;
- unsigned char *packet;
struct vmpacket_descriptor *desc;
unsigned char *buffer;
int bufferlen = NETVSC_PACKET_SIZE;
struct net_device *ndev;
- packet = kzalloc(NETVSC_PACKET_SIZE * sizeof(unsigned char),
- GFP_ATOMIC);
- if (!packet)
- return;
- buffer = packet;
-
net_device = get_inbound_net_device(device);
if (!net_device)
- goto out;
+ return;
ndev = net_device->ndev;
+ buffer = net_device->cb_buffer;
do {
ret = vmbus_recvpacket_raw(device->channel, buffer, bufferlen,
@@ -838,23 +832,16 @@ static void netvsc_channel_cb(void *context)
break;
}
- /* reset */
- if (bufferlen > NETVSC_PACKET_SIZE) {
- kfree(buffer);
- buffer = packet;
- bufferlen = NETVSC_PACKET_SIZE;
- }
} else {
- /* reset */
- if (bufferlen > NETVSC_PACKET_SIZE) {
- kfree(buffer);
- buffer = packet;
- bufferlen = NETVSC_PACKET_SIZE;
- }
-
+ /*
+ * We are done for this pass.
+ */
break;
}
+
} else if (ret == -ENOBUFS) {
+ if (bufferlen > NETVSC_PACKET_SIZE)
+ kfree(buffer);
/* Handle large packet */
buffer = kmalloc(bytes_recvd, GFP_ATOMIC);
if (buffer == NULL) {
@@ -869,8 +856,8 @@ static void netvsc_channel_cb(void *context)
}
} while (1);
-out:
- kfree(buffer);
+ if (bufferlen > NETVSC_PACKET_SIZE)
+ kfree(buffer);
return;
}
--
1.7.4.1
^ permalink raw reply related
* [PATCH 2/3] Drivers: net: hyperv: Cleanup the receive path
From: K. Y. Srinivasan @ 2014-02-17 0:38 UTC (permalink / raw)
To: davem, netdev, linux-kernel, devel, olaf, apw, jasowang
In-Reply-To: <1392597525-13346-1-git-send-email-kys@microsoft.com>
Make the receive path a little more efficient by parameterizing the
required state rather than re-establishing that state.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/net/hyperv/netvsc.c | 29 +++++++++++++----------------
1 files changed, 13 insertions(+), 16 deletions(-)
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 03a2c6e..7fa2bba 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -432,17 +432,14 @@ static inline u32 hv_ringbuf_avail_percent(
return avail_write * 100 / ring_info->ring_datasize;
}
-static void netvsc_send_completion(struct hv_device *device,
+static void netvsc_send_completion(struct netvsc_device *net_device,
+ struct hv_device *device,
struct vmpacket_descriptor *packet)
{
- struct netvsc_device *net_device;
struct nvsp_message *nvsp_packet;
struct hv_netvsc_packet *nvsc_packet;
struct net_device *ndev;
- net_device = get_inbound_net_device(device);
- if (!net_device)
- return;
ndev = net_device->ndev;
nvsp_packet = (struct nvsp_message *)((unsigned long)packet +
@@ -561,13 +558,13 @@ int netvsc_send(struct hv_device *device,
}
static void netvsc_send_recv_completion(struct hv_device *device,
+ struct netvsc_device *net_device,
u64 transaction_id, u32 status)
{
struct nvsp_message recvcompMessage;
int retries = 0;
int ret;
struct net_device *ndev;
- struct netvsc_device *net_device = hv_get_drvdata(device);
ndev = net_device->ndev;
@@ -653,14 +650,15 @@ static void netvsc_receive_completion(void *context)
/* Send a receive completion for the xfer page packet */
if (fsend_receive_comp)
- netvsc_send_recv_completion(device, transaction_id, status);
+ netvsc_send_recv_completion(device, net_device, transaction_id,
+ status);
}
-static void netvsc_receive(struct hv_device *device,
- struct vmpacket_descriptor *packet)
+static void netvsc_receive(struct netvsc_device *net_device,
+ struct hv_device *device,
+ struct vmpacket_descriptor *packet)
{
- struct netvsc_device *net_device;
struct vmtransfer_page_packet_header *vmxferpage_packet;
struct nvsp_message *nvsp_packet;
struct hv_netvsc_packet *netvsc_packet = NULL;
@@ -673,9 +671,6 @@ static void netvsc_receive(struct hv_device *device,
LIST_HEAD(listHead);
- net_device = get_inbound_net_device(device);
- if (!net_device)
- return;
ndev = net_device->ndev;
/*
@@ -741,7 +736,7 @@ static void netvsc_receive(struct hv_device *device,
spin_unlock_irqrestore(&net_device->recv_pkt_list_lock,
flags);
- netvsc_send_recv_completion(device,
+ netvsc_send_recv_completion(device, net_device,
vmxferpage_packet->d.trans_id,
NVSP_STAT_FAIL);
@@ -825,11 +820,13 @@ static void netvsc_channel_cb(void *context)
desc = (struct vmpacket_descriptor *)buffer;
switch (desc->type) {
case VM_PKT_COMP:
- netvsc_send_completion(device, desc);
+ netvsc_send_completion(net_device,
+ device, desc);
break;
case VM_PKT_DATA_USING_XFER_PAGES:
- netvsc_receive(device, desc);
+ netvsc_receive(net_device,
+ device, desc);
break;
default:
--
1.7.4.1
^ permalink raw reply related
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