Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH 1/2] rhashtable: Introduce rhashtable_walk_*
From: Thomas Graf @ 2015-01-29 22:26 UTC (permalink / raw)
  To: Herbert Xu; +Cc: Ying Xue, davem, kaber, paulmck, netdev, netfilter-devel
In-Reply-To: <E1YGFRA-0002yN-I0@gondolin.me.apana.org.au>

On 01/28/15 at 10:20am, Herbert Xu wrote:
> Some existing rhashtable users get too intimate with it by walking
> the buckets directly.  This prevents us from easily changing the
> internals of rhashtable.
> 
> This patch adds the helpers rhashtable_walk_init/next/end which
> will replace these custom walkers.
> 
> They are meant to be usable for both procfs seq_file walks as well
> as walking by a netlink dump.  The iterator structure should fit
> inside a netlink dump cb structure, with at least one element to
> spare.
>   
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Acked-by: Thomas Graf <tgraf@suug.ch>

^ permalink raw reply

* Re: [PATCH net-next v2] rtnetlink: pass link_net to the newlink handler
From: David Miller @ 2015-01-29 22:23 UTC (permalink / raw)
  To: nicolas.dichtel; +Cc: netdev
In-Reply-To: <1422353588-4830-1-git-send-email-nicolas.dichtel@6wind.com>

From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Tue, 27 Jan 2015 11:13:08 +0100

> When IFLA_LINK_NETNSID is used, the netdevice should be built in this link netns
> and moved at the end to another netns (pointed by the socket netns or
> IFLA_NET_NS_[PID|FD]).
> 
> Existing user of the newlink handler will use the netns argument (src_net) to
> find a link netdevice or to check some other information into the link netns.
> For example, to find a netdevice, two information are required: an ifindex
> (usually from IFLA_LINK) and a netns (this link netns).
> 
> Note: when using IFLA_LINK_NETNSID and IFLA_NET_NS_[PID|FD], a user may create a
> netdevice that stands in netnsX and with its link part in netnsY, by sending a
> rtnl message from netnsZ.
> 
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCHv2 net] sunvnet: set queue mapping when doing packet copies
From: Eric Dumazet @ 2015-01-29 22:22 UTC (permalink / raw)
  To: David L Stevens; +Cc: David Miller, netdev, Sowmini Varadhan
In-Reply-To: <1422569982.21689.36.camel@edumazet-glaptop2.roam.corp.google.com>

On Thu, 2015-01-29 at 14:19 -0800, Eric Dumazet wrote:

> I guess you can extend the test to sock_wfree and tcp_wfree, but :
> 
> You have to EXPORT_SYMBOL(tcp_wfree)
> 
> Add an #ifdef CONFIG_INET   (take a look at skb_orphan_partial())

Or even better, add a new helper in the same spirit than
skb_orphan_partial() : You would EXPORT_SYMBOL() it and leave
tcp_wfree() as non exported.

^ permalink raw reply

* Re: Altera TSE (altera_tse) - tx_fifo_depth init bug
From: David Miller @ 2015-01-29 22:22 UTC (permalink / raw)
  To: setka; +Cc: vbridger, netdev, rfi
In-Reply-To: <54C8026B.9070607@vsis.cz>


Your patch was corrupted by your email client, in particular TAB
characters were transformed into a series of SPACE characters.

You must fix your outgoing emails so that this doesn't happen,
and you should send a test email to yourself and make sure that
you yourself can apply successfully the patch in that email
before trying to resend it here.

Thank you.

^ permalink raw reply

* Re: [PATCH net 0/2] netns: audit netdevice creation with IFLA_NET_NS_[PID|FD]
From: David Miller @ 2015-01-29 22:20 UTC (permalink / raw)
  To: nicolas.dichtel
  Cc: netdev, dmitry.tarnyagin, arvid.brodin, alex.aring, linux-wpan
In-Reply-To: <1422307694-10079-1-git-send-email-nicolas.dichtel@6wind.com>

From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Mon, 26 Jan 2015 22:28:12 +0100

> When one of these attributes is set, the netdevice is created into the netns
> pointed by IFLA_NET_NS_[PID|FD] (see the call to rtnl_create_link() in
> rtnl_newlink()). Let's call this netns the dest_net. After this creation, if the
> newlink handler exists, it is called with a netns argument that points to the
> netns where the netlink message has been received (called src_net in the code)
> which is the link netns.
> Hence, with one of these attributes, it's possible to create a x-netns
> netdevice.

Series applied, thanks.

^ permalink raw reply

* Re: [PATCHv2 net] sunvnet: set queue mapping when doing packet copies
From: Eric Dumazet @ 2015-01-29 22:19 UTC (permalink / raw)
  To: David L Stevens; +Cc: David Miller, netdev, Sowmini Varadhan
In-Reply-To: <54CAA7ED.5000100@oracle.com>

On Thu, 2015-01-29 at 16:36 -0500, David L Stevens wrote:

> In general the destructor should match the allocator, right? So it bothers me
> here that we'd be replacing it in an skb allocated with alloc_and_align_skb(),
> with an an arbitrary destructor from an skb NOT allocated with alloc_and_align_skb().
> If it has a different destructor that does special handling related to the allocator,
> it is the original skb, not the new one, that needs the old destructor. This TCP
> accounting has less to do with the buffer destructor than with the freeing of the
> contents of the buffer, but that isn't necessarily true for all destructors.
> 
> Checking for a known, specific destructor is less troubling, so I don't want
> to remove the test entirely.
> 
> Since the concern here is specifically TCP flow control, do you think it's sufficient
> to substitute tcp_wfree for the sock_wfree here?

The concern is also for UDP.

Right now a single UDP flow can flood your network, even if application
or admin cared to set a low SO_SNDBUF.

I guess you can extend the test to sock_wfree and tcp_wfree, but :

You have to EXPORT_SYMBOL(tcp_wfree)

Add an #ifdef CONFIG_INET   (take a look at skb_orphan_partial())

Thanks

^ permalink raw reply

* Re: [PATCH net-next] ipv6: tcp: tcp_v6_send_response() should give an owner to skb
From: David Miller @ 2015-01-29 22:16 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev
In-Reply-To: <1422566339.21689.28.camel@edumazet-glaptop2.roam.corp.google.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 29 Jan 2015 13:18:59 -0800

> On Wed, 2015-01-28 at 05:57 -0800, Eric Dumazet wrote:
>> From: Eric Dumazet <edumazet@google.com>
>> 
>> RST packets and ACK packets sent on behalf of TIME_WAIT sockets
>> do not have a socket owner currently.
> ...
>> 
>> Signed-off-by: Eric Dumazet <edumazet@google.com>
>> ---
> 
> Please do not apply.

Ok.

^ permalink raw reply

* Re: [PATCHv2 net] sunvnet: set queue mapping when doing packet copies
From: David Miller @ 2015-01-29 22:15 UTC (permalink / raw)
  To: eric.dumazet; +Cc: david.stevens, netdev, sowmini.varadhan
In-Reply-To: <1422563996.21689.26.camel@edumazet-glaptop2.roam.corp.google.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 29 Jan 2015 12:39:56 -0800

> On Thu, 2015-01-29 at 14:42 -0500, David L Stevens wrote:
>> @@ -1123,6 +1123,16 @@ static inline struct sk_buff *vnet_skb_shape(struct sk_buff *skb, int ncookies)
>>  			skb_shinfo(nskb)->gso_size = skb_shinfo(skb)->gso_size;
>>  			skb_shinfo(nskb)->gso_type = skb_shinfo(skb)->gso_type;
>>  		}
>> +		nskb->queue_mapping = skb->queue_mapping;
>> +		/* Following permits correct back-pressure, for protocols
>> +		 * using skb_set_owner_w().
>> +		 * Idea is to transfer ownership from skb to nskb.
>> +		 */
>> +		if (skb->destructor == sock_wfree) {
> 
> Sorry, but you should remove this test.
> 
> (TCP uses another destructor, not sock_wfree())
> 
> All sent packets will support these swap() operations,
> regardless of destructor.

Then we need to fix skb_segment() too.

^ permalink raw reply

* Re: [PATCH] rhashtable: Make selftest modular
From: Thomas Graf @ 2015-01-29 22:14 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: David S. Miller, netdev, linux-kernel
In-Reply-To: <1422542425-20940-1-git-send-email-geert@linux-m68k.org>

On 01/29/15 at 03:40pm, Geert Uytterhoeven wrote:
> Allow the selftest on the resizable hash table to be built modular, just
> like all other tests that do not depend on DEBUG_KERNEL.
> 
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

LGTM

Acked-by: Thomas Graf <tgraf@suug.ch>

^ permalink raw reply

* Re: [PATCH net-next v8 0/4] net: Add Keystone NetCP ethernet driver support
From: Arnd Bergmann @ 2015-01-29 22:00 UTC (permalink / raw)
  To: Murali Karicheri
  Cc: Balbi, Felipe, mugunthanvnm, David Miller, devicetree,
	linux-kernel, netdev
In-Reply-To: <54CA6C20.5090301@ti.com>

On Thursday 29 January 2015 12:21:36 Murali Karicheri wrote:
> 
> I think the solution is to make the cpsw_ale as a module and configured 
> through a Kconfig option. I am working on a fix for this now.
> 
> Similar fix is required for cpts.o. Currently we are not using this 
> module for Netcp, but soon this will be re-used. I have send a patch 
> that is already applied to net-next removing cpts.o for Netcp.
> 

Great, thanks a lot for the follow-up.

	Arnd

^ permalink raw reply

* Re: [PATCH] [TEMPORARY] net: netfilter: IPV6 XT sockets need CONFIG_NF_DEFRAG_IPV6
From: Arnd Bergmann @ 2015-01-29 21:57 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: netdev, davem, KOVACS Krisztian
In-Reply-To: <1699413.oLnudLOjvJ@wuerfel>

On Thursday 29 January 2015 17:50:30 Arnd Bergmann wrote:
> On Thursday 29 January 2015 17:18:59 Arnd Bergmann wrote:
> > If IP6_NF_IPTABLES=m, NF_DEFRAG_IPV6 gets selected as a module as well
> > from NETFILTER_XT_MATCH_SOCKET, so the latter cannot be built-in, or
> > we get:
> 
> I messed up the subject line, the [TEMPORARY] was not meant to be
> in there, and I also saw that the subject was mixed up too.
> 
> I will send it again with the proper subject.

After trying to fix up the commit message, I'm no longer sure the
patch was right either. The patch below is what I have now, and it
fixes the broken randconfig, but I'd give it a few hundred more
builds and some thought before I'm actually convinced that it's complete.

Sorry about the messup.

	Arnd

8<-----
>From 6da20879baa5b562c023f1a1b81a0a48da5ab0e4 Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Fri, 6 Jun 2014 10:07:46 +0200
Subject: [PATCH] [SUBMITTED] net: netfilter: fix IPV6 XT sockets dependency

If IP6_NF_IPTABLES=m, and one of NETFILTER_XT_MATCH_SOCKET or
NETFILTER_XT_TARGET_TPROXY is built-in, we get a link error:

net/built-in.o: In function `socket_mt_init':
:(.init.text+0x32a0): undefined reference to `nf_defrag_ipv6_enable'
net/built-in.o: In function `tproxy_tg_init':
xt_TPROXY.c:582: undefined reference to `nf_defrag_ipv6_enable'

The reason for this is that NF_DEFRAG_IPV6 also gets selected
by NF_CONNTRACK_IPV6, and that forces it to be a module.

To solve this, we add another set of dependencies that enforce that
either IP6_NF_IPTABLES is disabled, or the two netfilter drivers
are also loadable modules.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
index b02660fa9eb0..fc4f4a207785 100644
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
@@ -875,6 +875,7 @@ config NETFILTER_XT_TARGET_TPROXY
 	depends on NETFILTER_ADVANCED
 	depends on (IPV6 || IPV6=n)
 	depends on IP_NF_MANGLE
+	depends on !NF_CONNTRACK_IPV6 || NF_CONNTRACK_IPV6
 	select NF_DEFRAG_IPV4
 	select NF_DEFRAG_IPV6 if IP6_NF_IPTABLES
 	help
@@ -1366,6 +1367,7 @@ config NETFILTER_XT_MATCH_SOCKET
 	depends on NETFILTER_XTABLES
 	depends on NETFILTER_ADVANCED
 	depends on !NF_CONNTRACK || NF_CONNTRACK
+	depends on !NF_CONNTRACK_IPV6 || NF_CONNTRACK_IPV6
 	depends on (IPV6 || IPV6=n)
 	select NF_DEFRAG_IPV4
 	select NF_DEFRAG_IPV6 if IP6_NF_IPTABLES

^ permalink raw reply related

* Re: [PATCHv2 net] sunvnet: set queue mapping when doing packet copies
From: David L Stevens @ 2015-01-29 21:36 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: David Miller, netdev, Sowmini Varadhan
In-Reply-To: <1422563996.21689.26.camel@edumazet-glaptop2.roam.corp.google.com>



On 01/29/2015 03:39 PM, Eric Dumazet wrote:

> Sorry, but you should remove this test.
> 
> (TCP uses another destructor, not sock_wfree())
> 
> All sent packets will support these swap() operations,
> regardless of destructor.

In general the destructor should match the allocator, right? So it bothers me
here that we'd be replacing it in an skb allocated with alloc_and_align_skb(),
with an an arbitrary destructor from an skb NOT allocated with alloc_and_align_skb().
If it has a different destructor that does special handling related to the allocator,
it is the original skb, not the new one, that needs the old destructor. This TCP
accounting has less to do with the buffer destructor than with the freeing of the
contents of the buffer, but that isn't necessarily true for all destructors.

Checking for a known, specific destructor is less troubling, so I don't want
to remove the test entirely.

Since the concern here is specifically TCP flow control, do you think it's sufficient
to substitute tcp_wfree for the sock_wfree here?

							+-DLS

^ permalink raw reply

* Re: [PATCH net-next] ipv6: tcp: tcp_v6_send_response() should give an owner to skb
From: Eric Dumazet @ 2015-01-29 21:31 UTC (permalink / raw)
  To: David Miller; +Cc: netdev
In-Reply-To: <1422566339.21689.28.camel@edumazet-glaptop2.roam.corp.google.com>

On Thu, 2015-01-29 at 13:18 -0800, Eric Dumazet wrote:
> On Wed, 2015-01-28 at 05:57 -0800, Eric Dumazet wrote:
> > From: Eric Dumazet <edumazet@google.com>
> > 
> > RST packets and ACK packets sent on behalf of TIME_WAIT sockets
> > do not have a socket owner currently.
> ...
> > 
> > Signed-off-by: Eric Dumazet <edumazet@google.com>
> > ---
> 
> Please do not apply.
> 
> I forgot about commit 3a7c384ffd57ef5fbd95f48edaa2ca4eb3d9f2ee
> ("ipv4: tcp: unicast_sock should not land outside of TCP stack")
> 
> I need to do this in another way.

Well, no, patch was fine, sorry for the noise.

I have to addresss ipv4 side.

^ permalink raw reply

* Re: [PATCH RFC] wext: Add event stream wrappers that return E2BIG when values don't fit
From: Johannes Berg @ 2015-01-29 21:22 UTC (permalink / raw)
  To: Xander Huff
  Cc: davem, netdev, linux-kernel, linux-wireless, james.minor,
	joseph.hershberger, ben.shelton, jaeden.amero, joshc,
	rich.tollerton, brad.mouring
In-Reply-To: <1422565452-19825-1-git-send-email-xander.huff@ni.com>

On Thu, 2015-01-29 at 15:04 -0600, Xander Huff wrote:
> From: James Minor <james.minor@ni.com>
> 
> These issues show up when using the WEXT <-> NL80211 conversion layer and
> scanning with that.

Err, this is incorrect - there's no such conversion.

What you mean is "with the wext (compatibility) code in cfg80211".

> When the scan results come back, some of the IEs
> (information elements) are missing, those that specifically advertise the
> network security type. This happens due to the IEs getting chopped off in
> if the buffer that's passed in isn't large enough to get the full IE. The
> fix is to instead return E2BIG. Without this fix, the advertised security
> type is misinterpreted, since it appears to be a WPA or WEP network.
> 
> Testing with this fix resulted in a network which previously showed up as a
> PSK network now correctly showing up as EAP.
> 
> Side effects: A user space app which before did not get E2BIG and instead
> got a clipped off buffer might now get E2BIG instead, if the passed buffer
> is not large enough.

Arguably, apps will always have had to expect that, since we do that
also when it gets full. In fact, I'm not sure why we don't currently do
this, but I guess it depends on where in the data stream we ran out of
space.

Either way, I *strongly* recommend against using this in the first
place. There's an upper bound of 64k (I think) on the amount of memory
that can be used, and people have been known to run into this limit - at
which point you get absolutely no scan results back whatsoever. It's far
safer to use nl80211's scan dump, and if you're looking at this code in
particular then clearly you have it available.

Regarding the patch itself, it seems to add a bit much code. Is there
really no better way to express this? Perhaps by checking that the
stream actually moved forward - which will *always* happen for any of
these functions if they actually did anything? Even maybe if the new
_check inlines were to do that it'd still make the code smaller.

johannes

^ permalink raw reply

* Re: [PATCH net-next] ipv6: tcp: tcp_v6_send_response() should give an owner to skb
From: Eric Dumazet @ 2015-01-29 21:18 UTC (permalink / raw)
  To: David Miller; +Cc: netdev
In-Reply-To: <1422453433.29618.58.camel@edumazet-glaptop2.roam.corp.google.com>

On Wed, 2015-01-28 at 05:57 -0800, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> RST packets and ACK packets sent on behalf of TIME_WAIT sockets
> do not have a socket owner currently.
...
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---

Please do not apply.

I forgot about commit 3a7c384ffd57ef5fbd95f48edaa2ca4eb3d9f2ee
("ipv4: tcp: unicast_sock should not land outside of TCP stack")

I need to do this in another way.

Thanks

^ permalink raw reply

* [PATCH RFC] wext: Add event stream wrappers that return E2BIG when values don't fit
From: Xander Huff @ 2015-01-29 21:04 UTC (permalink / raw)
  To: davem-fT/PcQaiUtIeIZ0/mPfg9Q, johannes-cdvu00un1VgdHxzADdlk8Q
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA, james.minor-acOepvfBmUk,
	joseph.hershberger-acOepvfBmUk, ben.shelton-acOepvfBmUk,
	jaeden.amero-acOepvfBmUk, joshc-acOepvfBmUk,
	rich.tollerton-acOepvfBmUk, brad.mouring-acOepvfBmUk, Xander Huff

From: James Minor <james.minor-acOepvfBmUk@public.gmane.org>

These issues show up when using the WEXT <-> NL80211 conversion layer and
scanning with that. When the scan results come back, some of the IEs
(information elements) are missing, those that specifically advertise the
network security type. This happens due to the IEs getting chopped off in
if the buffer that's passed in isn't large enough to get the full IE. The
fix is to instead return E2BIG. Without this fix, the advertised security
type is misinterpreted, since it appears to be a WPA or WEP network.

Testing with this fix resulted in a network which previously showed up as a
PSK network now correctly showing up as EAP.

Side effects: A user space app which before did not get E2BIG and instead
got a clipped off buffer might now get E2BIG instead, if the passed buffer
is not large enough.

Signed-off-by: James Minor <james.minor-acOepvfBmUk@public.gmane.org>
Signed-off-by: Xander Huff <xander.huff-acOepvfBmUk@public.gmane.org>
Acked-by: Joe Hershberger <joseph.hershberger-acOepvfBmUk@public.gmane.org>
Acked-by: Ben Shelton <ben.shelton-acOepvfBmUk@public.gmane.org>
---
RFC because we're subtlely changing the user/kernel interface
---
 include/net/iw_handler.h |  87 ++++++++++++++++++++++
 net/wireless/scan.c      | 187 ++++++++++++++++++++++++++++++-----------------
 2 files changed, 208 insertions(+), 66 deletions(-)

diff --git a/include/net/iw_handler.h b/include/net/iw_handler.h
index a830b01..f07415a 100644
--- a/include/net/iw_handler.h
+++ b/include/net/iw_handler.h
@@ -521,6 +521,33 @@ iwe_stream_add_event(struct iw_request_info *info, char *stream, char *ends,
 
 /*------------------------------------------------------------------*/
 /*
+ * Wrapper to add an Wireless Event to a stream of events.
+ * Also returns indication of overflow conditions.
+ */
+static inline int
+iwe_stream_add_event_check(struct iw_request_info *info, char **stream,
+			   char *ends, struct iw_event *iwe, int event_len)
+{
+	int lcp_len = iwe_stream_lcp_len(info);
+
+	event_len = iwe_stream_event_len_adjust(info, event_len);
+
+	/* Check if it's possible */
+	if (likely((*stream + event_len) < ends)) {
+		iwe->len = event_len;
+		/* Beware of alignement issues on 64 bits */
+		memcpy(*stream, (char *) iwe, IW_EV_LCP_PK_LEN);
+		memcpy(*stream + lcp_len, &iwe->u,
+		       event_len - lcp_len);
+		*stream += event_len;
+		return 0;
+	} else {
+		return -E2BIG;
+	}
+}
+
+/*------------------------------------------------------------------*/
+/*
  * Wrapper to add an short Wireless Event containing a pointer to a
  * stream of events.
  */
@@ -547,6 +574,35 @@ iwe_stream_add_point(struct iw_request_info *info, char *stream, char *ends,
 
 /*------------------------------------------------------------------*/
 /*
+ * Wrapper to add an short Wireless Event containing a pointer to a
+ * stream of events.
+ * Also returns indication of overflow conditions.
+ */
+static inline int
+iwe_stream_add_point_check(struct iw_request_info *info, char **stream,
+			   char *ends, struct iw_event *iwe, char *extra)
+{
+	int event_len = iwe_stream_point_len(info) + iwe->u.data.length;
+	int point_len = iwe_stream_point_len(info);
+	int lcp_len   = iwe_stream_lcp_len(info);
+
+	/* Check if it's possible */
+	if (likely((*stream + event_len) < ends)) {
+		iwe->len = event_len;
+		memcpy(*stream, (char *) iwe, IW_EV_LCP_PK_LEN);
+		memcpy(*stream + lcp_len,
+		       ((char *) &iwe->u) + IW_EV_POINT_OFF,
+		       IW_EV_POINT_PK_LEN - IW_EV_LCP_PK_LEN);
+		memcpy(*stream + point_len, extra, iwe->u.data.length);
+		*stream += event_len;
+		return 0;
+	} else {
+		return -E2BIG;
+	}
+}
+
+/*------------------------------------------------------------------*/
+/*
  * Wrapper to add a value to a Wireless Event in a stream of events.
  * Be careful, this one is tricky to use properly :
  * At the first run, you need to have (value = event + IW_EV_LCP_LEN).
@@ -572,4 +628,35 @@ iwe_stream_add_value(struct iw_request_info *info, char *event, char *value,
 	return value;
 }
 
+/*------------------------------------------------------------------*/
+/*
+ * Wrapper to add a value to a Wireless Event in a stream of events.
+ * Be careful, this one is tricky to use properly :
+ * At the first run, you need to have (value = event + IW_EV_LCP_LEN).
+ * Also returns indication of overflow conditions.
+ */
+static inline int
+iwe_stream_add_value_check(struct iw_request_info *info, char *event,
+			   char **value, char *ends, struct iw_event *iwe,
+			   int event_len)
+{
+	int lcp_len = iwe_stream_lcp_len(info);
+
+	/* Don't duplicate LCP */
+	event_len -= IW_EV_LCP_LEN;
+
+	/* Check if it's possible */
+	if (likely((*value + event_len) < ends)) {
+		/* Add new value */
+		memcpy(*value, &iwe->u, event_len);
+		*value += event_len;
+		/* Patch LCP */
+		iwe->len = *value - event;
+		memcpy(event, (char *) iwe, lcp_len);
+		return 0;
+	} else {
+		return -E2BIG;
+	}
+}
+
 #endif	/* _IW_HANDLER_H */
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index c705c3e..1cb64ae 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -1239,15 +1239,16 @@ int cfg80211_wext_siwscan(struct net_device *dev,
 }
 EXPORT_SYMBOL_GPL(cfg80211_wext_siwscan);
 
-static void ieee80211_scan_add_ies(struct iw_request_info *info,
-				   const struct cfg80211_bss_ies *ies,
-				   char **current_ev, char *end_buf)
+static int ieee80211_scan_add_ies(struct iw_request_info *info,
+				  const struct cfg80211_bss_ies *ies,
+				  char **current_ev, char *end_buf)
 {
 	const u8 *pos, *end, *next;
 	struct iw_event iwe;
+	int err = 0;
 
 	if (!ies)
-		return;
+		return err;
 
 	/*
 	 * If needed, fragment the IEs buffer (at IE boundaries) into short
@@ -1264,10 +1265,11 @@ static void ieee80211_scan_add_ies(struct iw_request_info *info,
 		memset(&iwe, 0, sizeof(iwe));
 		iwe.cmd = IWEVGENIE;
 		iwe.u.data.length = next - pos;
-		*current_ev = iwe_stream_add_point(info, *current_ev,
-						   end_buf, &iwe,
-						   (void *)pos);
-
+		err = iwe_stream_add_point_check(info, current_ev,
+						 end_buf, &iwe,
+						 (void *)pos);
+		if (err)
+			return err;
 		pos = next;
 	}
 
@@ -1275,44 +1277,55 @@ static void ieee80211_scan_add_ies(struct iw_request_info *info,
 		memset(&iwe, 0, sizeof(iwe));
 		iwe.cmd = IWEVGENIE;
 		iwe.u.data.length = end - pos;
-		*current_ev = iwe_stream_add_point(info, *current_ev,
-						   end_buf, &iwe,
-						   (void *)pos);
+		err = iwe_stream_add_point_check(info, current_ev,
+						 end_buf, &iwe,
+						 (void *)pos);
+		if (err)
+			return err;
 	}
+	return 0;
 }
 
-static char *
+static int
 ieee80211_bss(struct wiphy *wiphy, struct iw_request_info *info,
-	      struct cfg80211_internal_bss *bss, char *current_ev,
+	      struct cfg80211_internal_bss *bss, char **current_ev,
 	      char *end_buf)
 {
 	const struct cfg80211_bss_ies *ies;
 	struct iw_event iwe;
 	const u8 *ie;
-	u8 *buf, *cfg, *p;
+	u8 *buf, *cfg;
+	char *p;
 	int rem, i, sig;
 	bool ismesh = false;
+	int err;
 
 	memset(&iwe, 0, sizeof(iwe));
 	iwe.cmd = SIOCGIWAP;
 	iwe.u.ap_addr.sa_family = ARPHRD_ETHER;
 	memcpy(iwe.u.ap_addr.sa_data, bss->pub.bssid, ETH_ALEN);
-	current_ev = iwe_stream_add_event(info, current_ev, end_buf, &iwe,
-					  IW_EV_ADDR_LEN);
+	err = iwe_stream_add_event_check(info, current_ev, end_buf, &iwe,
+					 IW_EV_ADDR_LEN);
+	if (err)
+		return err;
 
 	memset(&iwe, 0, sizeof(iwe));
 	iwe.cmd = SIOCGIWFREQ;
 	iwe.u.freq.m = ieee80211_frequency_to_channel(bss->pub.channel->center_freq);
 	iwe.u.freq.e = 0;
-	current_ev = iwe_stream_add_event(info, current_ev, end_buf, &iwe,
-					  IW_EV_FREQ_LEN);
+	err = iwe_stream_add_event_check(info, current_ev, end_buf, &iwe,
+					 IW_EV_FREQ_LEN);
+	if (err)
+		return err;
 
 	memset(&iwe, 0, sizeof(iwe));
 	iwe.cmd = SIOCGIWFREQ;
 	iwe.u.freq.m = bss->pub.channel->center_freq;
 	iwe.u.freq.e = 6;
-	current_ev = iwe_stream_add_event(info, current_ev, end_buf, &iwe,
-					  IW_EV_FREQ_LEN);
+	err = iwe_stream_add_event_check(info, current_ev, end_buf, &iwe,
+					 IW_EV_FREQ_LEN);
+	if (err)
+		return err;
 
 	if (wiphy->signal_type != CFG80211_SIGNAL_TYPE_NONE) {
 		memset(&iwe, 0, sizeof(iwe));
@@ -1341,8 +1354,11 @@ ieee80211_bss(struct wiphy *wiphy, struct iw_request_info *info,
 			/* not reached */
 			break;
 		}
-		current_ev = iwe_stream_add_event(info, current_ev, end_buf,
-						  &iwe, IW_EV_QUAL_LEN);
+		err = iwe_stream_add_event_check(info, current_ev, end_buf,
+						 &iwe, IW_EV_QUAL_LEN);
+		if (err)
+			return err;
+
 	}
 
 	memset(&iwe, 0, sizeof(iwe));
@@ -1352,8 +1368,10 @@ ieee80211_bss(struct wiphy *wiphy, struct iw_request_info *info,
 	else
 		iwe.u.data.flags = IW_ENCODE_DISABLED;
 	iwe.u.data.length = 0;
-	current_ev = iwe_stream_add_point(info, current_ev, end_buf,
-					  &iwe, "");
+	err = iwe_stream_add_point_check(info, current_ev, end_buf,
+					 &iwe, "");
+	if (err)
+		return err;
 
 	rcu_read_lock();
 	ies = rcu_dereference(bss->pub.ies);
@@ -1371,16 +1389,22 @@ ieee80211_bss(struct wiphy *wiphy, struct iw_request_info *info,
 			iwe.cmd = SIOCGIWESSID;
 			iwe.u.data.length = ie[1];
 			iwe.u.data.flags = 1;
-			current_ev = iwe_stream_add_point(info, current_ev, end_buf,
-							  &iwe, (u8 *)ie + 2);
+			err = iwe_stream_add_point_check(info, current_ev,
+							 end_buf, &iwe,
+							 (u8 *)ie + 2);
+			if (err)
+				return err;
 			break;
 		case WLAN_EID_MESH_ID:
 			memset(&iwe, 0, sizeof(iwe));
 			iwe.cmd = SIOCGIWESSID;
 			iwe.u.data.length = ie[1];
 			iwe.u.data.flags = 1;
-			current_ev = iwe_stream_add_point(info, current_ev, end_buf,
-							  &iwe, (u8 *)ie + 2);
+			err = iwe_stream_add_point_check(info, current_ev,
+							 end_buf, &iwe,
+							 (u8 *)ie + 2);
+			if (err)
+				return err;
 			break;
 		case WLAN_EID_MESH_CONFIG:
 			ismesh = true;
@@ -1395,47 +1419,62 @@ ieee80211_bss(struct wiphy *wiphy, struct iw_request_info *info,
 			sprintf(buf, "Mesh Network Path Selection Protocol ID: "
 				"0x%02X", cfg[0]);
 			iwe.u.data.length = strlen(buf);
-			current_ev = iwe_stream_add_point(info, current_ev,
-							  end_buf,
-							  &iwe, buf);
+			err = iwe_stream_add_point_check(info, current_ev,
+							 end_buf,
+							 &iwe, buf);
+			if (err)
+				goto out_fail_mesh;
 			sprintf(buf, "Path Selection Metric ID: 0x%02X",
 				cfg[1]);
 			iwe.u.data.length = strlen(buf);
-			current_ev = iwe_stream_add_point(info, current_ev,
-							  end_buf,
-							  &iwe, buf);
+			err = iwe_stream_add_point_check(info, current_ev,
+							 end_buf,
+							 &iwe, buf);
+			if (err)
+				goto out_fail_mesh;
 			sprintf(buf, "Congestion Control Mode ID: 0x%02X",
 				cfg[2]);
 			iwe.u.data.length = strlen(buf);
-			current_ev = iwe_stream_add_point(info, current_ev,
-							  end_buf,
-							  &iwe, buf);
+			err = iwe_stream_add_point_check(info, current_ev,
+							 end_buf,
+							 &iwe, buf);
+			if (err)
+				goto out_fail_mesh;
 			sprintf(buf, "Synchronization ID: 0x%02X", cfg[3]);
 			iwe.u.data.length = strlen(buf);
-			current_ev = iwe_stream_add_point(info, current_ev,
-							  end_buf,
-							  &iwe, buf);
+			err = iwe_stream_add_point_check(info, current_ev,
+							 end_buf,
+							 &iwe, buf);
+			if (err)
+				goto out_fail_mesh;
 			sprintf(buf, "Authentication ID: 0x%02X", cfg[4]);
 			iwe.u.data.length = strlen(buf);
-			current_ev = iwe_stream_add_point(info, current_ev,
-							  end_buf,
-							  &iwe, buf);
+			err = iwe_stream_add_point_check(info, current_ev,
+							 end_buf,
+							 &iwe, buf);
+			if (err)
+				goto out_fail_mesh;
 			sprintf(buf, "Formation Info: 0x%02X", cfg[5]);
 			iwe.u.data.length = strlen(buf);
-			current_ev = iwe_stream_add_point(info, current_ev,
-							  end_buf,
-							  &iwe, buf);
+			err = iwe_stream_add_point_check(info, current_ev,
+							 end_buf,
+							 &iwe, buf);
+			if (err)
+				goto out_fail_mesh;
 			sprintf(buf, "Capabilities: 0x%02X", cfg[6]);
 			iwe.u.data.length = strlen(buf);
-			current_ev = iwe_stream_add_point(info, current_ev,
-							  end_buf,
-							  &iwe, buf);
+			err = iwe_stream_add_point_check(info, current_ev,
+							 end_buf,
+							 &iwe, buf);
+out_fail_mesh:
 			kfree(buf);
+			if (err)
+				return err;
 			break;
 		case WLAN_EID_SUPP_RATES:
 		case WLAN_EID_EXT_SUPP_RATES:
 			/* display all supported rates in readable format */
-			p = current_ev + iwe_stream_lcp_len(info);
+			p = *current_ev + iwe_stream_lcp_len(info);
 
 			memset(&iwe, 0, sizeof(iwe));
 			iwe.cmd = SIOCGIWRATE;
@@ -1445,10 +1484,13 @@ ieee80211_bss(struct wiphy *wiphy, struct iw_request_info *info,
 			for (i = 0; i < ie[1]; i++) {
 				iwe.u.bitrate.value =
 					((ie[i + 2] & 0x7f) * 500000);
-				p = iwe_stream_add_value(info, current_ev, p,
-						end_buf, &iwe, IW_EV_PARAM_LEN);
+				err = iwe_stream_add_value_check(
+					info, *current_ev, &p, end_buf, &iwe,
+					IW_EV_PARAM_LEN);
+				if (err)
+					return err;
 			}
-			current_ev = p;
+			*current_ev = p;
 			break;
 		}
 		rem -= ie[1] + 2;
@@ -1465,8 +1507,10 @@ ieee80211_bss(struct wiphy *wiphy, struct iw_request_info *info,
 			iwe.u.mode = IW_MODE_MASTER;
 		else
 			iwe.u.mode = IW_MODE_ADHOC;
-		current_ev = iwe_stream_add_event(info, current_ev, end_buf,
-						  &iwe, IW_EV_UINT_LEN);
+		err = iwe_stream_add_event_check(info, current_ev, end_buf,
+						 &iwe, IW_EV_UINT_LEN);
+		if (err)
+			return err;
 	}
 
 	buf = kmalloc(31, GFP_ATOMIC);
@@ -1475,22 +1519,26 @@ ieee80211_bss(struct wiphy *wiphy, struct iw_request_info *info,
 		iwe.cmd = IWEVCUSTOM;
 		sprintf(buf, "tsf=%016llx", (unsigned long long)(ies->tsf));
 		iwe.u.data.length = strlen(buf);
-		current_ev = iwe_stream_add_point(info, current_ev, end_buf,
-						  &iwe, buf);
+		err = iwe_stream_add_point_check(info, current_ev, end_buf,
+						 &iwe, buf);
+		if (err)
+			return err;
 		memset(&iwe, 0, sizeof(iwe));
 		iwe.cmd = IWEVCUSTOM;
 		sprintf(buf, " Last beacon: %ums ago",
 			elapsed_jiffies_msecs(bss->ts));
 		iwe.u.data.length = strlen(buf);
-		current_ev = iwe_stream_add_point(info, current_ev,
-						  end_buf, &iwe, buf);
+		err = iwe_stream_add_point_check(info, current_ev,
+						 end_buf, &iwe, buf);
 		kfree(buf);
+		if (err)
+			return err;
 	}
 
-	ieee80211_scan_add_ies(info, ies, &current_ev, end_buf);
+	err = ieee80211_scan_add_ies(info, ies, current_ev, end_buf);
 	rcu_read_unlock();
 
-	return current_ev;
+	return err;
 }
 
 
@@ -1501,20 +1549,27 @@ static int ieee80211_scan_results(struct cfg80211_registered_device *rdev,
 	char *current_ev = buf;
 	char *end_buf = buf + len;
 	struct cfg80211_internal_bss *bss;
+	int err = 0;
 
 	spin_lock_bh(&rdev->bss_lock);
 	cfg80211_bss_expire(rdev);
 
 	list_for_each_entry(bss, &rdev->bss_list, list) {
 		if (buf + len - current_ev <= IW_EV_ADDR_LEN) {
-			spin_unlock_bh(&rdev->bss_lock);
-			return -E2BIG;
+			err = -E2BIG;
+			goto out_fail;
 		}
-		current_ev = ieee80211_bss(&rdev->wiphy, info, bss,
-					   current_ev, end_buf);
+		err = ieee80211_bss(&rdev->wiphy, info, bss,
+				    &current_ev, end_buf);
+		if (err)
+			goto out_fail;
 	}
+ out_fail:
 	spin_unlock_bh(&rdev->bss_lock);
-	return current_ev - buf;
+	if (err)
+		return err;
+	else
+		return current_ev - buf;
 }
 
 
-- 
1.9.1

--
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 related

* Re: [PATCHv2 net] sunvnet: set queue mapping when doing packet copies
From: Eric Dumazet @ 2015-01-29 20:39 UTC (permalink / raw)
  To: David L Stevens; +Cc: David Miller, netdev, Sowmini Varadhan
In-Reply-To: <54CA8D33.6020006@oracle.com>

On Thu, 2015-01-29 at 14:42 -0500, David L Stevens wrote:
> This patch fixes a bug where vnet_skb_shape() didn't set the already-selected
> queue mapping when a packet copy was required. This results in using the
> wrong queue index for stops/starts, hung tx queues and watchdog timeouts
> under heavy load. It also transfers the destructor, truesize, and the owning
> socket for flow control (code adapted from skb_segment).
> 
> Signed-off-by: David L Stevens <david.stevens@oracle.com>
> Acked-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
> 
> --
> Changes since v1:
>  move truesize, destructor and socket per Eric Dumazet <eric.dumazet@gmail.com>
> 
> ---
>  drivers/net/ethernet/sun/sunvnet.c |   10 ++++++++++
>  1 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/ethernet/sun/sunvnet.c b/drivers/net/ethernet/sun/sunvnet.c
> index 2b719cc..0a1d3eb 100644
> --- a/drivers/net/ethernet/sun/sunvnet.c
> +++ b/drivers/net/ethernet/sun/sunvnet.c
> @@ -1123,6 +1123,16 @@ static inline struct sk_buff *vnet_skb_shape(struct sk_buff *skb, int ncookies)
>  			skb_shinfo(nskb)->gso_size = skb_shinfo(skb)->gso_size;
>  			skb_shinfo(nskb)->gso_type = skb_shinfo(skb)->gso_type;
>  		}
> +		nskb->queue_mapping = skb->queue_mapping;
> +		/* Following permits correct back-pressure, for protocols
> +		 * using skb_set_owner_w().
> +		 * Idea is to transfer ownership from skb to nskb.
> +		 */
> +		if (skb->destructor == sock_wfree) {

Sorry, but you should remove this test.

(TCP uses another destructor, not sock_wfree())

All sent packets will support these swap() operations,
regardless of destructor.


> +			swap(nskb->truesize, skb->truesize);
> +			swap(nskb->destructor, skb->destructor);
> +			swap(nskb->sk, skb->sk);
> +		}
>  		dev_kfree_skb(skb);
>  		skb = nskb;
>  	}

^ permalink raw reply

* [PATCH net] hyperv: Fix the error processing in netvsc_send()
From: Haiyang Zhang @ 2015-01-29 20:34 UTC (permalink / raw)
  To: davem, netdev; +Cc: olaf, jasowang, driverdev-devel, linux-kernel, haiyangz

The existing code frees the skb in EAGAIN case, in which the skb will be
retried from upper layer and used again.
Also, the existing code doesn't free send buffer slot in error case, because
there is no completion message for unsent packets.
This patch fixes these problems.

(Please also include this patch for stable trees. Thanks!)

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/net/hyperv/netvsc.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 9f49c01..7cd4eb3 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -716,7 +716,7 @@ int netvsc_send(struct hv_device *device,
 	u64 req_id;
 	unsigned int section_index = NETVSC_INVALID_INDEX;
 	u32 msg_size = 0;
-	struct sk_buff *skb;
+	struct sk_buff *skb = NULL;
 	u16 q_idx = packet->q_idx;
 
 
@@ -743,8 +743,6 @@ int netvsc_send(struct hv_device *device,
 							   packet);
 			skb = (struct sk_buff *)
 			      (unsigned long)packet->send_completion_tid;
-			if (skb)
-				dev_kfree_skb_any(skb);
 			packet->page_buf_cnt = 0;
 		}
 	}
@@ -810,6 +808,13 @@ int netvsc_send(struct hv_device *device,
 			   packet, ret);
 	}
 
+	if (ret != 0) {
+		if (section_index != NETVSC_INVALID_INDEX)
+			netvsc_free_send_slot(net_device, section_index);
+	} else if (skb) {
+		dev_kfree_skb_any(skb);
+	}
+
 	return ret;
 }
 
-- 
1.7.4.1

^ permalink raw reply related

* Re: [PATCH] lib/checksum.c: fix build for generic csum_tcpudp_nofold
From: David Miller @ 2015-01-29 19:58 UTC (permalink / raw)
  To: karl.beldan; +Cc: karl.beldan, netdev, linux-kernel, edumazet
In-Reply-To: <1422526222-2445-1-git-send-email-karl.beldan@rivierawaves.com>

From: Karl Beldan <karl.beldan@gmail.com>
Date: Thu, 29 Jan 2015 11:10:22 +0100

> Fixed commit added from64to32 under _#ifndef do_csum_ but used it
> under _#ifndef csum_tcpudp_nofold_, breaking some builds (Fengguang's
> robot reported TILEGX's). Move from64to32 under the latter.
> 
> Fixes: 150ae0e94634 ("lib/checksum.c: fix carry in csum_tcpudp_nofold")
> Reported-by: kbuild test robot <fengguang.wu@intel.com>
> Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com>

Applied.

^ permalink raw reply

* [PATCHv2 net] sunvnet: set queue mapping when doing packet copies
From: David L Stevens @ 2015-01-29 19:42 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Sowmini Varadhan, Eric Dumazet

This patch fixes a bug where vnet_skb_shape() didn't set the already-selected
queue mapping when a packet copy was required. This results in using the
wrong queue index for stops/starts, hung tx queues and watchdog timeouts
under heavy load. It also transfers the destructor, truesize, and the owning
socket for flow control (code adapted from skb_segment).

Signed-off-by: David L Stevens <david.stevens@oracle.com>
Acked-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>

--
Changes since v1:
 move truesize, destructor and socket per Eric Dumazet <eric.dumazet@gmail.com>

---
 drivers/net/ethernet/sun/sunvnet.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/sun/sunvnet.c b/drivers/net/ethernet/sun/sunvnet.c
index 2b719cc..0a1d3eb 100644
--- a/drivers/net/ethernet/sun/sunvnet.c
+++ b/drivers/net/ethernet/sun/sunvnet.c
@@ -1123,6 +1123,16 @@ static inline struct sk_buff *vnet_skb_shape(struct sk_buff *skb, int ncookies)
 			skb_shinfo(nskb)->gso_size = skb_shinfo(skb)->gso_size;
 			skb_shinfo(nskb)->gso_type = skb_shinfo(skb)->gso_type;
 		}
+		nskb->queue_mapping = skb->queue_mapping;
+		/* Following permits correct back-pressure, for protocols
+		 * using skb_set_owner_w().
+		 * Idea is to transfer ownership from skb to nskb.
+		 */
+		if (skb->destructor == sock_wfree) {
+			swap(nskb->truesize, skb->truesize);
+			swap(nskb->destructor, skb->destructor);
+			swap(nskb->sk, skb->sk);
+		}
 		dev_kfree_skb(skb);
 		skb = nskb;
 	}
-- 
1.7.1

^ permalink raw reply related

* [PATCH net-next] tcp: use SACK RTTs for CC
From: Kenneth Klette Jonassen @ 2015-01-29 19:08 UTC (permalink / raw)
  To: netdev; +Cc: Kenneth Klette Jonassen

Current behavior only passes RTTs from sequentially acked data to CC.

If sender gets a combined ACK for segment 1 and SACK for segment 3, then the
computed RTT for CC is the time between sending segment 1 and receiving SACK
for segment 3.

Pass the minimum computed RTT from any acked data to CC, i.e. time between
sending segment 3 and receiving SACK for segment 3.

Signed-off-by: Kenneth Klette Jonassen <kennetkl@ifi.uio.no>
---
 net/ipv4/tcp_input.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 71fb37c..ed11931 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3183,8 +3183,10 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets,
 
 		tp->fackets_out -= min(pkts_acked, tp->fackets_out);
 
-		if (ca_ops->pkts_acked)
-			ca_ops->pkts_acked(sk, pkts_acked, ca_seq_rtt_us);
+		if (ca_ops->pkts_acked) {
+			long rtt_us = min_t(ulong, ca_seq_rtt_us, sack_rtt_us);
+			ca_ops->pkts_acked(sk, pkts_acked, rtt_us);
+		}
 
 	} else if (skb && rtt_update && sack_rtt_us >= 0 &&
 		   sack_rtt_us > skb_mstamp_us_delta(&now, &skb->skb_mstamp)) {
-- 
1.9.1

^ permalink raw reply related

* Re: [PATCH v2 linux-trace 1/8] tracing: attach eBPF programs to tracepoints and syscalls
From: Alexei Starovoitov @ 2015-01-29 18:55 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Steven Rostedt, Ingo Molnar, Arnaldo Carvalho de Melo, Jiri Olsa,
	Masami Hiramatsu, Linux API, Network Development, LKML

On Thu, Jan 29, 2015 at 4:35 AM, Namhyung Kim <namhyung@kernel.org> wrote:
>>> Right.  I think bpf programs belong to a user process but events are
>>> global resource.  Maybe you also need to consider attaching bpf
>>> program via perf (ioctl?) interface..
>>
>> yes. I did. Please see my reply to Masami.
>> ioctl only works for tracepoints.
>
> What was the problem of kprobes then? :)

Looks like I misread the logic of attaching a filter via perf ioctl.
Looking at it again it seems to be a major change in design:
Instead of adding into ftrace_raw_* helpers, I would add
to perf_trace_* helpers which are very stack heavy
because of 'pt_regs'
Ex: perf_trace_kfree_skb() is using 224 bytes of stack
whereas ftrace_raw_event_kfree_skb() only 80.
which doesn't help in my quest for lowest overhead.
And the discussion about soft- and auto- enable/disable
becomes meaningless, since there is no such things
when it goes through perf events.
I guess it means no hooks through tracefs...
Anyway, I'll hook it up and see which way is cleaner.

^ permalink raw reply

* Re: [PATCH] net, ethernet, LLVMLinux: Add missing MODULE_DEVICE_TABLE()
From: Behan Webster @ 2015-01-29 18:25 UTC (permalink / raw)
  To: David Miller
  Cc: sathya.perla, ajit.khaparde, linux-kernel, netdev,
	subbu.seetharaman, arnd
In-Reply-To: <20150128.224228.1533046356464752424.davem@davemloft.net>

On 01/28/15 22:42, David Miller wrote:
> From: Behan Webster <behanw@converseincode.com>
> Date: Wed, 28 Jan 2015 17:36:14 -0800
>
>> Missing MODULE_DEVICE_TABLE for pci ids from benet driver found by clang.
>>
>> Signed-off-by: Behan Webster <behanw@converseincode.com>
>> Suggested-by: Arnd Bergmann <arnd@arndb.de>
> Why are you removing the device table?
It is defined more than once; removing the duplicate (as Arnd
indicated). My commit message was just completely wrong. Brain fart. Sorry.

> Second of all, your Subject needs to be adjusted, using "net" and
> "LLVMLinux" in your subsystem prefix is not appropriate.  Simply
> "be2net: ", the name of this driver, is sufficient.
Will fix.

I've been in the habit of labelling the patches which go through the
LLVMLinux project like this so they are trivially identifiable in the
subject on lkml for reviewers and in the git log as being patches which
exist because of clang. If it's annoying I certainly don't need to do it.

Behan

-- 
Behan Webster
behanw@converseincode.com

^ permalink raw reply

* Re: [PATCH] net, ethernet, LLVMLinux: Add missing MODULE_DEVICE_TABLE()
From: Behan Webster @ 2015-01-29 18:21 UTC (permalink / raw)
  To: Arnd Bergmann, David Miller
  Cc: sathya.perla, ajit.khaparde, linux-kernel, netdev,
	subbu.seetharaman
In-Reply-To: <3392784.h8cmHX9fyr@wuerfel>

On 01/29/15 01:10, Arnd Bergmann wrote:
> On Wednesday 28 January 2015 22:42:28 David Miller wrote:
>> From: Behan Webster <behanw@converseincode.com>
>> Date: Wed, 28 Jan 2015 17:36:14 -0800
>>
>>> Missing MODULE_DEVICE_TABLE for pci ids from benet driver found by clang.
>>>
>>> Signed-off-by: Behan Webster <behanw@converseincode.com>
>>> Suggested-by: Arnd Bergmann <arnd@arndb.de>
>> Why are you removing the device table?
> Behan took a patch that I did earlier and split it up to add descriptions.
> The patch is correct, but he either misunderstood or misexpressed the
> intention.
I was tired and rushed this submission in my preparation for FOSDEM.
Apologies to all.

I neglected to write the commit log when I first split the patch, and
didn't look hard enough this time.

> This driver has two identical lines that both say 
>
> MODULE_DEVICE_TABLE(pci, be_dev_ids);
This is indeed the case.

> I don't remember the exact symptom, but llvm/clang trips over this, while gcc
> silently ignores the second one.
It claims that it is defined more than once.

Behan

-- 
Behan Webster
behanw@converseincode.com

^ permalink raw reply

* Re: [PATCH net] sunvnet: set queue mapping when doing packet copies
From: Eric Dumazet @ 2015-01-29 18:19 UTC (permalink / raw)
  To: David L Stevens; +Cc: David Miller, netdev, Sowmini Varadhan
In-Reply-To: <1422555146.21689.19.camel@edumazet-glaptop2.roam.corp.google.com>

On Thu, 2015-01-29 at 10:12 -0800, Eric Dumazet wrote:

> swap(nskb->sk, skb->sk);
> swap(nskb->truesize, skb->truesize);

and swap(nskb->destructor, skb->destructor);

(check skb_segment() for a similar path)

^ permalink raw reply


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