* [PATCH 6/6] drivers/net/phy/mdio-mux-gpio.c: drop devm_kfree of devm_kzalloc'd data
From: Julia Lawall @ 2012-08-04 16:50 UTC (permalink / raw)
To: netdev; +Cc: kernel-janitors, linux-kernel
From: Julia Lawall <Julia.Lawall@lip6.fr>
devm_kfree should not have to be explicitly used.
The semantic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
expression x,d;
@@
x = devm_kzalloc(...)
...
?-devm_kfree(d,x);
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/net/phy/mdio-mux-gpio.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/phy/mdio-mux-gpio.c b/drivers/net/phy/mdio-mux-gpio.c
index e0cc4ef..eefe49e 100644
--- a/drivers/net/phy/mdio-mux-gpio.c
+++ b/drivers/net/phy/mdio-mux-gpio.c
@@ -101,7 +101,6 @@ err:
n--;
gpio_free(s->gpio[n]);
}
- devm_kfree(&pdev->dev, s);
return r;
}
^ permalink raw reply related
* Re: TCP Delayed ACK in FIN/ACK
From: Eric Dumazet @ 2012-08-04 16:34 UTC (permalink / raw)
To: richard -rw- weinberger; +Cc: Sławek Janecki, linux-kernel, netdev
In-Reply-To: <CAFLxGvxqj+-rf5twsMPk-pRQqzqsK8-MSsKaez9cwarPmyEqzw@mail.gmail.com>
On Sat, 2012-08-04 at 16:51 +0200, richard -rw- weinberger wrote:
> On Sat, Aug 4, 2012 at 4:45 PM, Sławek Janecki <janecki@gmail.com> wrote:
> > I have a node.js client (10.177.62.7) requesting some data from http
> > rest service from server (10.177.0.1).
> > Client is simply using nodejs http.request() method (agent=false).
> > Client is on Ubuntu 11.10 box.
> > Why client sends FIN ACK after 475ms? Why so slow? He should send FIN
> > ACK immediately.
> > I have many situations like this. About 1% of whole traffic is request
> > with delayed FIN ACK.
> > Cpu idle on the client is about 99%, so nothing is draining CPU.
> > How to debug this? What could it be? Is there any sysctl option I need to tune?
> > I think this behaviour is the Delayed ACK feature of RFC1122 TCP stack.
> >
> > Link to tcpdump picture (done on a client machine) :
> > http://i48.tinypic.com/35cpogx.png
> >
> > Can you tell why kernel delayed that FIN/ACK.
> > In tcpflow data there is exacly one ACK per packet comming from server.
> > Why kernel delayed client FIN/ACK.
> > It could avoid sending ACK every 'data' packet.
> > But it choose to delay FIN/ACK?
> > Is this possible? Is this a bug?
> >
> > I've also posted question on stackexchange:
> > http://stackoverflow.com/questions/11711218/client-sends-delayed-fin-ack-500ms-to-server
> >
> > Please help.
>
> CC'ing netdev.
>
I see nothing wrong in this tcpdump. You should strace the application
instead.
FIN/ACK is sent when client closes its socket (or calls shutdown()), and
not in reply of FIN sent by the server.
Kernel has no additional delay. I suspect your client is slow processing
the server answer, then close() its socket _after_ data processing.
Its possible tcp_send_fin() has to loop while allocating one skb under
very high memory pressure, and it seems we have no counters for this
case. But if it _was_ ever happening, you would have lot of messages in
kernel log (dmesg) about alloc_skb_clone() failures.
^ permalink raw reply
* Re: TCP stalls with 802.3ad + bridge + kvm guest
From: Peter Samuelson @ 2012-08-04 16:22 UTC (permalink / raw)
To: Jesse Brandeburg; +Cc: Jay Vosburgh, netdev, jgoerzen
In-Reply-To: <CAEuXFExg2X9r0zE8wUs9Npd7jPUN2WHbyJcnH6eT_23f2DoPjw@mail.gmail.com>
[Jesse Brandeburg]
> try
> # ethtool -K ethx tso off gso off lro off
Wow - that worked! Thanks so much! Now I'll see if I can narrow it
down a bit from there.
Then it's on to the mystery of why I have to explicitly set eth2+eth3
'promisc' - the bond0 device is supposed to propagate that setting but
apparently it doesn't. (Lower priority, though, since there's an easy
workaround.)
Peter
^ permalink raw reply
* Re: TCP Delayed ACK in FIN/ACK
From: richard -rw- weinberger @ 2012-08-04 14:51 UTC (permalink / raw)
To: Sławek Janecki; +Cc: linux-kernel, netdev
In-Reply-To: <CACS4u_zUF9T0rSsndhyVzgaauOBFJ4LTUeb432B1zg_oLHvTsg@mail.gmail.com>
On Sat, Aug 4, 2012 at 4:45 PM, Sławek Janecki <janecki@gmail.com> wrote:
> I have a node.js client (10.177.62.7) requesting some data from http
> rest service from server (10.177.0.1).
> Client is simply using nodejs http.request() method (agent=false).
> Client is on Ubuntu 11.10 box.
> Why client sends FIN ACK after 475ms? Why so slow? He should send FIN
> ACK immediately.
> I have many situations like this. About 1% of whole traffic is request
> with delayed FIN ACK.
> Cpu idle on the client is about 99%, so nothing is draining CPU.
> How to debug this? What could it be? Is there any sysctl option I need to tune?
> I think this behaviour is the Delayed ACK feature of RFC1122 TCP stack.
>
> Link to tcpdump picture (done on a client machine) :
> http://i48.tinypic.com/35cpogx.png
>
> Can you tell why kernel delayed that FIN/ACK.
> In tcpflow data there is exacly one ACK per packet comming from server.
> Why kernel delayed client FIN/ACK.
> It could avoid sending ACK every 'data' packet.
> But it choose to delay FIN/ACK?
> Is this possible? Is this a bug?
>
> I've also posted question on stackexchange:
> http://stackoverflow.com/questions/11711218/client-sends-delayed-fin-ack-500ms-to-server
>
> Please help.
CC'ing netdev.
--
Thanks,
//richard
^ permalink raw reply
* [PATCH iproute2] Install the bridge command under the same name we build it.
From: Nick Alcock @ 2012-08-04 14:36 UTC (permalink / raw)
To: netdev
Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
---
bridge/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/bridge/Makefile b/bridge/Makefile
index 0c333bf..9a6743e 100644
--- a/bridge/Makefile
+++ b/bridge/Makefile
@@ -7,8 +7,8 @@ all: bridge
bridge: $(BROBJ) $(LIBNETLINK)
install: all
- install -m 0755 br $(DESTDIR)$(SBINDIR)
+ install -m 0755 bridge $(DESTDIR)$(SBINDIR)
clean:
- rm -f $(BROBJ) br
+ rm -f $(BROBJ) bridge
--
1.7.11.2.155.g5ceeb62
^ permalink raw reply related
* [PATCH iproute2] Add missing space preventing the installation of tc.8 and tc-codel.8.
From: Nick Alcock @ 2012-08-04 14:35 UTC (permalink / raw)
To: netdev
Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
---
man/man8/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/man/man8/Makefile b/man/man8/Makefile
index 1b671a4..c344094 100644
--- a/man/man8/Makefile
+++ b/man/man8/Makefile
@@ -3,7 +3,7 @@ TARGETS = ip-address.8 ip-link.8 ip-route.8
MAN8PAGES = $(TARGETS) ip.8 arpd.8 lnstat.8 routel.8 rtacct.8 rtmon.8 ss.8 \
tc-bfifo.8 tc-cbq-details.8 tc-cbq.8 tc-drr.8 tc-htb.8 \
tc-pfifo.8 tc-pfifo_fast.8 tc-prio.8 tc-red.8 tc-sfq.8 \
- tc-tbf.8 tc.8tc-codel.8 tc-fq_codel.8 tc-sfb.8 tc-netem.8 tc-choke.8 \
+ tc-tbf.8 tc.8 tc-codel.8 tc-fq_codel.8 tc-sfb.8 tc-netem.8 tc-choke.8 \
bridge.8 rtstat.8 ctstat.8 nstat.8 routef.8 \
ip-tunnel.8 ip-rule.8 ip-ntable.8 \
ip-monitor.8 tc-stab.8 tc-hfsc.8 ip-xfrm.8 ip-netns.8 \
--
1.7.11.2.155.g5ceeb62
^ permalink raw reply related
* [PATCH net] batman-adv: select an internet gateway if none was chosen
From: Antonio Quartulli @ 2012-08-04 14:13 UTC (permalink / raw)
To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r, Marek Lindner
From: Marek Lindner <lindner_marek-LWAfsSFWpa4@public.gmane.org>
This is a regression introduced by: 2265c141086474bbae55a5bb3afa1ebb78ccaa7c
Reported-by: Nicolás Echániz <nicoechaniz-A9NS9UNFlhlrovVCs/uTlw@public.gmane.org>
Signed-off-by: Marek Lindner <lindner_marek-LWAfsSFWpa4@public.gmane.org>
Acked-by: Antonio Quartulli <ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>
Signed-off-by: Antonio Quartulli <ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>
---
net/batman-adv/gateway_client.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c
index b421cc4..fc866f2 100644
--- a/net/batman-adv/gateway_client.c
+++ b/net/batman-adv/gateway_client.c
@@ -200,11 +200,11 @@ void batadv_gw_election(struct batadv_priv *bat_priv)
if (atomic_read(&bat_priv->gw_mode) != BATADV_GW_MODE_CLIENT)
goto out;
- if (!batadv_atomic_dec_not_zero(&bat_priv->gw_reselect))
- goto out;
-
curr_gw = batadv_gw_get_selected_gw_node(bat_priv);
+ if (!batadv_atomic_dec_not_zero(&bat_priv->gw_reselect) && curr_gw)
+ goto out;
+
next_gw = batadv_gw_get_best_gw_node(bat_priv);
if (curr_gw == next_gw)
--
1.7.9.4
^ permalink raw reply related
* Re: 3.4-rc: NETDEV WATCHDOG: eth0 (r8169): transmit queue 0 timed out
From: Stefan Richter @ 2012-08-04 12:22 UTC (permalink / raw)
To: Francois Romieu; +Cc: netdev
In-Reply-To: <20120602111335.0b94fb59@stein>
On Jun 02 Stefan Richter wrote:
> I haven't had time to look further into it yet. Just two minor findings:
>
> (a) After update from 3.4-rc5 to 3.4, the problem persisted.
>
> (b) Later I noticed that silent file corruptions on FireWire disks happened
> and happen under 3.4-rc5 and 3.4, so I reverted into 3.3.1 which fixed
> that issue. Furthermore, since 6 days uptime of 3.3.1, the eth0 (r8169)
> transmit queue time-out did never occur.
After a month uptime of 3.3.1 without any problems, I rebooted into 3.5
six days ago. The frequent "r8169 0000:0b:00.0: eth0: link up" messages
which I got with 3.4-rc5 and 3.4 no longer happen. Whatever was wrong
with my system, it no longer is. Either 3.5 fixed it or it was an issue
external to the kernel or even external to the PC.
--
Stefan Richter
-=====-===-- =--- --=--
http://arcgraph.de/sr/
^ permalink raw reply
* Re: [net 0/3][pull request] Intel Wired LAN Driver Updates
From: David Miller @ 2012-08-04 10:37 UTC (permalink / raw)
To: peter.p.waskiewicz.jr; +Cc: netdev, gospo, sassmann
In-Reply-To: <1344075952-4198-1-git-send-email-peter.p.waskiewicz.jr@intel.com>
From: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Date: Sat, 4 Aug 2012 03:25:49 -0700
> This series contains various fixes to the igb driver.
>
> The following are changes since commit ff6e1225957cce9e93b8d84dc240e5a44094d0ec:
> cris: fix eth_v10.c build error
> and are available in the git repository at:
> git://git.kernel.org/pub/scm/linux/kernel/git/ppwaskie/net master
Pulled, thanks PJ.
^ permalink raw reply
* [net 3/3] igb: don't break user visible strings over multiple lines in igb_ethtool.c
From: Peter P Waskiewicz Jr @ 2012-08-04 10:25 UTC (permalink / raw)
To: davem; +Cc: Jesper Juhl, netdev, gospo, sassmann, Peter P Waskiewicz Jr
In-Reply-To: <1344075952-4198-1-git-send-email-peter.p.waskiewicz.jr@intel.com>
From: Jesper Juhl <jj@chaosbits.net>
Even when they go beyond 80 characters, user visible strings should be
on one line to make them easy to grep for.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
---
drivers/net/ethernet/intel/igb/igb_ethtool.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c
index ad489b7..90550f5 100644
--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
@@ -209,8 +209,8 @@ static int igb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
/* When SoL/IDER sessions are active, autoneg/speed/duplex
* cannot be changed */
if (igb_check_reset_block(hw)) {
- dev_err(&adapter->pdev->dev, "Cannot change link "
- "characteristics when SoL/IDER is active.\n");
+ dev_err(&adapter->pdev->dev,
+ "Cannot change link characteristics when SoL/IDER is active.\n");
return -EINVAL;
}
@@ -1089,8 +1089,8 @@ static bool reg_pattern_test(struct igb_adapter *adapter, u64 *data,
wr32(reg, (_test[pat] & write));
val = rd32(reg) & mask;
if (val != (_test[pat] & write & mask)) {
- dev_err(&adapter->pdev->dev, "pattern test reg %04X "
- "failed: got 0x%08X expected 0x%08X\n",
+ dev_err(&adapter->pdev->dev,
+ "pattern test reg %04X failed: got 0x%08X expected 0x%08X\n",
reg, val, (_test[pat] & write & mask));
*data = reg;
return 1;
@@ -1108,8 +1108,8 @@ static bool reg_set_and_check(struct igb_adapter *adapter, u64 *data,
wr32(reg, write & mask);
val = rd32(reg);
if ((write & mask) != (val & mask)) {
- dev_err(&adapter->pdev->dev, "set/check reg %04X test failed:"
- " got 0x%08X expected 0x%08X\n", reg,
+ dev_err(&adapter->pdev->dev,
+ "set/check reg %04X test failed: got 0x%08X expected 0x%08X\n", reg,
(val & mask), (write & mask));
*data = reg;
return 1;
@@ -1171,8 +1171,9 @@ static int igb_reg_test(struct igb_adapter *adapter, u64 *data)
wr32(E1000_STATUS, toggle);
after = rd32(E1000_STATUS) & toggle;
if (value != after) {
- dev_err(&adapter->pdev->dev, "failed STATUS register test "
- "got: 0x%08X expected: 0x%08X\n", after, value);
+ dev_err(&adapter->pdev->dev,
+ "failed STATUS register test got: 0x%08X expected: 0x%08X\n",
+ after, value);
*data = 1;
return 1;
}
@@ -1777,16 +1778,14 @@ static int igb_loopback_test(struct igb_adapter *adapter, u64 *data)
* sessions are active */
if (igb_check_reset_block(&adapter->hw)) {
dev_err(&adapter->pdev->dev,
- "Cannot do PHY loopback test "
- "when SoL/IDER is active.\n");
+ "Cannot do PHY loopback test when SoL/IDER is active.\n");
*data = 0;
goto out;
}
if ((adapter->hw.mac.type == e1000_i210)
|| (adapter->hw.mac.type == e1000_i211)) {
dev_err(&adapter->pdev->dev,
- "Loopback test not supported "
- "on this part at this time.\n");
+ "Loopback test not supported on this part at this time.\n");
*data = 0;
goto out;
}
--
1.7.10.4
^ permalink raw reply related
* [net 2/3] igb: correct hardware type (i210/i211) check in igb_loopback_test()
From: Peter P Waskiewicz Jr @ 2012-08-04 10:25 UTC (permalink / raw)
To: davem; +Cc: Jesper Juhl, netdev, gospo, sassmann, Peter P Waskiewicz Jr
In-Reply-To: <1344075952-4198-1-git-send-email-peter.p.waskiewicz.jr@intel.com>
From: Jesper Juhl <jj@chaosbits.net>
In the original code
...
if ((adapter->hw.mac.type == e1000_i210)
|| (adapter->hw.mac.type == e1000_i210)) {
...
the second check of 'adapter->hw.mac.type' is pointless since it tests
for the exact same value as the first.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Acked-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
---
drivers/net/ethernet/intel/igb/igb_ethtool.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c
index a19c84c..ad489b7 100644
--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
@@ -1783,7 +1783,7 @@ static int igb_loopback_test(struct igb_adapter *adapter, u64 *data)
goto out;
}
if ((adapter->hw.mac.type == e1000_i210)
- || (adapter->hw.mac.type == e1000_i210)) {
+ || (adapter->hw.mac.type == e1000_i211)) {
dev_err(&adapter->pdev->dev,
"Loopback test not supported "
"on this part at this time.\n");
--
1.7.10.4
^ permalink raw reply related
* [net 1/3] igb: Fix for failure to init on some 82576 devices.
From: Peter P Waskiewicz Jr @ 2012-08-04 10:25 UTC (permalink / raw)
To: davem; +Cc: Carolyn Wyborny, netdev, gospo, sassmann, Peter P Waskiewicz Jr
In-Reply-To: <1344075952-4198-1-git-send-email-peter.p.waskiewicz.jr@intel.com>
From: Carolyn Wyborny <carolyn.wyborny@intel.com>
Move nvm invalid size check to before size assigned by mac_type for
82575 and later parts in get_invariants function. This fixes a problem
found on some 82576 devices where the part will not initialize because
the nvm_read function pointer ends up getting assigned to the incorrect
function.
Reported By: Stefan Assmann <sassmann@redhat.com>
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
---
drivers/net/ethernet/intel/igb/e1000_82575.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c
index 5e84eaa..ba994fb 100644
--- a/drivers/net/ethernet/intel/igb/e1000_82575.c
+++ b/drivers/net/ethernet/intel/igb/e1000_82575.c
@@ -254,6 +254,14 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
*/
size += NVM_WORD_SIZE_BASE_SHIFT;
+ /*
+ * Check for invalid size
+ */
+ if ((hw->mac.type == e1000_82576) && (size > 15)) {
+ pr_notice("The NVM size is not valid, defaulting to 32K\n");
+ size = 15;
+ }
+
nvm->word_size = 1 << size;
if (hw->mac.type < e1000_i210) {
nvm->opcode_bits = 8;
@@ -281,14 +289,6 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
} else
nvm->type = e1000_nvm_flash_hw;
- /*
- * Check for invalid size
- */
- if ((hw->mac.type == e1000_82576) && (size > 15)) {
- pr_notice("The NVM size is not valid, defaulting to 32K\n");
- size = 15;
- }
-
/* NVM Function Pointers */
switch (hw->mac.type) {
case e1000_82580:
--
1.7.10.4
^ permalink raw reply related
* [net 0/3][pull request] Intel Wired LAN Driver Updates
From: Peter P Waskiewicz Jr @ 2012-08-04 10:25 UTC (permalink / raw)
To: davem; +Cc: Peter P Waskiewicz Jr, netdev, gospo, sassmann
This series contains various fixes to the igb driver.
The following are changes since commit ff6e1225957cce9e93b8d84dc240e5a44094d0ec:
cris: fix eth_v10.c build error
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/ppwaskie/net master
Carolyn Wyborny (1):
igb: Fix for failure to init on some 82576 devices.
Jesper Juhl (2):
igb: correct hardware type (i210/i211) check in igb_loopback_test()
igb: don't break user visible strings over multiple lines in
igb_ethtool.c
drivers/net/ethernet/intel/igb/e1000_82575.c | 16 ++++++++--------
drivers/net/ethernet/intel/igb/igb_ethtool.c | 25 ++++++++++++-------------
2 files changed, 20 insertions(+), 21 deletions(-)
--
1.7.10.4
^ permalink raw reply
* [PATCH] mISDN: Bugfix for layer2 fixed TEI mode
From: Karsten Keil @ 2012-08-04 10:14 UTC (permalink / raw)
To: netdev; +Cc: davem, stable, isdn4linux
If a fixed TEI is used, the initial state of the layer 2 statmachine need to be
4 (TEI assigned). This was true only for Point to Point connections, but not
for the other fixed TEIs. It was not found before, because usually only the
TEI 0 is used as fixed TEI for PtP mode, but if you try X31 packet mode
connections with SAPI 16, TEI 1, it did fail.
Signed-off-by: Karsten Keil <keil@b1-systems.de>
Cc: <stable@vger.kernel.org> # 3.5.x
---
drivers/isdn/mISDN/layer2.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/isdn/mISDN/layer2.c b/drivers/isdn/mISDN/layer2.c
index 0dc8abc..949cabb 100644
--- a/drivers/isdn/mISDN/layer2.c
+++ b/drivers/isdn/mISDN/layer2.c
@@ -2222,7 +2222,7 @@ create_l2(struct mISDNchannel *ch, u_int protocol, u_long options, int tei,
InitWin(l2);
l2->l2m.fsm = &l2fsm;
if (test_bit(FLG_LAPB, &l2->flag) ||
- test_bit(FLG_PTP, &l2->flag) ||
+ test_bit(FLG_FIXED_TEI, &l2->flag) ||
test_bit(FLG_LAPD_NET, &l2->flag))
l2->l2m.state = ST_L2_4;
else
--
1.7.7
^ permalink raw reply related
* Re: [PATCH net-next] ipv4: Introduce IN_DEV_NET_ROUTE_LOCALNET
From: David Miller @ 2012-08-04 8:28 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
In-Reply-To: <1344065245.9299.1477.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 04 Aug 2012 09:27:25 +0200
> From: Eric Dumazet <edumazet@google.com>
>
> performance profiles show a high cost in the IN_DEV_ROUTE_LOCALNET()
> call done in ip_route_input_slow(), because of multiple dereferences,
> even if cache lines are clean and available in cpu caches.
>
> Since we already have the 'net' pointer, introduce
> IN_DEV_NET_ROUTE_LOCALNET() macro avoiding two dereferences
> (dev_net(in_dev->dev))
>
> Also change the tests to use IN_DEV_NET_ROUTE_LOCALNET() only if saddr
> or/and daddr are loopback addresse.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] ipv4: change inet_addr_hash()
From: David Miller @ 2012-08-04 8:28 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
In-Reply-To: <1344064010.9299.1468.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 04 Aug 2012 09:06:50 +0200
> From: Eric Dumazet <edumazet@google.com>
>
> Use net_hash_mix(net) instead of hash_ptr(net, 8), and use
> hash_32() instead of using a serie of XOR
>
> Define IN4_ADDR_HSIZE_SHIFT for clarity
>
> __ip_dev_find() can perform the net_eq() call only if ifa_local
> matches the key, to avoid unneeded dereferences.
>
> remove inline attributes
>
> # size net/ipv4/devinet.o.before net/ipv4/devinet.o
> text data bss dec hex filename
> 17471 2545 2048 22064 5630 net/ipv4/devinet.o.before
> 17335 2545 2048 21928 55a8 net/ipv4/devinet.o
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] net: skb_share_check() should use consume_skb()
From: David Miller @ 2012-08-04 8:28 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
In-Reply-To: <1344063255.9299.1457.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 04 Aug 2012 08:54:15 +0200
> From: Eric Dumazet <edumazet@google.com>
>
> In order to avoid false drop_monitor indications, we should
> call consume_skb() if skb_clone() was successful.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied.
^ permalink raw reply
* Re: [PATCH 1/2] net: Allow to create links with given ifindex
From: David Miller @ 2012-08-04 8:25 UTC (permalink / raw)
To: eric.dumazet; +Cc: ebiederm, xemul, netdev
In-Reply-To: <1344064240.9299.1470.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 04 Aug 2012 09:10:40 +0200
> On Fri, 2012-08-03 at 16:56 -0700, David Miller wrote:
>> From: Eric Dumazet <eric.dumazet@gmail.com>
>> Date: Fri, 03 Aug 2012 07:45:29 +0200
>>
>> > @@ -1587,13 +1587,11 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
>> > if (ipv4_is_zeronet(daddr))
>> > goto martian_destination;
>> >
>> > - if (likely(!IN_DEV_ROUTE_LOCALNET(in_dev))) {
>> > - if (ipv4_is_loopback(daddr))
>> > - goto martian_destination;
>> > + if (ipv4_is_loopback(daddr) && !IN_DEV_NET_ROUTE_LOCALNET(in_dev, net))
>> > + goto martian_destination;
>> >
>> > - if (ipv4_is_loopback(saddr))
>> > - goto martian_source;
>> > - }
>> > + if (ipv4_is_loopback(saddr) && !IN_DEV_NET_ROUTE_LOCALNET(in_dev, net))
>> > + goto martian_source;
>>
>> Maybe clearer as:
>>
>> if ((ipv4_is_loopback(daddr) || ipv4_is_loopback(saddr)) &&
>> !IN_DEV_NET_ROUTE_LOCALNET(in_dev, net))
>> goto martian_source;
>
> Clearer, but handling of a martian destination is different of the
> martian source ;)
Duh, I missed that, too many martians :-)
^ permalink raw reply
* [PATCH net-next] ipv4: Introduce IN_DEV_NET_ROUTE_LOCALNET
From: Eric Dumazet @ 2012-08-04 7:27 UTC (permalink / raw)
To: David Miller; +Cc: netdev
From: Eric Dumazet <edumazet@google.com>
performance profiles show a high cost in the IN_DEV_ROUTE_LOCALNET()
call done in ip_route_input_slow(), because of multiple dereferences,
even if cache lines are clean and available in cpu caches.
Since we already have the 'net' pointer, introduce
IN_DEV_NET_ROUTE_LOCALNET() macro avoiding two dereferences
(dev_net(in_dev->dev))
Also change the tests to use IN_DEV_NET_ROUTE_LOCALNET() only if saddr
or/and daddr are loopback addresse.
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
include/linux/inetdevice.h | 11 +++++++++--
net/ipv4/route.c | 11 +++++++----
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index 67f9dda..d032780 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -104,9 +104,14 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev)
#define IN_DEV_ANDCONF(in_dev, attr) \
(IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr) && \
IN_DEV_CONF_GET((in_dev), attr))
-#define IN_DEV_ORCONF(in_dev, attr) \
- (IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr) || \
+
+#define IN_DEV_NET_ORCONF(in_dev, net, attr) \
+ (IPV4_DEVCONF_ALL(net, attr) || \
IN_DEV_CONF_GET((in_dev), attr))
+
+#define IN_DEV_ORCONF(in_dev, attr) \
+ IN_DEV_NET_ORCONF(in_dev, dev_net(in_dev->dev), attr)
+
#define IN_DEV_MAXCONF(in_dev, attr) \
(max(IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr), \
IN_DEV_CONF_GET((in_dev), attr)))
@@ -133,6 +138,8 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev)
IN_DEV_ORCONF((in_dev), \
PROMOTE_SECONDARIES)
#define IN_DEV_ROUTE_LOCALNET(in_dev) IN_DEV_ORCONF(in_dev, ROUTE_LOCALNET)
+#define IN_DEV_NET_ROUTE_LOCALNET(in_dev, net) \
+ IN_DEV_NET_ORCONF(in_dev, net, ROUTE_LOCALNET)
#define IN_DEV_RX_REDIRECTS(in_dev) \
((IN_DEV_FORWARD(in_dev) && \
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index e4ba974..21ad369 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1587,11 +1587,14 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
if (ipv4_is_zeronet(daddr))
goto martian_destination;
- if (likely(!IN_DEV_ROUTE_LOCALNET(in_dev))) {
- if (ipv4_is_loopback(daddr))
+ /* Following code try to avoid calling IN_DEV_NET_ROUTE_LOCALNET(),
+ * and call it once if daddr or/and saddr are loopback addresses
+ */
+ if (ipv4_is_loopback(daddr)) {
+ if (!IN_DEV_NET_ROUTE_LOCALNET(in_dev, net))
goto martian_destination;
-
- if (ipv4_is_loopback(saddr))
+ } else if (ipv4_is_loopback(saddr)) {
+ if (!IN_DEV_NET_ROUTE_LOCALNET(in_dev, net))
goto martian_source;
}
^ permalink raw reply related
* Re: [PATCH 1/2] net: Allow to create links with given ifindex
From: Eric Dumazet @ 2012-08-04 7:10 UTC (permalink / raw)
To: David Miller; +Cc: ebiederm, xemul, netdev
In-Reply-To: <20120803.165611.1832423445730269834.davem@davemloft.net>
On Fri, 2012-08-03 at 16:56 -0700, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Fri, 03 Aug 2012 07:45:29 +0200
>
> > @@ -1587,13 +1587,11 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
> > if (ipv4_is_zeronet(daddr))
> > goto martian_destination;
> >
> > - if (likely(!IN_DEV_ROUTE_LOCALNET(in_dev))) {
> > - if (ipv4_is_loopback(daddr))
> > - goto martian_destination;
> > + if (ipv4_is_loopback(daddr) && !IN_DEV_NET_ROUTE_LOCALNET(in_dev, net))
> > + goto martian_destination;
> >
> > - if (ipv4_is_loopback(saddr))
> > - goto martian_source;
> > - }
> > + if (ipv4_is_loopback(saddr) && !IN_DEV_NET_ROUTE_LOCALNET(in_dev, net))
> > + goto martian_source;
>
> Maybe clearer as:
>
> if ((ipv4_is_loopback(daddr) || ipv4_is_loopback(saddr)) &&
> !IN_DEV_NET_ROUTE_LOCALNET(in_dev, net))
> goto martian_source;
Clearer, but handling of a martian destination is different of the
martian source ;)
^ permalink raw reply
* [PATCH net-next] ipv4: change inet_addr_hash()
From: Eric Dumazet @ 2012-08-04 7:06 UTC (permalink / raw)
To: David Miller; +Cc: netdev
From: Eric Dumazet <edumazet@google.com>
Use net_hash_mix(net) instead of hash_ptr(net, 8), and use
hash_32() instead of using a serie of XOR
Define IN4_ADDR_HSIZE_SHIFT for clarity
__ip_dev_find() can perform the net_eq() call only if ifa_local
matches the key, to avoid unneeded dereferences.
remove inline attributes
# size net/ipv4/devinet.o.before net/ipv4/devinet.o
text data bss dec hex filename
17471 2545 2048 22064 5630 net/ipv4/devinet.o.before
17335 2545 2048 21928 55a8 net/ipv4/devinet.o
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
net/ipv4/devinet.c | 39 ++++++++++++++++++---------------------
1 file changed, 18 insertions(+), 21 deletions(-)
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 44bf82e..adf273f 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -94,25 +94,22 @@ static const struct nla_policy ifa_ipv4_policy[IFA_MAX+1] = {
[IFA_LABEL] = { .type = NLA_STRING, .len = IFNAMSIZ - 1 },
};
-/* inet_addr_hash's shifting is dependent upon this IN4_ADDR_HSIZE
- * value. So if you change this define, make appropriate changes to
- * inet_addr_hash as well.
- */
-#define IN4_ADDR_HSIZE 256
+#define IN4_ADDR_HSIZE_SHIFT 8
+#define IN4_ADDR_HSIZE (1U << IN4_ADDR_HSIZE_SHIFT)
+
static struct hlist_head inet_addr_lst[IN4_ADDR_HSIZE];
static DEFINE_SPINLOCK(inet_addr_hash_lock);
-static inline unsigned int inet_addr_hash(struct net *net, __be32 addr)
+static u32 inet_addr_hash(struct net *net, __be32 addr)
{
- u32 val = (__force u32) addr ^ hash_ptr(net, 8);
+ u32 val = (__force u32) addr ^ net_hash_mix(net);
- return ((val ^ (val >> 8) ^ (val >> 16) ^ (val >> 24)) &
- (IN4_ADDR_HSIZE - 1));
+ return hash_32(val, IN4_ADDR_HSIZE_SHIFT);
}
static void inet_hash_insert(struct net *net, struct in_ifaddr *ifa)
{
- unsigned int hash = inet_addr_hash(net, ifa->ifa_local);
+ u32 hash = inet_addr_hash(net, ifa->ifa_local);
spin_lock(&inet_addr_hash_lock);
hlist_add_head_rcu(&ifa->hash, &inet_addr_lst[hash]);
@@ -136,18 +133,18 @@ static void inet_hash_remove(struct in_ifaddr *ifa)
*/
struct net_device *__ip_dev_find(struct net *net, __be32 addr, bool devref)
{
- unsigned int hash = inet_addr_hash(net, addr);
+ u32 hash = inet_addr_hash(net, addr);
struct net_device *result = NULL;
struct in_ifaddr *ifa;
struct hlist_node *node;
rcu_read_lock();
hlist_for_each_entry_rcu(ifa, node, &inet_addr_lst[hash], hash) {
- struct net_device *dev = ifa->ifa_dev->dev;
-
- if (!net_eq(dev_net(dev), net))
- continue;
if (ifa->ifa_local == addr) {
+ struct net_device *dev = ifa->ifa_dev->dev;
+
+ if (!net_eq(dev_net(dev), net))
+ continue;
result = dev;
break;
}
@@ -182,10 +179,10 @@ static void inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap,
static void devinet_sysctl_register(struct in_device *idev);
static void devinet_sysctl_unregister(struct in_device *idev);
#else
-static inline void devinet_sysctl_register(struct in_device *idev)
+static void devinet_sysctl_register(struct in_device *idev)
{
}
-static inline void devinet_sysctl_unregister(struct in_device *idev)
+static void devinet_sysctl_unregister(struct in_device *idev)
{
}
#endif
@@ -205,7 +202,7 @@ static void inet_rcu_free_ifa(struct rcu_head *head)
kfree(ifa);
}
-static inline void inet_free_ifa(struct in_ifaddr *ifa)
+static void inet_free_ifa(struct in_ifaddr *ifa)
{
call_rcu(&ifa->rcu_head, inet_rcu_free_ifa);
}
@@ -659,7 +656,7 @@ static int inet_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg
* Determine a default network mask, based on the IP address.
*/
-static inline int inet_abc_len(__be32 addr)
+static int inet_abc_len(__be32 addr)
{
int rc = -1; /* Something else, probably a multicast. */
@@ -1124,7 +1121,7 @@ skip:
}
}
-static inline bool inetdev_valid_mtu(unsigned int mtu)
+static bool inetdev_valid_mtu(unsigned int mtu)
{
return mtu >= 68;
}
@@ -1239,7 +1236,7 @@ static struct notifier_block ip_netdev_notifier = {
.notifier_call = inetdev_event,
};
-static inline size_t inet_nlmsg_size(void)
+static size_t inet_nlmsg_size(void)
{
return NLMSG_ALIGN(sizeof(struct ifaddrmsg))
+ nla_total_size(4) /* IFA_ADDRESS */
^ permalink raw reply related
* [PATCH net-next] net: skb_share_check() should use consume_skb()
From: Eric Dumazet @ 2012-08-04 6:54 UTC (permalink / raw)
To: David Miller; +Cc: netdev
From: Eric Dumazet <edumazet@google.com>
In order to avoid false drop_monitor indications, we should
call consume_skb() if skb_clone() was successful.
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
include/linux/skbuff.h | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 7632c87..b33a3a1 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -846,13 +846,16 @@ static inline int skb_shared(const struct sk_buff *skb)
*
* NULL is returned on a memory allocation failure.
*/
-static inline struct sk_buff *skb_share_check(struct sk_buff *skb,
- gfp_t pri)
+static inline struct sk_buff *skb_share_check(struct sk_buff *skb, gfp_t pri)
{
might_sleep_if(pri & __GFP_WAIT);
if (skb_shared(skb)) {
struct sk_buff *nskb = skb_clone(skb, pri);
- kfree_skb(skb);
+
+ if (likely(nskb))
+ consume_skb(skb);
+ else
+ kfree_skb(skb);
skb = nskb;
}
return skb;
^ permalink raw reply related
* Re: TCP stalls with 802.3ad + bridge + kvm guest
From: Jesse Brandeburg @ 2012-08-04 5:04 UTC (permalink / raw)
To: Peter Samuelson; +Cc: Jay Vosburgh, netdev, jgoerzen
In-Reply-To: <20120801144104.GN17572@p12n.org>
On Wed, Aug 1, 2012 at 7:41 AM, Peter Samuelson <psamuelson@efolder.net> wrote:
>
> [Peter Samuelson]
>> > ixgbe [10 Gbit port] -- bonding [802.3ad] -- bridge -- KVM guest
>> >
>> >It all works, except that with some flows in the KVM guest - I
>> >can reproduce using smbclient - transfers keep stalling, such that I'm
>> >averaging well under 1 MB/s. Should be more like 100 MB/s.
>> >
>> >Oddly, this only occurs when both the 802.3ad and KVM are used:
is it because offloads are enabled? I had to disable several of them
to get my virtual machines to work on both igb and ixgbe interfaces, I
haven't gone any further to isolate why.
try
# ethtool -K ethx tso off gso off lro off
^ permalink raw reply
* (unknown),
From: Yeung Lap Ming @ 2012-08-04 3:41 UTC (permalink / raw)
I have a deal. Reply for details.
^ permalink raw reply
* Re: [PATCH 0/2] Add device tree support and resolving SOC dependency to cpsw driver
From: David Miller @ 2012-08-04 3:42 UTC (permalink / raw)
To: mugunthanvnm; +Cc: netdev
In-Reply-To: <1343679434-2369-1-git-send-email-mugunthanvnm@ti.com>
From: Mugunthan V N <mugunthanvnm@ti.com>
Date: Tue, 31 Jul 2012 01:47:12 +0530
> This patch set adds SOC dependency for CPSW dependent modules and adds support
> for device tree for CPSW driver
>
> Mugunthan V N (2):
> drivers: net: ethernet: cpsw: Add SOC dependency support for cpsw
> dependent modules
> drivers: net: ethernet: cpsw: Add device tree support to CPSW
Both applied to net-next, thanks.
^ 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