* Re: [PATCH] Disable rp_filter for IPsec packets
From: David Miller @ 2011-03-14 21:41 UTC (permalink / raw)
To: msmith; +Cc: netdev
In-Reply-To: <4D7E88C7.5080706@cbnco.com>
From: Michael Smith <msmith@cbnco.com>
Date: Mon, 14 Mar 2011 17:29:43 -0400
> David Miller wrote:
>> Secondly, fib_validate_source() already takes too many damn arguments.
>> Find another, less costly, way to pass this information down there.
>
> What would be a less costly way to pass it? Could I just hand it the
> whole skb?
I don't see how passing a pointer is better than passing an interger.
In both cases you're adding an extra argument to the function.
I was trying to get you to think out of the box and come up with
something clever, but that isn't working. :-)
>> Frankly, I think RPF should be disabled completely by default. When
>> it doesn't do anything useful, it's making route lookups twice as
>> expensive as they need to be.
>
> Yeah, it's disabled by default. It's an easy way of preventing
> spoofing of internal source addresses from the Internet, so I like it.
It is not "disabled by default". fib_validate_source() still does a
limited validation of the reverse path, even with the sysctl is set to
zero.
I want it to do absolutely nothing, and instead just use inet_select_addr()
to calculate spec_dst.
Even the spec_dst calculation is spurious, necessary only in limited
situations, and even in that case only takes on special values for
multicast and broadcast addresses.
In short, fib_validate_source() is nothing but completely unnecessary
overhead in the common case.
^ permalink raw reply
* Re: [PATCH] Disable rp_filter for IPsec packets
From: Michael Smith @ 2011-03-14 21:29 UTC (permalink / raw)
To: netdev
In-Reply-To: <20110314.142520.28811818.davem@davemloft.net>
David Miller wrote:
> First, I'm only willing to accept a patch like this to net-next-2.6
> for which all of the code you are changing is radically different.
OK.
> Secondly, fib_validate_source() already takes too many damn arguments.
> Find another, less costly, way to pass this information down there.
What would be a less costly way to pass it? Could I just hand it the
whole skb?
> Frankly, I think RPF should be disabled completely by default. When
> it doesn't do anything useful, it's making route lookups twice as
> expensive as they need to be.
Yeah, it's disabled by default. It's an easy way of preventing spoofing
of internal source addresses from the Internet, so I like it.
Thanks,
Mike
^ permalink raw reply
* Re: [PATCH 4/7] tcp_cubic: fix clock dependency
From: Eric Dumazet @ 2011-03-14 21:37 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David S. Miller, netdev
In-Reply-To: <20110314142125.63e84ade@nehalam>
Le lundi 14 mars 2011 à 14:21 -0700, Stephen Hemminger a écrit :
> I choose get_real() because that is what skb timestamp is using;
> both should probably use monotonic clock.
>
>
This point was raised elsewhere, problem is tcpdump/libpcap probably
wants "real" time, not monotonic clock...
^ permalink raw reply
* Re: [PATCH] bridge: control carrier based on ports online
From: David Miller @ 2011-03-14 21:29 UTC (permalink / raw)
To: shemminger
Cc: nicolas.2p.debian, adamm, kuznet, pekkas, jmorris, yoshfuji,
kaber, bridge, netdev, andy, fubar
In-Reply-To: <20110307103406.27330529@nehalam>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Mon, 7 Mar 2011 10:34:06 -0800
> This makes the bridge device behave like a physical device.
> In earlier releases the bridge always asserted carrier. This
> changes the behavior so that bridge device carrier is on only
> if one or more ports are in the forwarding state. This
> should help IPv6 autoconfiguration, DHCP, and routing daemons.
>
> I did brief testing with Network and Virt manager and they
> seem fine, but since this changes behavior of bridge, it should
> wait until net-next (2.6.39).
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Applied to net-next-2.6, thanks Stephen.
^ permalink raw reply
* Re: [PATCH] drivers/net: fix build warnings with CONFIG_PM_SLEEP disabled
From: David Miller @ 2011-03-14 21:26 UTC (permalink / raw)
To: walken; +Cc: shemminger, netdev, akpm, torvalds, linux-kernel
In-Reply-To: <20110307021450.GC31188@google.com>
From: Michel Lespinasse <walken@google.com>
Date: Sun, 6 Mar 2011 18:14:50 -0800
> This fixes a couple of build warnings when CONFIG_PM is enabled but
> CONFIG_PM_SLEEP is disabled. Applies on top of v2.6.38-rc7 - I know it's
> late, but it would be great if v2.6.38 could compile without warnings!
>
> Signed-off-by: Michel Lespinasse <walken@google.com>
I know it'd "be great" if this went into 2.6.38 but it doesn't fix
any real bugs, so I'm putting it into net-next-2.6
Thanks.
^ permalink raw reply
* Re: [PATCH] Disable rp_filter for IPsec packets
From: David Miller @ 2011-03-14 21:25 UTC (permalink / raw)
To: msmith; +Cc: netdev
In-Reply-To: <1300137299-28161-1-git-send-email-msmith@cbnco.com>
From: Michael Smith <msmith@cbnco.com>
Date: Mon, 14 Mar 2011 17:14:59 -0400
> The reverse path filter interferes with IPsec subnet-to-subnet tunnels,
> especially when the link to the IPsec peer is on an interface other than
> the one hosting the default route.
>
> With dynamic routing, where the peer might be reachable through eth0
> today and eth1 tomorrow, it's difficult to keep rp_filter enabled unless
> fake routes to the remote subnets are configured on the interface
> currently used to reach the peer.
>
> IPsec provides a much stronger anti-spoofing policy than rp_filter, so
> this patch disables the rp_filter for packets with a security path.
>
> Signed-off-by: Michael Smith <msmith@cbnco.com>
First, I'm only willing to accept a patch like this to net-next-2.6
for which all of the code you are changing is radically different.
Secondly, fib_validate_source() already takes too many damn arguments.
Find another, less costly, way to pass this information down there.
Frankly, I think RPF should be disabled completely by default. When
it doesn't do anything useful, it's making route lookups twice as
expensive as they need to be.
^ permalink raw reply
* Re: [PATCH 4/7] tcp_cubic: fix clock dependency
From: Stephen Hemminger @ 2011-03-14 21:21 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David S. Miller, netdev
In-Reply-To: <1300128679.3423.167.camel@edumazet-laptop>
On Mon, 14 Mar 2011 19:51:19 +0100
Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Le lundi 14 mars 2011 à 10:52 -0700, Stephen Hemminger a écrit :
> > pièce jointe document texte brut (tcp-cubic-minrtt.patch)
> > The hystart code was written with assumption that HZ=1000.
> > Replace the use of jiffies with bictcp_clock as a millisecond
> > real time clock.
> >
> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> > Reported-by: Lucas Nussbaum <lucas.nussbaum@loria.fr>
> >
> > --- a/net/ipv4/tcp_cubic.c 2011-03-14 08:19:18.000000000 -0700
> > +++ b/net/ipv4/tcp_cubic.c 2011-03-14 08:22:42.486690594 -0700
> > @@ -88,7 +88,7 @@ struct bictcp {
> > u32 last_time; /* time when updated last_cwnd */
> > u32 bic_origin_point;/* origin point of bic function */
> > u32 bic_K; /* time to origin point from the beginning of the current epoch */
> > - u32 delay_min; /* min delay */
> > + u32 delay_min; /* min delay (msec << 3) */
> > u32 epoch_start; /* beginning of an epoch */
> > u32 ack_cnt; /* number of acks */
> > u32 tcp_cwnd; /* estimated tcp cwnd */
> > @@ -98,7 +98,7 @@ struct bictcp {
> > u8 found; /* the exit point is found? */
> > u32 round_start; /* beginning of each round */
> > u32 end_seq; /* end_seq of the round */
> > - u32 last_jiffies; /* last time when the ACK spacing is close */
> > + u32 last_ack; /* last time when the ACK spacing is close */
> > u32 curr_rtt; /* the minimum rtt of current round */
> > };
> >
> > @@ -119,12 +119,21 @@ static inline void bictcp_reset(struct b
> > ca->found = 0;
> > }
> >
> > +static inline u32 bictcp_clock(void)
> > +{
> > +#if HZ < 1000
> > + return ktime_to_ms(ktime_get_real());
>
> Small point : This can be changed if date/time is changed
>
> Maybe use monotonic time (aka ktime_get_ts()) ?
I choose get_real() because that is what skb timestamp is using;
both should probably use monotonic clock.
--
^ permalink raw reply
* [PATCH] Disable rp_filter for IPsec packets
From: Michael Smith @ 2011-03-14 21:14 UTC (permalink / raw)
To: netdev
The reverse path filter interferes with IPsec subnet-to-subnet tunnels,
especially when the link to the IPsec peer is on an interface other than
the one hosting the default route.
With dynamic routing, where the peer might be reachable through eth0
today and eth1 tomorrow, it's difficult to keep rp_filter enabled unless
fake routes to the remote subnets are configured on the interface
currently used to reach the peer.
IPsec provides a much stronger anti-spoofing policy than rp_filter, so
this patch disables the rp_filter for packets with a security path.
Signed-off-by: Michael Smith <msmith@cbnco.com>
---
include/net/ip_fib.h | 2 +-
net/ipv4/fib_frontend.c | 4 ++--
net/ipv4/route.c | 26 ++++++++++++++++++--------
3 files changed, 21 insertions(+), 11 deletions(-)
I have a feeling the approach of checking for skb->sp != NULL is pretty
naive, but it seems to work. Patch is against Linus' tree.
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index 07bdb5e..61d5365 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -217,7 +217,7 @@ extern const struct nla_policy rtm_ipv4_policy[];
extern void ip_fib_init(void);
extern int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
struct net_device *dev, __be32 *spec_dst,
- u32 *itag, u32 mark);
+ u32 *itag, u32 mark, int norpf);
extern void fib_select_default(struct net *net, const struct flowi *flp,
struct fib_result *res);
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 1d2cdd4..ae889cc 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -245,7 +245,7 @@ EXPORT_SYMBOL(inet_dev_addr_type);
*/
int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
struct net_device *dev, __be32 *spec_dst,
- u32 *itag, u32 mark)
+ u32 *itag, u32 mark, int norpf)
{
struct in_device *in_dev;
struct flowi fl = {
@@ -265,7 +265,7 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
in_dev = __in_dev_get_rcu(dev);
if (in_dev) {
no_addr = in_dev->ifa_list == NULL;
- rpf = IN_DEV_RPFILTER(in_dev);
+ rpf = norpf ? 0 : IN_DEV_RPFILTER(in_dev);
accept_local = IN_DEV_ACCEPT_LOCAL(in_dev);
if (mark && !IN_DEV_SRC_VMARK(in_dev))
fl.mark = 0;
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 6ed6603..3ada54c 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1870,7 +1870,7 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr,
spec_dst = inet_select_addr(dev, 0, RT_SCOPE_LINK);
} else {
err = fib_validate_source(saddr, 0, tos, 0, dev, &spec_dst,
- &itag, 0);
+ &itag, 0, 0);
if (err < 0)
goto e_err;
}
@@ -1962,7 +1962,7 @@ static int __mkroute_input(struct sk_buff *skb,
struct fib_result *res,
struct in_device *in_dev,
__be32 daddr, __be32 saddr, u32 tos,
- struct rtable **result)
+ struct rtable **result, int norpf)
{
struct rtable *rth;
int err;
@@ -1982,7 +1982,8 @@ static int __mkroute_input(struct sk_buff *skb,
err = fib_validate_source(saddr, daddr, tos, FIB_RES_OIF(*res),
- in_dev->dev, &spec_dst, &itag, skb->mark);
+ in_dev->dev, &spec_dst, &itag, skb->mark,
+ norpf);
if (err < 0) {
ip_handle_martian_source(in_dev->dev, in_dev, skb, daddr,
saddr);
@@ -2059,7 +2060,7 @@ static int ip_mkroute_input(struct sk_buff *skb,
struct fib_result *res,
const struct flowi *fl,
struct in_device *in_dev,
- __be32 daddr, __be32 saddr, u32 tos)
+ __be32 daddr, __be32 saddr, u32 tos, int norpf)
{
struct rtable* rth = NULL;
int err;
@@ -2071,7 +2072,7 @@ static int ip_mkroute_input(struct sk_buff *skb,
#endif
/* create a routing cache entry */
- err = __mkroute_input(skb, res, in_dev, daddr, saddr, tos, &rth);
+ err = __mkroute_input(skb, res, in_dev, daddr, saddr, tos, &rth, norpf);
if (err)
return err;
@@ -2111,6 +2112,13 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
int err = -EINVAL;
struct net * net = dev_net(dev);
+#ifdef CONFIG_XFRM
+ /* Disable the reverse path filter for IPsec-protected packets. */
+ int norpf = skb->sp != NULL;
+#else
+ int norpf = 0;
+#endif
+
/* IP on this device is disabled. */
if (!in_dev)
@@ -2154,7 +2162,8 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
if (res.type == RTN_LOCAL) {
err = fib_validate_source(saddr, daddr, tos,
net->loopback_dev->ifindex,
- dev, &spec_dst, &itag, skb->mark);
+ dev, &spec_dst, &itag, skb->mark,
+ norpf);
if (err < 0)
goto martian_source_keep_err;
if (err)
@@ -2168,7 +2177,8 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
if (res.type != RTN_UNICAST)
goto martian_destination;
- err = ip_mkroute_input(skb, &res, &fl, in_dev, daddr, saddr, tos);
+ err = ip_mkroute_input(skb, &res, &fl, in_dev, daddr, saddr, tos,
+ norpf);
out: return err;
brd_input:
@@ -2179,7 +2189,7 @@ brd_input:
spec_dst = inet_select_addr(dev, 0, RT_SCOPE_LINK);
else {
err = fib_validate_source(saddr, 0, tos, 0, dev, &spec_dst,
- &itag, skb->mark);
+ &itag, skb->mark, norpf);
if (err < 0)
goto martian_source_keep_err;
if (err)
--
1.6.3.2
^ permalink raw reply related
* Re: [PATCH 6/6] net: sh_eth: add set_mdio_gate in bb_info
From: David Miller @ 2011-03-14 21:11 UTC (permalink / raw)
To: yoshihiro.shimoda.uh; +Cc: netdev, linux-sh
In-Reply-To: <4D75E1FB.6000607@renesas.com>
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Date: Tue, 08 Mar 2011 16:59:55 +0900
> The SH7757's ETHER and GETHER use common MDIO pin. The MDIO pin is
> selected by specific register. So this patch adds new interface in
> bb_info, and when the sh_eth driver use the mdio, the register can
> be changed by the function.
>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Applied.
^ permalink raw reply
* Re: [PATCH v2 5/6] net: sh_eth: add support for SH7757's GETHER
From: David Miller @ 2011-03-14 21:11 UTC (permalink / raw)
To: yoshihiro.shimoda.uh; +Cc: netdev, linux-sh
In-Reply-To: <4D75E1F5.3050704@renesas.com>
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Date: Tue, 08 Mar 2011 16:59:49 +0900
> The SH7757 have GETHER and ETHER both. This patch supports them.
>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Applied.
^ permalink raw reply
* Re: [PATCH v2 1/6] net: sh_eth: modify the definitions of register
From: David Miller @ 2011-03-14 21:10 UTC (permalink / raw)
To: yoshihiro.shimoda.uh; +Cc: netdev, linux-sh
In-Reply-To: <4D75E1DE.3030408@renesas.com>
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Date: Tue, 08 Mar 2011 16:59:26 +0900
> The previous code cannot handle the ETHER and GETHER both as same time
> because the definitions of register was hardcoded.
>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Applied.
^ permalink raw reply
* Re: [PATCH 4/6] net: sh_eth: modify the PHY_INTERFACE_MODE
From: David Miller @ 2011-03-14 21:11 UTC (permalink / raw)
To: yoshihiro.shimoda.uh; +Cc: netdev, linux-sh
In-Reply-To: <4D75E1F1.5090306@renesas.com>
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Date: Tue, 08 Mar 2011 16:59:45 +0900
> The previous code had hardcoded the PHY_INTERFACE_MODE_MII of phy_connect.
> So some Gigabit PHYs will not behave correctly.
> The patch adds the phy_interface in sh_eth_plat_data, so we can select
> the phy interface.
>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Applied.
^ permalink raw reply
* Re: [PATCH v2 3/6] net: sh_eth: remove almost #ifdef of SH7763
From: David Miller @ 2011-03-14 21:10 UTC (permalink / raw)
To: yoshihiro.shimoda.uh; +Cc: netdev, linux-sh
In-Reply-To: <4D75E1EA.50006@renesas.com>
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Date: Tue, 08 Mar 2011 16:59:38 +0900
> The SH7763 has GETHER. So the specification of some registers differs than
> other CPUs. This patch removes almost #ifdef of CONFIG_CPU_SUBTYPE_SH7763.
> Then we are able to add other CPU's GETHER easily.
>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Applied.
^ permalink raw reply
* Re: [PATCH v2 2/6] net: sh_eth: remove the SH_TSU_ADDR
From: David Miller @ 2011-03-14 21:10 UTC (permalink / raw)
To: yoshihiro.shimoda.uh; +Cc: netdev, linux-sh
In-Reply-To: <4D75E1E6.10108@renesas.com>
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Date: Tue, 08 Mar 2011 16:59:34 +0900
> The defination is hardcoded in this driver for some CPUs. This patch
> modifies to get resource of TSU address from platform_device.
>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Applied.
^ permalink raw reply
* Re: fcoe: correct checking for bonding
From: David Miller @ 2011-03-14 21:04 UTC (permalink / raw)
To: James.Bottomley
Cc: jpirko, robert.w.love, linux-scsi, devel, netdev, fubar,
joe.eykholt
In-Reply-To: <1300136015.31662.13.camel@mulgrave.site>
From: James Bottomley <James.Bottomley@suse.de>
Date: Mon, 14 Mar 2011 15:53:35 -0500
> That said, I think we're pretty close to the end of the patch series
> for the merge window and it's a simple patch, so as long as it
> applies to net-next, I think we have an pretty low probability for
> non trivial merges. You can do it with my and Rob's acked-by.
Ok, thanks.
^ permalink raw reply
* Re: [PATCH 0/3] bonding: various fixes
From: Andy Gospodarek @ 2011-03-14 21:04 UTC (permalink / raw)
To: Phil Oester; +Cc: netdev, fubar, andy
In-Reply-To: <1300119726-17529-1-git-send-email-kernel@linuxace.com>
On Mon, Mar 14, 2011 at 09:22:03AM -0700, Phil Oester wrote:
> A few collected fixes to bonding. Patches are against net-next,
> but should apply fine to 38-rc.
>
> Phil
>
>
> bond_main.c | 15 +++++++++++----
> bond_sysfs.c | 5 ++++-
> 2 files changed, 15 insertions(+), 5 deletions(-)
All in the series look good. Thanks for posting the queue cleanup,
Phil.
Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
^ permalink raw reply
* [PATCH v2] tcp: avoid cwnd moderation in undo
From: Yuchung Cheng @ 2011-03-14 20:57 UTC (permalink / raw)
To: David Miller, Ilpo Jarvinen; +Cc: Nandita Dukkipati, netdev, Yuchung Cheng
In-Reply-To: <201103141106.19679.carsten@wolffcarsten.de>
In the current undo logic, cwnd is moderated after it was restored
to the value prior entering fast-recovery. It was moderated first
in tcp_try_undo_recovery then again in tcp_complete_cwr.
Since the undo indicates recovery was false, these moderations
are not necessary. If the undo is triggered when most of the
outstanding data have been acknowledged, the (restored) cwnd is
falsely pulled down to a small value.
This patch removes these cwnd moderations if cwnd is undone
a) during fast-recovery
b) by receiving DSACKs past fast-recovery
Signed-off-by: Yuchung Cheng <ycheng@google.com>
---
Changelog since v1:
Revise the patch description to include undos after recovery
net/ipv4/tcp_input.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 08ea735..1bd0f38 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2659,7 +2659,7 @@ static void DBGUNDO(struct sock *sk, const char *msg)
#define DBGUNDO(x...) do { } while (0)
#endif
-static void tcp_undo_cwr(struct sock *sk, const int undo)
+static void tcp_undo_cwr(struct sock *sk, const int undo_ssthresh)
{
struct tcp_sock *tp = tcp_sk(sk);
@@ -2671,14 +2671,13 @@ static void tcp_undo_cwr(struct sock *sk, const int undo)
else
tp->snd_cwnd = max(tp->snd_cwnd, tp->snd_ssthresh << 1);
- if (undo && tp->prior_ssthresh > tp->snd_ssthresh) {
+ if (undo_ssthresh && tp->prior_ssthresh > tp->snd_ssthresh) {
tp->snd_ssthresh = tp->prior_ssthresh;
TCP_ECN_withdraw_cwr(tp);
}
} else {
tp->snd_cwnd = max(tp->snd_cwnd, tp->snd_ssthresh);
}
- tcp_moderate_cwnd(tp);
tp->snd_cwnd_stamp = tcp_time_stamp;
}
@@ -2822,8 +2821,11 @@ static int tcp_try_undo_loss(struct sock *sk)
static inline void tcp_complete_cwr(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
- tp->snd_cwnd = min(tp->snd_cwnd, tp->snd_ssthresh);
- tp->snd_cwnd_stamp = tcp_time_stamp;
+ /* Do not moderate cwnd if it's already undone in cwr or recovery */
+ if (tp->undo_marker && tp->snd_cwnd > tp->snd_ssthresh) {
+ tp->snd_cwnd = tp->snd_ssthresh;
+ tp->snd_cwnd_stamp = tcp_time_stamp;
+ }
tcp_ca_event(sk, CA_EVENT_COMPLETE_CWR);
}
--
1.7.3.1
^ permalink raw reply related
* Re: fcoe: correct checking for bonding
From: James Bottomley @ 2011-03-14 20:53 UTC (permalink / raw)
To: David Miller
Cc: jpirko, robert.w.love, linux-scsi, devel, netdev, fubar,
joe.eykholt
In-Reply-To: <20110314.132007.193707878.davem@davemloft.net>
On Mon, 2011-03-14 at 13:20 -0700, David Miller wrote:
> From: Jiri Pirko <jpirko@redhat.com>
> Date: Mon, 14 Mar 2011 20:22:02 +0100
> > Mon, Mar 14, 2011 at 08:04:07PM CET, robert.w.love@intel.com wrote:
> >> Taking a patch like this through net{-next} could cause a merge
> >>problem at Linus' level if a later patch makes it though the normal
> >>process and conflicts. This is what I want to avoid.
> >>
> >> This patch, although appreciated, isn't critical. I have collected it
> >>into my tree and will re-post it to scsi-misc. I see no reason to treat
> >>this patch differently from other patches.
> >
> > Well I have another set of patches dependent on this one :(
>
> True, also I think Rob is overreacting.
>
> Any merge problems created will be handled properly by Linus.
>
> I recently changed the interface to ipv4 and ipv6 route lookups, and
> this required all kinds of changes to stuff under Infiniband and elsewhere.
> It's the only sane way to handle this kind of thing.
What Rob means is that fcoe has been in pretty heavy flux and so
parallel patches can often cause non trivial merge nasties because of
code motion. That said, I think we're pretty close to the end of the
patch series for the merge window and it's a simple patch, so as long as
it applies to net-next, I think we have an pretty low probability for
non trivial merges. You can do it with my and Rob's acked-by.
James
^ permalink raw reply
* Re: [PATCH net-next] tipc: delete extra semicolon blocking node deletion
From: David Miller @ 2011-03-14 20:50 UTC (permalink / raw)
To: paul.gortmaker; +Cc: netdev, Allan.Stephens
In-Reply-To: <1300122682-13752-1-git-send-email-paul.gortmaker@windriver.com>
From: Paul Gortmaker <paul.gortmaker@windriver.com>
Date: Mon, 14 Mar 2011 13:11:22 -0400
> Remove bogus semicolon only recently introduced in 34e46258cb9f5
> that blocks cleanup of nodes for N>1 on shutdown.
>
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>
> Also available in the git repository at:
> git://git.kernel.org/pub/scm/linux/kernel/git/paulg/net-next-2.6.git tipc-Mar14-2011
Pulled, thanks Paul.
We should probably change all text editors in the world to display
semi-colon characters large and flashing red when editing C code :)
^ permalink raw reply
* Re: [PATCH net-next-2.6] pktgen: bug fix in transmission headers with frags=0
From: David Miller @ 2011-03-14 20:47 UTC (permalink / raw)
To: eric.dumazet; +Cc: daniel.turull, netdev, robert, jens.laas, voravit
In-Reply-To: <1300113350.3423.32.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 14 Mar 2011 15:35:50 +0100
> Le lundi 14 mars 2011 à 15:31 +0100, Daniel Turull a écrit :
>> (bug introduced by commit 26ad787962ef84677a48c560
>> (pktgen: speedup fragmented skbs)
>>
>> The headers of pktgen were incorrectly added in a pktgen packet
>> without frags (frags=0). There was an offset in the pktgen headers.
>>
>> The cause was in reusing the pgh variable as a return variable in skb_put
>> when adding the payload to the skb.
>>
>> Signed-off-by: Daniel Turull <daniel.turull@gmail.com>
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied, thanks everyone.
^ permalink raw reply
* Re: [PATCH] tcp: avoid cwnd moderation in undo
From: John Heffner @ 2011-03-14 20:44 UTC (permalink / raw)
To: Yuchung Cheng
Cc: Carsten Wolff, David Miller, Ilpo Jarvinen, Nandita Dukkipati,
netdev
In-Reply-To: <AANLkTimra1e-ONMx2hTeN90HFEvxqb3jPAr4v9_C+9wR@mail.gmail.com>
On Mon, Mar 14, 2011 at 3:10 PM, Yuchung Cheng <ycheng@google.com> wrote:
> On Mon, Mar 14, 2011 at 3:06 AM, Carsten Wolff <carsten@wolffcarsten.de> wrote:
>> The moderation is in place to avoid gigantic segment bursts, which could cause
>> unnecessary pressure on buffers. In my eyes it's already suboptimal that the
>> moderation is weakened in the presence of (detected) reordering, let alone
>> removing it completely.
>
> In the presence of reordering, cwnd is already moderated in Disorder
> state before
> entering the (false) recovery.
I've always been somewhat skeptical of the usefulness of cwnd
moderation. First, I don't know that its behavior is well defined.
When *should* tcp_moderate_cwnd() actually be called, and why?
Second, I've never liked the idea in general. Reducing cwnd has an
effect lasting many RTTs, so reducing it in response to a transient
event like reordering seems dubious. And it does not address many
causes of bursts, such as ack compression or stretch acks.
-John
^ permalink raw reply
* Re: [PATCH net-2.6] bnx2x: fix swap of rx-ticks and tx-ticks parameters in interrupt coalescing flow
From: David Miller @ 2011-03-14 20:43 UTC (permalink / raw)
To: ariele; +Cc: eilong, netdev
In-Reply-To: <1300100840.2090.21.camel@lb-tlvb-ariel.il.broadcom.com>
From: "Ariel Elior" <ariele@broadcom.com>
Date: Mon, 14 Mar 2011 13:07:20 +0200
> Signed-off-by: Ariel Elior <ariele@broadcom.com>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Applied, thanks.
^ permalink raw reply
* [PATCH][v3] dev : fix mtu check when TSO is enabled
From: Daniel Lezcano @ 2011-03-14 20:39 UTC (permalink / raw)
To: davem; +Cc: eric.dumazet, kaber, nightnord, netdev
In case the device where is coming from the packet has TSO enabled,
we should not check the mtu size value as this one could be bigger
than the expected value.
This is the case for the macvlan driver when the lower device has
TSO enabled. The macvlan inherit this feature and forward the packets
without fragmenting them. Then the packets go through dev_forward_skb
and are dropped. This patch fix this by checking TSO is not enabled
when we want to check the mtu size.
Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Patrick McHardy <kaber@trash.net>
Cc: Andrian Nord <nightnord@gmail.com>
---
net/core/dev.c | 24 ++++++++++++++++++++++--
1 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 6561021..29329d3 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1503,6 +1503,27 @@ static inline void net_timestamp_check(struct sk_buff *skb)
__net_timestamp(skb);
}
+static inline bool is_skb_forwardable(struct net_device *dev,
+ struct sk_buff *skb)
+{
+ unsigned int len;
+
+ if (!(dev->flags & IFF_UP))
+ return false;
+
+ len = dev->mtu + dev->hard_header_len + VLAN_HLEN;
+ if (skb->len < len)
+ return true;
+
+ /* if TSO is enabled, we don't care about the length as the packet
+ * could be forwarded without being segmented before
+ */
+ if (skb->dev && skb->dev->features & NETIF_F_TSO)
+ return true;
+
+ return false;
+}
+
/**
* dev_forward_skb - loopback an skb to another netif
*
@@ -1526,8 +1547,7 @@ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb)
skb_orphan(skb);
nf_reset(skb);
- if (unlikely(!(dev->flags & IFF_UP) ||
- (skb->len > (dev->mtu + dev->hard_header_len + VLAN_HLEN)))) {
+ if (unlikely(!is_skb_forwardable(dev, skb))) {
atomic_long_inc(&dev->rx_dropped);
kfree_skb(skb);
return NET_RX_DROP;
--
1.7.1
^ permalink raw reply related
* [PATCH 1/2] virtio: put last seen used index into ring itself
From: Michael S. Tsirkin @ 2011-03-14 20:30 UTC (permalink / raw)
To: Rusty Russell
Cc: Shirley Ma, Tom Lendacky, Krishna Kumar2, David Miller, kvm,
netdev, steved, jasowang
In-Reply-To: <cover.1300134326.git.mst@redhat.com>
Generally, the Host end of the virtio ring doesn't need to see where
Guest is up to in consuming the ring. However, to completely understand
what's going on from the outside, this information must be exposed.
For example, host can reduce the number of interrupts by detecting
that the guest is currently handling previous buffers.
Fortunately, we have room to expand: the ring is always a whole number
of pages and there's hundreds of bytes of padding after the avail ring
and the used ring, whatever the number of descriptors (which must be a
power of 2).
We add a feature bit so the guest can tell the host that it's writing
out the current value there, if it wants to use that.
This is based on a patch by Rusty Russell, with the main difference
being that we dedicate a feature bit to guest to tell the host it is
writing the used index. This way we don't need to force host to publish
the last available index until we have a use for it.
Memory barriers use has been rationalized (hopefully correctly).
To avoid the cost of an extra memory barrier on each update, we only
commit for the index to be up to date when interrupts
are enabled.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
drivers/virtio/virtio_ring.c | 25 ++++++++++++++++---------
include/linux/virtio_ring.h | 11 +++++++++++
2 files changed, 27 insertions(+), 9 deletions(-)
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index cc2f73e..a6fc537 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -89,9 +89,6 @@ struct vring_virtqueue
/* Number we've added since last sync. */
unsigned int num_added;
- /* Last used index we've seen. */
- u16 last_used_idx;
-
/* How to notify other side. FIXME: commonalize hcalls! */
void (*notify)(struct virtqueue *vq);
@@ -283,12 +280,13 @@ static void detach_buf(struct vring_virtqueue *vq, unsigned int head)
static inline bool more_used(const struct vring_virtqueue *vq)
{
- return vq->last_used_idx != vq->vring.used->idx;
+ return vring_last_used(vq) != vq->vring.used->idx;
}
void *virtqueue_get_buf(struct virtqueue *_vq, unsigned int *len)
{
struct vring_virtqueue *vq = to_vvq(_vq);
+ struct vring_used_elem *u;
void *ret;
unsigned int i;
@@ -308,9 +306,9 @@ void *virtqueue_get_buf(struct virtqueue *_vq, unsigned int *len)
/* Only get used array entries after they have been exposed by host. */
virtio_rmb();
- i = vq->vring.used->ring[vq->last_used_idx%vq->vring.num].id;
- *len = vq->vring.used->ring[vq->last_used_idx%vq->vring.num].len;
-
+ u = &vq->vring.used->ring[vring_last_used(vq) % vq->vring.num];
+ i = u->id;
+ *len = u->len;
if (unlikely(i >= vq->vring.num)) {
BAD_RING(vq, "id %u out of range\n", i);
return NULL;
@@ -323,7 +321,12 @@ void *virtqueue_get_buf(struct virtqueue *_vq, unsigned int *len)
/* detach_buf clears data, so grab it now. */
ret = vq->data[i];
detach_buf(vq, i);
- vq->last_used_idx++;
+ (vring_last_used(vq))++;
+ /* If we expect an interrupt for the next entry, flush out
+ * last used index write. */
+ if (!(vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT))
+ virtio_mb();
+
END_USE(vq);
return ret;
}
@@ -346,6 +349,8 @@ bool virtqueue_enable_cb(struct virtqueue *_vq)
/* We optimistically turn back on interrupts, then check if there was
* more to do. */
vq->vring.avail->flags &= ~VRING_AVAIL_F_NO_INTERRUPT;
+ /* Besides flags write, this barrier also flushes out
+ * last available index write. */
virtio_mb();
if (unlikely(more_used(vq))) {
END_USE(vq);
@@ -429,7 +434,7 @@ struct virtqueue *vring_new_virtqueue(unsigned int num,
vq->vq.name = name;
vq->notify = notify;
vq->broken = false;
- vq->last_used_idx = 0;
+ vring_last_used(vq) = 0;
vq->num_added = 0;
list_add_tail(&vq->vq.list, &vdev->vqs);
#ifdef DEBUG
@@ -471,6 +476,8 @@ void vring_transport_features(struct virtio_device *vdev)
switch (i) {
case VIRTIO_RING_F_INDIRECT_DESC:
break;
+ case VIRTIO_RING_F_PUBLISH_USED:
+ break;
default:
/* We don't understand this bit. */
clear_bit(i, vdev->features);
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h
index e4d144b..4587ea2 100644
--- a/include/linux/virtio_ring.h
+++ b/include/linux/virtio_ring.h
@@ -29,6 +29,9 @@
/* We support indirect buffer descriptors */
#define VIRTIO_RING_F_INDIRECT_DESC 28
+/* The Guest publishes last-seen used index at the end of the avail ring. */
+#define VIRTIO_RING_F_PUBLISH_USED 29
+
/* Virtio ring descriptors: 16 bytes. These can chain together via "next". */
struct vring_desc {
/* Address (guest-physical). */
@@ -83,6 +86,7 @@ struct vring {
* __u16 avail_flags;
* __u16 avail_idx;
* __u16 available[num];
+ * __u16 last_used_idx;
*
* // Padding to the next align boundary.
* char pad[];
@@ -93,6 +97,10 @@ struct vring {
* struct vring_used_elem used[num];
* };
*/
+
+/* We publish the last-seen used index at the end of the available ring.
+ * It is at the end for backwards compatibility. */
+#define vring_last_used(vr) ((vr)->avail->ring[num])
static inline void vring_init(struct vring *vr, unsigned int num, void *p,
unsigned long align)
{
@@ -101,6 +109,9 @@ static inline void vring_init(struct vring *vr, unsigned int num, void *p,
vr->avail = p + num*sizeof(struct vring_desc);
vr->used = (void *)(((unsigned long)&vr->avail->ring[num] + align-1)
& ~(align - 1));
+ /* Verify that last used index does not spill over the used ring. */
+ BUG_ON((void *)&vring_last_used(vr) +
+ sizeof vring_last_used(vr) > (void *)vr->used);
}
static inline unsigned vring_size(unsigned int num, unsigned long align)
--
1.7.3.2.91.g446ac
^ permalink raw reply related
* [PATCH 0/2] publish last used index (was Re: TX from KVM guest virtio_net to vhost issues)
From: Michael S. Tsirkin @ 2011-03-14 20:29 UTC (permalink / raw)
To: Rusty Russell
Cc: Shirley Ma, Tom Lendacky, Krishna Kumar2, David Miller, kvm,
netdev, steved, jasowang
In-Reply-To: <87d3ly2n81.fsf@rustcorp.com.au>
On Fri, Mar 11, 2011 at 04:49:26PM +1030, Rusty Russell wrote:
> But if one side outruns the other, it does a lot of unnecessary work
> notifying/interrupting it over and over again before the host/guest gets
> a chance to shut notifications/interrupts off. Hence the last_used
> publishing patch (Xen does this right, I screwed it up).
>
> Long weekend here, and I'm otherwise committed. But if noone has
> cleaned up that patch by early next week, I'll try to do so and see if
> we can make a real difference.
>
> Cheers,
> Rusty.
I actually had the last_used publishing patch working. Here it is
again: it's the part that publishes the used index from guest and the
part that uses it in host to avoid spurious interrupts
(this is Tom's case, not Shirley's case)
updated to the latest bits, and clarified the code a bit more.
Note: there's some tricky logic in the vhost part, I think I got it right
but please review.
Warning: compiled only, completely untested, I intend to add the bits
that use the last available index in guest to reduce exits, test it all
together.
Would appreciate review and/or testing.
Michael S. Tsirkin (2):
virtio: put last seen used index into ring itself
vhost-net: utilize PUBLISH_USED_IDX feature
drivers/vhost/vhost.c | 58 +++++++++++++++++++++++++++++++++++++----
drivers/vhost/vhost.h | 9 ++++++
drivers/virtio/virtio_ring.c | 25 +++++++++++------
include/linux/virtio_ring.h | 11 ++++++++
4 files changed, 88 insertions(+), 15 deletions(-)
--
1.7.3.2.91.g446ac
^ 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