Netdev List
 help / color / mirror / Atom feed
* Re: 3.7-rc2 regression : file copied to CIFS-mounted directory corrupted
From: Eric Dumazet @ 2012-10-23  6:08 UTC (permalink / raw)
  To: jongman.heo
  Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	edumazet@google.com
In-Reply-To: <22207427.56211350970373630.JavaMail.weblogic@epml04>

On Tue, 2012-10-23 at 05:38 +0000, Jongman Heo wrote:
> Hmm,
> 
> I've just met the issue, with the commit 5640f768 reverted.
> It seems that the issue does not always happen. So, my bisection may not be correct.
> 
> At this moment, I don't have enough time to do bisection again..
> 
> Regards.

What happens, if instead of reverting you try the following ?

If this solves the problem, then we shall find the driver that assumes
frags are order-0 pages only.

diff --git a/net/core/sock.c b/net/core/sock.c
index 8a146cf..a743e7c 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1726,7 +1726,7 @@ struct sk_buff *sock_alloc_send_skb(struct sock *sk, unsigned long size,
 EXPORT_SYMBOL(sock_alloc_send_skb);
 
 /* On 32bit arches, an skb frag is limited to 2^15 */
-#define SKB_FRAG_PAGE_ORDER	get_order(32768)
+#define SKB_FRAG_PAGE_ORDER	0
 
 bool sk_page_frag_refill(struct sock *sk, struct page_frag *pfrag)
 {

^ permalink raw reply related

* Re: ipv4 gro receive IHL
From: David Miller @ 2012-10-23  6:27 UTC (permalink / raw)
  To: eric.dumazet; +Cc: edumazet, netdev
In-Reply-To: <1350972094.8609.1420.camel@edumazet-glaptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 23 Oct 2012 08:01:34 +0200

> GRO on IPv4 only supports ihl = 5, this is tested in :
> 
> if (*(u8 *)iph != 0x45)
>     goto out_unlock;
> 
> I also was planning to add some code to ip_fast_csum(addr, X) to have a
> fast path (no conditional jump) for the case where X is the constant 5

Oh indeed, thanks for clearing that up.

^ permalink raw reply

* Re: [PATCH 0/3] pch_gbe: fix CRC errors and improve speed
From: David Miller @ 2012-10-23  6:31 UTC (permalink / raw)
  To: vfalico
  Cc: netdev, richardcochran, tshimizu818, andy.cress, erwan.velu,
	agospoda
In-Reply-To: <1350917005-26350-1-git-send-email-vfalico@redhat.com>

From: Veaceslav Falico <vfalico@redhat.com>
Date: Mon, 22 Oct 2012 16:43:22 +0200

> This patch series tries to get rid of CRC errors and other instability
> caused by wrong RX_FIFO overrun processing. It also cleans the code a bit.
> 
> Now (without the patch applied) on high number of incoming packets and/or
> stressed system pch_gbe driver reports CRC errors and huge numbers of
> RX_FIFO_ERR (overruns). It also sometimes just freezes (caused by not
> waiting enough on DMA_RX to stop before issuing a reset on MAC_RX logic).
> 
> This patchset removes the unneeded (as per datasheet) MAC_RX reset and
> corrects the processing of RX_FIFO_ERR in pch_gbe_napi_poll().
> 
> With the patchset applied there are no more CRC errors, sane number of
> RX_FIFO_ERR and improved speed/stability. The patchset was tested on
> Informix SYS940X and Kontron Tunnel Creek EG20T on 1gbps direct-connected
> link and different rx/tx descriptors count.

All applied to 'net', thanks.

^ permalink raw reply

* Re: [PATCH] Make hmac algorithm selection for cookie generation dynamic
From: David Miller @ 2012-10-23  6:32 UTC (permalink / raw)
  To: nhorman; +Cc: linux-sctp, vyasevich, netdev
In-Reply-To: <1350661926-8312-1-git-send-email-nhorman@tuxdriver.com>

From: Neil Horman <nhorman@tuxdriver.com>
Date: Fri, 19 Oct 2012 11:52:06 -0400

> Currently sctp allows for the optional use of md5 of sha1 hmac algorithms to
> generate cookie values when establishing new connections via two build time
> config options.  Theres no real reason to make this a static selection.  We can
> add a sysctl that allows for the dynamic selection of these algorithms at run
> time, with the default value determined by the corresponding crypto library
> config options.  It saves us two needless configuration settings and enables the
> freedom for administrators to select which algorithm a particular system uses.
> This comes in handy when, for example running a system in FIPS mode, where use
> of md5 is disallowed, but SHA1 is permitted.
> 
> Note: This new sysctl has no corresponding socket option to select the cookie
> hmac algorithm.  I chose not to implement that intentionally, as RFC 6458
> contains no option for this value, and I opted not to pollute the socket option
> namespace.
> 
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>

Neil, please use appropriate subject prefixes in your patch
submissions.  In this case "sctp: " would have been appropriate.

Vlad, this patch looks fine to me, but I'd like you to review
it too before I apply it.

Thanks.

^ permalink raw reply

* Re: [PATCH v2] MAINTAINERS: NETWORKING DRIVERS matches too much
From: David Miller @ 2012-10-23  6:33 UTC (permalink / raw)
  To: khali; +Cc: netdev, joe, akpm
In-Reply-To: <20121018221138.66b43fed@endymion.delvare>

From: Jean Delvare <khali@linux-fr.org>
Date: Thu, 18 Oct 2012 22:11:38 +0200

> File pattern include/linux/*device.h matches too much, including
> completely unrelated files. Replace it with an explicit list of
> network device-related header files.
> 
> Signed-off-by: Jean Delvare <khali@linux-fr.org>
> Cc: Joe Perches <joe@perches.com>
> Acked-by: David S. Miller <davem@davemloft.net>

Applied, thanks Jean.

^ permalink raw reply

* Re: [PATCH] vlan: set sysfs device_type to 'vlan'
From: David Miller @ 2012-10-23  6:36 UTC (permalink / raw)
  To: cardoe; +Cc: kaber, netdev, systemd-devel, linux-kernel
In-Reply-To: <1350885237-12998-1-git-send-email-cardoe@cardoe.com>

From: Doug Goldstein <cardoe@cardoe.com>
Date: Mon, 22 Oct 2012 00:53:57 -0500

> Sets the sysfs device_type to 'vlan' for udev. This makes it easier for
> applications that query network information via udev to identify vlans
> instead of using strrchr().
> 
> Signed-off-by: Doug Goldstein <cardoe@cardoe.com>

You're extremely misguided.  This change, in fact, makes it ten times
harder for such applications to query such devices.

Because now the application has to decide whether it wants to support
EVERY EXISTING SYSTEM OUT THERE or not.  Hundreds of millions of Linux
systems do not provide this attribute.

Applications have to handle the case of not having the 'vlan' device
type available attribute essentially forever.

So providing it in new kernels provides zero value whatsoever.

I'm not applying this patch, sorry.

^ permalink raw reply

* Re: [PATCH net-next v8 1/1] ipv6: add support of equal cost multipath (ECMP)
From: David Miller @ 2012-10-23  6:39 UTC (permalink / raw)
  To: nicolas.dichtel; +Cc: joe, bernat, netdev, yoshfuji, eric.dumazet
In-Reply-To: <1350913329-4044-2-git-send-email-nicolas.dichtel@6wind.com>

From: nicolas.dichtel@6wind.com
Date: Mon, 22 Oct 2012 15:42:09 +0200

> From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> 
> Each nexthop is added like a single route in the routing table. All routes
> that have the same metric/weight and destination but not the same gateway
> are considering as ECMP routes. They are linked together, through a list called
> rt6i_siblings.
> 
> ECMP routes can be added in one shot, with RTA_MULTIPATH attribute or one after
> the other (in both case, the flag NLM_F_EXCL should not be set).
> 
> The patch is based on a previous work from
> Luc Saillard <luc.saillard@6wind.com>.
> 
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH v3 0/4] make cadence ethernet drivers build on any architecture
From: David Miller @ 2012-10-23  6:40 UTC (permalink / raw)
  To: manabian
  Cc: nicolas.ferre, hskinnemoen, egtvedt, plagnioj, bgat, netdev,
	linux-arm-kernel
In-Reply-To: <1350931534-8416-1-git-send-email-manabian@gmail.com>

From: Joachim Eastwood <manabian@gmail.com>
Date: Mon, 22 Oct 2012 20:45:30 +0200

> Joachim Eastwood (4):
>   net/macb: fix truncate warnings
>   net/cadence: get rid of HAVE_NET_MACB
>   net/at91_ether: select MACB in Kconfig
>   net/at91_ether: add pdata flag for reverse Eth addr

All applied to net-next, thanks a lot.

^ permalink raw reply

* Re: [PATCH v2 net-next 00/13] Adding a USB CDC MBIM driver
From: David Miller @ 2012-10-23  6:41 UTC (permalink / raw)
  To: bjorn
  Cc: netdev, linux-usb, oliver, gregkh, alexey.orishko, gpsuarez2512,
	fangxiaozhi, dcbw, aleksander
In-Reply-To: <1350939400-27209-1-git-send-email-bjorn@mork.no>

From: Bjørn Mork <bjorn@mork.no>
Date: Mon, 22 Oct 2012 22:56:27 +0200

> The USB Communications Device Class "Mobile Broadband Interface Model"
> (MBIM) is the USB-IFs alternative to the current chipset/vendor
> specific solutions to "Mobile Broadband" device management. The
> specification, including the management protocol description, can be
> downloaded from http://www.usb.org/developers/devclass_docs#approved
> 
> This driver implementing most MBIM features with the exception of
> 32bit NTB and NDP headers.

All applied to net-next, thanks.

^ permalink raw reply

* Re: [PATCH] tcp: Reject invalid ack_seq to Fast Open sockets
From: David Miller @ 2012-10-23  6:43 UTC (permalink / raw)
  To: hkchu; +Cc: netdev, ncardwell, ycheng
In-Reply-To: <1350941196-31224-1-git-send-email-hkchu@google.com>

From: "H.K. Jerry Chu" <hkchu@google.com>
Date: Mon, 22 Oct 2012 14:26:36 -0700

> From: Jerry Chu <hkchu@google.com>
> 
> A packet with an invalid ack_seq may cause a TCP Fast Open socket to switch
> to the unexpected TCP_CLOSING state, triggering a BUG_ON kernel panic.
> 
> When a FIN packet with an invalid ack_seq# arrives at a socket in
> the TCP_FIN_WAIT1 state, rather than discarding the packet, the current
> code will accept the FIN, causing state transition to TCP_CLOSING.
> 
> This may be a small deviation from RFC793, which seems to say that the
> packet should be dropped. Unfortunately I did not expect this case for
> Fast Open hence it will trigger a BUG_ON panic.
> 
> It turns out there is really nothing bad about a TFO socket going into
> TCP_CLOSING state so I could just remove the BUG_ON statements. But after
> some thought I think it's better to treat this case like TCP_SYN_RECV
> and return a RST to the confused peer who caused the unacceptable ack_seq
> to be generated in the first place.
> 
> Signed-off-by: H.K. Jerry Chu <hkchu@google.com>

Applied, thanks.

> -		BUG_ON(sk->sk_state != TCP_SYN_RECV &&
> +		WARN_ON_ONCE(sk->sk_state != TCP_SYN_RECV &&
>  		    sk->sk_state != TCP_FIN_WAIT1);

I fixed up the indentation of the second line of the test when I
applied this.

^ permalink raw reply

* [PATCH v2 net-next 1/2] r8169: enable ALDPS for power saving
From: Hayes Wang @ 2012-10-23  6:47 UTC (permalink / raw)
  To: romieu; +Cc: netdev, linux-kernel, Hayes Wang
In-Reply-To: <1350893153-18320-1-git-send-email-hayeswang@realtek.com>

Enable ALDPS function to save power when link down. Note that the
feature should be set after the other PHY settings. And the firmware
is necessary. Don't enable it without loading the firmware.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
 drivers/net/ethernet/realtek/r8169.c | 62 ++++++++++++++++++++++++++++++------
 1 file changed, 52 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index e7ff886..cdd46de 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -687,6 +687,7 @@ enum features {
 	RTL_FEATURE_WOL		= (1 << 0),
 	RTL_FEATURE_MSI		= (1 << 1),
 	RTL_FEATURE_GMII	= (1 << 2),
+	RTL_FEATURE_EXTENDED	= (1 << 3),
 };
 
 struct rtl8169_counters {
@@ -2394,8 +2395,10 @@ static void rtl_apply_firmware(struct rtl8169_private *tp)
 	struct rtl_fw *rtl_fw = tp->rtl_fw;
 
 	/* TODO: release firmware once rtl_phy_write_fw signals failures. */
-	if (!IS_ERR_OR_NULL(rtl_fw))
+	if (!IS_ERR_OR_NULL(rtl_fw)) {
 		rtl_phy_write_fw(tp, rtl_fw);
+		tp->features |= RTL_FEATURE_EXTENDED;
+	}
 }
 
 static void rtl_apply_firmware_cond(struct rtl8169_private *tp, u8 reg, u16 val)
@@ -2406,6 +2409,31 @@ static void rtl_apply_firmware_cond(struct rtl8169_private *tp, u8 reg, u16 val)
 		rtl_apply_firmware(tp);
 }
 
+static void r810x_aldps_disable(struct rtl8169_private *tp)
+{
+	rtl_writephy(tp, 0x1f, 0x0000);
+	rtl_writephy(tp, 0x18, 0x0310);
+	msleep(100);
+}
+
+static void r810x_aldps_enable(struct rtl8169_private *tp)
+{
+	if (!(tp->features & RTL_FEATURE_EXTENDED))
+		return;
+
+	rtl_writephy(tp, 0x1f, 0x0000);
+	rtl_writephy(tp, 0x18, 0x8310);
+}
+
+static void r8168_aldps_enable_1(struct rtl8169_private *tp)
+{
+	if (!(tp->features & RTL_FEATURE_EXTENDED))
+		return;
+
+	rtl_writephy(tp, 0x1f, 0x0000);
+	rtl_w1w0_phy(tp, 0x15, 0x1000, 0x0000);
+}
+
 static void rtl8169s_hw_phy_config(struct rtl8169_private *tp)
 {
 	static const struct phy_reg phy_reg_init[] = {
@@ -3178,6 +3206,9 @@ static void rtl8168e_2_hw_phy_config(struct rtl8169_private *tp)
 	rtl_w1w0_phy(tp, 0x19, 0x0000, 0x0001);
 	rtl_w1w0_phy(tp, 0x10, 0x0000, 0x0400);
 	rtl_writephy(tp, 0x1f, 0x0000);
+
+	/* ALDPS enable */
+	r8168_aldps_enable_1(tp);
 }
 
 static void rtl8168f_hw_phy_config(struct rtl8169_private *tp)
@@ -3250,6 +3281,9 @@ static void rtl8168f_1_hw_phy_config(struct rtl8169_private *tp)
 	rtl_writephy(tp, 0x05, 0x8b85);
 	rtl_w1w0_phy(tp, 0x06, 0x4000, 0x0000);
 	rtl_writephy(tp, 0x1f, 0x0000);
+
+	/* ALDPS enable */
+	r8168_aldps_enable_1(tp);
 }
 
 static void rtl8168f_2_hw_phy_config(struct rtl8169_private *tp)
@@ -3257,6 +3291,9 @@ static void rtl8168f_2_hw_phy_config(struct rtl8169_private *tp)
 	rtl_apply_firmware(tp);
 
 	rtl8168f_hw_phy_config(tp);
+
+	/* ALDPS enable */
+	r8168_aldps_enable_1(tp);
 }
 
 static void rtl8411_hw_phy_config(struct rtl8169_private *tp)
@@ -3354,6 +3391,9 @@ static void rtl8411_hw_phy_config(struct rtl8169_private *tp)
 	rtl_w1w0_phy(tp, 0x19, 0x0000, 0x0001);
 	rtl_w1w0_phy(tp, 0x10, 0x0000, 0x0400);
 	rtl_writephy(tp, 0x1f, 0x0000);
+
+	/* ALDPS enable */
+	r8168_aldps_enable_1(tp);
 }
 
 static void rtl8168g_1_hw_phy_config(struct rtl8169_private *tp)
@@ -3439,21 +3479,19 @@ static void rtl8105e_hw_phy_config(struct rtl8169_private *tp)
 	};
 
 	/* Disable ALDPS before ram code */
-	rtl_writephy(tp, 0x1f, 0x0000);
-	rtl_writephy(tp, 0x18, 0x0310);
-	msleep(100);
+	r810x_aldps_disable(tp);
 
 	rtl_apply_firmware(tp);
 
 	rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+
+	r810x_aldps_enable(tp);
 }
 
 static void rtl8402_hw_phy_config(struct rtl8169_private *tp)
 {
 	/* Disable ALDPS before setting firmware */
-	rtl_writephy(tp, 0x1f, 0x0000);
-	rtl_writephy(tp, 0x18, 0x0310);
-	msleep(20);
+	r810x_aldps_disable(tp);
 
 	rtl_apply_firmware(tp);
 
@@ -3463,6 +3501,8 @@ static void rtl8402_hw_phy_config(struct rtl8169_private *tp)
 	rtl_writephy(tp, 0x10, 0x401f);
 	rtl_writephy(tp, 0x19, 0x7030);
 	rtl_writephy(tp, 0x1f, 0x0000);
+
+	r810x_aldps_enable(tp);
 }
 
 static void rtl8106e_hw_phy_config(struct rtl8169_private *tp)
@@ -3475,9 +3515,7 @@ static void rtl8106e_hw_phy_config(struct rtl8169_private *tp)
 	};
 
 	/* Disable ALDPS before ram code */
-	rtl_writephy(tp, 0x1f, 0x0000);
-	rtl_writephy(tp, 0x18, 0x0310);
-	msleep(100);
+	r810x_aldps_disable(tp);
 
 	rtl_apply_firmware(tp);
 
@@ -3485,6 +3523,8 @@ static void rtl8106e_hw_phy_config(struct rtl8169_private *tp)
 	rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
 
 	rtl_eri_write(tp, 0x1d0, ERIAR_MASK_0011, 0x0000, ERIAR_EXGMAC);
+
+	r810x_aldps_enable(tp);
 }
 
 static void rtl_hw_phy_config(struct net_device *dev)
@@ -6391,6 +6431,8 @@ static void rtl8169_net_suspend(struct net_device *dev)
 {
 	struct rtl8169_private *tp = netdev_priv(dev);
 
+	tp->features &= ~RTL_FEATURE_EXTENDED;
+
 	if (!netif_running(dev))
 		return;
 
-- 
1.7.11.4

^ permalink raw reply related

* [PATCH v2 net-next 2/2] r8169: update the settings for RTL8111G
From: Hayes Wang @ 2012-10-23  6:47 UTC (permalink / raw)
  To: romieu; +Cc: netdev, linux-kernel, Hayes Wang
In-Reply-To: <1350974831-1438-1-git-send-email-hayeswang@realtek.com>

Update the parameters of RTL8111G

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
 drivers/net/ethernet/realtek/r8169.c | 118 ++++++++++++++++++++++++++++++-----
 1 file changed, 101 insertions(+), 17 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index cdd46de..3a393f7 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -335,6 +335,7 @@ enum rtl_registers {
 #define	RXCFG_FIFO_SHIFT		13
 					/* No threshold before first PCI xfer */
 #define	RX_FIFO_THRESH			(7 << RXCFG_FIFO_SHIFT)
+#define	RX_EARLY_OFF			(1 << 11)
 #define	RXCFG_DMA_SHIFT			8
 					/* Unlimited maximum PCI burst. */
 #define	RX_DMA_BURST			(7 << RXCFG_DMA_SHIFT)
@@ -2434,6 +2435,15 @@ static void r8168_aldps_enable_1(struct rtl8169_private *tp)
 	rtl_w1w0_phy(tp, 0x15, 0x1000, 0x0000);
 }
 
+static void r8168_aldps_enable_2(struct rtl8169_private *tp)
+{
+	if (!(tp->features & RTL_FEATURE_EXTENDED))
+		return;
+
+	rtl_writephy(tp, 0x1f, 0x0a43);
+	rtl_w1w0_phy(tp, 0x10, 0x0004, 0x0000);
+}
+
 static void rtl8169s_hw_phy_config(struct rtl8169_private *tp)
 {
 	static const struct phy_reg phy_reg_init[] = {
@@ -3400,29 +3410,57 @@ static void rtl8168g_1_hw_phy_config(struct rtl8169_private *tp)
 {
 	static const u16 mac_ocp_patch[] = {
 		0xe008, 0xe01b, 0xe01d, 0xe01f,
-		0xe021, 0xe023, 0xe025, 0xe027,
+		0xe022, 0xe025, 0xe031, 0xe04d,
 		0x49d2, 0xf10d, 0x766c, 0x49e2,
 		0xf00a, 0x1ec0, 0x8ee1, 0xc60a,
-
 		0x77c0, 0x4870, 0x9fc0, 0x1ea0,
 		0xc707, 0x8ee1, 0x9d6c, 0xc603,
 		0xbe00, 0xb416, 0x0076, 0xe86c,
-		0xc602, 0xbe00, 0x0000, 0xc602,
-
-		0xbe00, 0x0000, 0xc602, 0xbe00,
-		0x0000, 0xc602, 0xbe00, 0x0000,
-		0xc602, 0xbe00, 0x0000, 0xc602,
-		0xbe00, 0x0000, 0xc602, 0xbe00,
-
-		0x0000, 0x0000, 0x0000, 0x0000
+		0xc602, 0xbe00, 0xa000, 0xc602,
+		0xbe00, 0x0000, 0x1b76, 0xc202,
+		0xba00, 0x059c, 0x1b76, 0xc602,
+		0xbe00, 0x065a, 0x74e6, 0x1b78,
+		0x46dc, 0x1300, 0xf005, 0x74f8,
+		0x48c3, 0x48c4, 0x8cf8, 0x64e7,
+		0xc302, 0xbb00, 0x06a0, 0x74e4,
+		0x49c5, 0xf106, 0x49c6, 0xf107,
+		0x48c8, 0x48c9, 0xe011, 0x48c9,
+		0x4848, 0xe00e, 0x4848, 0x49c7,
+		0xf00a, 0x48c9, 0xc60d, 0x1d1f,
+		0x8dc2, 0x1d00, 0x8dc3, 0x1d11,
+		0x8dc0, 0xe002, 0x4849, 0x94e5,
+		0xc602, 0xbe00, 0x01f0, 0xe434,
+		0x49d9, 0xf01b, 0xc31e, 0x7464,
+		0x49c4, 0xf114, 0xc31b, 0x6460,
+		0x14fa, 0xfa02, 0xe00f, 0xc317,
+		0x7460, 0x49c0, 0xf10b, 0xc311,
+		0x7462, 0x48c1, 0x9c62, 0x4841,
+		0x9c62, 0xc30a, 0x1c04, 0x8c60,
+		0xe004, 0x1c15, 0xc305, 0x8c60,
+		0xc602, 0xbe00, 0x0384, 0xe434,
+		0xe030, 0xe61c, 0xe906
 	};
 	u32 i;
 
 	/* Patch code for GPHY reset */
+	r8168_mac_ocp_write(tp, 0xfc26, 0x0000);
+	r8168_mac_ocp_write(tp, 0xfc28, 0x0000);
+	r8168_mac_ocp_write(tp, 0xfc2a, 0x0000);
+	r8168_mac_ocp_write(tp, 0xfc2c, 0x0000);
+	r8168_mac_ocp_write(tp, 0xfc2e, 0x0000);
+	r8168_mac_ocp_write(tp, 0xfc30, 0x0000);
+	r8168_mac_ocp_write(tp, 0xfc32, 0x0000);
+	r8168_mac_ocp_write(tp, 0xfc34, 0x0000);
+	r8168_mac_ocp_write(tp, 0xfc36, 0x0000);
 	for (i = 0; i < ARRAY_SIZE(mac_ocp_patch); i++)
-		r8168_mac_ocp_write(tp, 0xf800 + 2*i, mac_ocp_patch[i]);
+		r8168_mac_ocp_write(tp, 0xf800 + 2 * i, mac_ocp_patch[i]);
 	r8168_mac_ocp_write(tp, 0xfc26, 0x8000);
 	r8168_mac_ocp_write(tp, 0xfc28, 0x0075);
+	r8168_mac_ocp_write(tp, 0xfc2e, 0x059b);
+	r8168_mac_ocp_write(tp, 0xfc30, 0x0659);
+	r8168_mac_ocp_write(tp, 0xfc32, 0x069f);
+	r8168_mac_ocp_write(tp, 0xfc34, 0x01cd);
+	r8168_mac_ocp_write(tp, 0xfc36, 0x0303);
 
 	rtl_apply_firmware(tp);
 
@@ -3436,13 +3474,46 @@ static void rtl8168g_1_hw_phy_config(struct rtl8169_private *tp)
 	else
 		rtl_w1w0_phy_ocp(tp, 0xbcc4, 0x0000, 0x0002);
 
-	rtl_w1w0_phy_ocp(tp, 0xa442, 0x000c, 0x0000);
-	rtl_w1w0_phy_ocp(tp, 0xa4b2, 0x0004, 0x0000);
+	/* Enable PHY auto speed down */
+	rtl_writephy(tp, 0x1f, 0x0a44);
+	rtl_w1w0_phy(tp, 0x11, 0x000c, 0x0000);
+
+	rtl_writephy(tp, 0x1f, 0x0bcc);
+	rtl_w1w0_phy(tp, 0x14, 0x0100, 0x0000);
+	rtl_writephy(tp, 0x1f, 0x0a44);
+	rtl_w1w0_phy(tp, 0x11, 0x00c0, 0x0000);
+	rtl_writephy(tp, 0x1f, 0x0a43);
+	rtl_writephy(tp, 0x13, 0x8084);
+	rtl_w1w0_phy(tp, 0x14, 0x0000, 0x6000);
+	rtl_w1w0_phy(tp, 0x10, 0x1003, 0x0000);
+
+	/* EEE auto-fallback function */
+	rtl_writephy(tp, 0x1f, 0x0a4b);
+	rtl_w1w0_phy(tp, 0x11, 0x0004, 0x0000);
+
+	/* Enable UC LPF tune function */
+	rtl_writephy(tp, 0x1f, 0x0a43);
+	rtl_writephy(tp, 0x13, 0x8012);
+	rtl_w1w0_phy(tp, 0x14, 0x8000, 0x0000);
+
+	rtl_writephy(tp, 0x1f, 0x0c42);
+	rtl_w1w0_phy(tp, 0x11, 0x4000, 0x2000);
 
-	r8168_phy_ocp_write(tp, 0xa436, 0x8012);
-	rtl_w1w0_phy_ocp(tp, 0xa438, 0x8000, 0x0000);
+	/* Improve SWR Efficiency */
+	rtl_writephy(tp, 0x1f, 0x0bcd);
+	rtl_writephy(tp, 0x14, 0x5065);
+	rtl_writephy(tp, 0x14, 0xd065);
+	rtl_writephy(tp, 0x1f, 0x0bc8);
+	rtl_writephy(tp, 0x11, 0x5655);
+	rtl_writephy(tp, 0x1f, 0x0bcd);
+	rtl_writephy(tp, 0x14, 0x1065);
+	rtl_writephy(tp, 0x14, 0x9065);
+	rtl_writephy(tp, 0x14, 0x1065);
 
-	rtl_w1w0_phy_ocp(tp, 0xc422, 0x4000, 0x2000);
+	/* ALDPS enable */
+	r8168_aldps_enable_2(tp);
+
+	rtl_writephy(tp, 0x1f, 0x0000);
 }
 
 static void rtl8102e_hw_phy_config(struct rtl8169_private *tp)
@@ -4047,6 +4118,10 @@ static void r8168_pll_power_down(struct rtl8169_private *tp)
 	case RTL_GIGA_MAC_VER_33:
 		RTL_W8(PMCH, RTL_R8(PMCH) & ~0x80);
 		break;
+	case RTL_GIGA_MAC_VER_40:
+	case RTL_GIGA_MAC_VER_41:
+		RTL_W8(PMCH, RTL_R8(PMCH) & ~0x40);
+		break;
 	}
 }
 
@@ -4064,6 +4139,10 @@ static void r8168_pll_power_up(struct rtl8169_private *tp)
 	case RTL_GIGA_MAC_VER_33:
 		RTL_W8(PMCH, RTL_R8(PMCH) | 0x80);
 		break;
+	case RTL_GIGA_MAC_VER_40:
+	case RTL_GIGA_MAC_VER_41:
+		RTL_W8(PMCH, RTL_R8(PMCH) | 0x40);
+		break;
 	}
 
 	r8168_phy_power_up(tp);
@@ -4169,6 +4248,10 @@ static void rtl_init_rxcfg(struct rtl8169_private *tp)
 	case RTL_GIGA_MAC_VER_34:
 		RTL_W32(RxConfig, RX128_INT_EN | RX_MULTI_EN | RX_DMA_BURST);
 		break;
+	case RTL_GIGA_MAC_VER_40:
+	case RTL_GIGA_MAC_VER_41:
+		RTL_W32(RxConfig, RX128_INT_EN | RX_DMA_BURST | RX_EARLY_OFF);
+		break;
 	default:
 		RTL_W32(RxConfig, RX128_INT_EN | RX_DMA_BURST);
 		break;
@@ -5157,7 +5240,8 @@ static void rtl_hw_start_8168g_1(struct rtl8169_private *tp)
 	/* Adjust EEE LED frequency */
 	RTL_W8(EEE_LED, RTL_R8(EEE_LED) & ~0x07);
 
-	rtl_w1w0_eri(tp, 0x2fc, ERIAR_MASK_0001, 0x01, 0x02, ERIAR_EXGMAC);
+	rtl_w1w0_eri(tp, 0x2fc, ERIAR_MASK_0001, 0x01, 0x06, ERIAR_EXGMAC);
+	rtl_w1w0_eri(tp, 0x1b0, ERIAR_MASK_0011, 0x0000, 0x1000, ERIAR_EXGMAC);
 }
 
 static void rtl_hw_start_8168(struct net_device *dev)
-- 
1.7.11.4

^ permalink raw reply related

* Re: [PATCH net-next 01/15] 6lowpan: lowpan_is_iid_16_bit_compressable() does not detect compressable address correctly
From: David Miller @ 2012-10-23  6:49 UTC (permalink / raw)
  To: tony.cheneau; +Cc: netdev, linux-zigbee-devel, alan, alex.bluesman.smirnov
In-Reply-To: <1350965397-12384-2-git-send-email-tony.cheneau@amnesiak.org>

From: Tony Cheneau <tony.cheneau@amnesiak.org>
Date: Tue, 23 Oct 2012 00:09:43 -0400

> The current test is not RFC6282 compliant. The same issue has been found
> out and fixed in Contiki. This patch is basicaly a port of their fix.
> 
> Signed-off-by: Tony Cheneau <tony.cheneau@amnesiak.org>

It's really demoralizing to sit down to read a large 15 entry
patch series and this is the first thing I see:

>  /*
> - * check whether we can compress the IID to 16 bits,
> - * it's possible for unicast adresses with first 49 bits are zero only.
> - */
> +* check whether we can compress the IID to 16 bits,
> +* it's possible for unicast adresses with first 49 bits are zero only.
> +*/

Don't break the comment indentation, it was perfectly fine.

I'm not reviewing the rest of the series, you'll need to repost
the entire thing after you fix this.

And if you're smart you'll make sure there aren't similar coding
style issues in the rest of your patches, else it's going to take
a long time to merge this crap into the tree.

^ permalink raw reply

* Re: [net-next 00/12][pull request] Intel Wired LAN Driver Updates
From: David Miller @ 2012-10-23  6:51 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, gospo, sassmann
In-Reply-To: <1350966385-19020-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Mon, 22 Oct 2012 21:26:13 -0700

> This series contains updates to ixgbe only.  Only change to this series
> is I dropped the "ixgbe: Add support for pipeline reset" due to
> change requested by Martin Josefsson.
> 
> The following are changes since commit d94ce9b283736a876b2e6dec665c68e5e8b5d55e:
>   ipv4: 16 slots in initial fib_info hash table
> and are available in the git repository at:
>   git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master

Pulled, thanks Jeff.

^ permalink raw reply

* Re: [PATCH v2 1/3] pppoatm: don't send frames to destroyed vcc
From: David Miller @ 2012-10-23  6:52 UTC (permalink / raw)
  To: krzysiek; +Cc: dwmw2, netdev, linux-kernel
In-Reply-To: <1350926091-12642-1-git-send-email-krzysiek@podlesie.net>


David, if you could review this series I'd really appreciate it.

^ permalink raw reply

* [PATCH firmware] rtl_nic: update firmware for RTL8168G
From: Hayes Wang @ 2012-10-23  7:02 UTC (permalink / raw)
  To: dwmw2, ben; +Cc: romieu, netdev, linux-kernel, Hayes Wang

File: rtl_nic/rtl8168g-1.fw
Version: 0.0.3

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
 WHENCE                |   2 +-
 rtl_nic/rtl8168g-1.fw | Bin 4272 -> 4304 bytes
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/WHENCE b/WHENCE
index 6bc7417..2565fa2 100644
--- a/WHENCE
+++ b/WHENCE
@@ -1835,7 +1835,7 @@ File: rtl_nic/rtl8106e-1.fw
 Version: 0.0.1
 
 File: rtl_nic/rtl8168g-1.fw
-Version: 0.0.2
+Version: 0.0.3
 
 Licence:
  * Copyright © 2011, Realtek Semiconductor Corporation
diff --git a/rtl_nic/rtl8168g-1.fw b/rtl_nic/rtl8168g-1.fw
index bc03a5d28fd07d99a6cc89aa115d8ef8942629a6..2c628b03a7fa6cf58775a8ce22717f9d326d5336 100644
GIT binary patch
delta 470
zcmXw#O-NK>6o&5|uQ}IY{_tgj8f2!RMKnM6jt;{JE+!0j>ZX{L{Sf`2(BC4$#fyj|
zL5nybuEa&b6cojU2%6BvAh@d5krW7mF_R#O!I&O#I`Hv+oO9mi`_6fn{F+P|8V?>#
z6r6nFR>~RArnBi>!pUabT*h&aiW*n-oU#mK;d$zGwBWkqlXo88NH~4PzI?IYd0&3q
z6~6|yd|=`Y=<5KdX2E3pz9x;XlfI6MobV4scEEB8tZ47@9QZ}X{GQufQFjIWX@Eo1
z;F(=;dIS731pb@X+P+dP@W~7~qfVbEz4j+-54<Tq?6|cBzLI@=$-FF!-Rsc}MU}KI
zSk_0P;HEqaoDKfZE^BsEJ_iQO-`?NAZPT3ht_QnKb6X}uiD({Nih!Nw@gLs~%VOvX
zGGIfY=C@<;5uzb>_(E{IJx&ueT2c(>EDwy!{qV@Si;6Ht6r<}fzN^}*>uvp|s>8n6
zl4dxTU$_T8eF;`SfTM%pU=^(8bPucGYE9c-g9jzhUkB@ItH!{Unv^2vL$P`fjZQHA
Mv4^b#xf{832*S#rjsO4v

delta 480
zcmXv~T_~hs82!F67-Q$>(?Km4-{6X!@qI?Kel{1la>J@^8#j~-)UJdJxp6KqB{zC&
z+nX(gOj|1&O$v=7w|+_~HQSa_qP^r|vCp^cQ%~pZdCocSdEevEdMK<(jgEh6uwxAa
zVY}CgSdlu@dRuGTwRWAel<Jc%a%<Y~Lb%L`TCv{GLu37>-PlwgYpS<4;uHDhAHY8@
z(EI_qa=?*UF!XZXRk!)2uDe;4=V=aJgYi}{A>7OaxUb%OQm=n+f{$Os;X%}HaCjP=
z7KUq8#R|5oZbUN!>L*}(My6-a9{#l#Ru=rGioJ_^he~_1#zg{b6}2xecNkz+trS-J
z{!cS9&8oA)X8mW%cr~c&bE!$6SJ$u9jNde>!Nnk$t3O9vd#BR=kEj7J#ncJl7&{i1
zDinB=d*viiJ%OluN#3p&0-aL{4b+anHnGq;#YTQZI~6Ptl;r>LTu^w+zrZcQ15<V-
zV8GGdOOJq&EpX*4n4SY$l3=n6jJAM>JK#<Q`2A4AEQ|I@_#Uw2K;}v0P}@`8!D=-h
GZ2t?3ft#uT

-- 
1.7.11.4

^ permalink raw reply related

* Re: [PATCH net-next 01/15] 6lowpan: lowpan_is_iid_16_bit_compressable() does not detect compressable address correctly
From: Jan Ceuleers @ 2012-10-23  7:04 UTC (permalink / raw)
  To: Tony Cheneau
  Cc: David S. Miller, netdev, linux-zigbee-devel, Alan Ott,
	Alexander Smirnov
In-Reply-To: <1350965397-12384-2-git-send-email-tony.cheneau@amnesiak.org>

On 10/23/2012 06:09 AM, Tony Cheneau wrote:

>  #define lowpan_is_iid_16_bit_compressable(a)	\
>  	((((a)->s6_addr16[4]) == 0) &&		\
> -	 (((a)->s6_addr16[5]) == 0) &&		\
> -	 (((a)->s6_addr16[6]) == 0) &&		\
> -	 ((((a)->s6_addr[14]) & 0x80) == 0))
> +	 (((a)->s6_addr[10]) == 0) &&		\
> +	 (((a)->s6_addr[11]) == 0xff) &&	\
> +	 (((a)->s6_addr[12]) == 0xfe) &&	\
> +	 (((a)->s6_addr[13]) == 0))
> +
>  
>  /* multicast address */
>  #define is_addr_mcast(a) (((a)->s6_addr[0]) == 0xFF)
> 

Is the additional newline needed at the end of the #define?

^ permalink raw reply

* Re: [RFC PATCH net-next] qfq: handle the case that front slot is empty
From: Paolo Valente @ 2012-10-23  7:09 UTC (permalink / raw)
  To: Cong Wang; +Cc: netdev, Stephen Hemminger, Eric Dumazet, David S. Miller
In-Reply-To: <1350965711-4390-1-git-send-email-amwang@redhat.com>

The crash you reported is one of the problems I tried to solve with my last fixes.
After those fixes I could not reproduce this crash (and other crashes) any more, but of course I am still missing something.

Il giorno 23/ott/2012, alle ore 06:15, Cong Wang ha scritto:

> I am not sure if this patch fixes the real problem or just workarounds
> it. At least, after this patch I don't see the crash I reported any more.

It is actually a workaround: if the condition that triggers your workaround holds true, then the group data structure is already inconstent, and qfq is likely not to schedule classes correctly.
I will try to reproduce the crash with the steps you suggest, and try to understand what is still wrong as soon as I can.

Paolo

> 
> The problem is that in some cases the front slot can become empty,
> therefore qfq_slot_head() returns an invalid pointer (not NULL!).
> This patch just make it return NULL in such case.
> 
> What's more, in qfq_front_slot_remove(), it always clears
> bit 0 in full_slots, so we should ajust the bucket list with
> qfq_slot_scan() before that.
> 
> Cc: Paolo Valente <paolo.valente@unimore.it>
> Cc: Stephen Hemminger <shemminger@vyatta.com>
> Cc: Eric Dumazet <eric.dumazet@gmail.com>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <amwang@redhat.com>
> 
> ---
> diff --git a/net/sched/sch_qfq.c b/net/sched/sch_qfq.c
> index f0dd83c..8dfdd89 100644
> --- a/net/sched/sch_qfq.c
> +++ b/net/sched/sch_qfq.c
> @@ -680,24 +680,13 @@ static void qfq_slot_insert(struct qfq_group *grp, struct qfq_class *cl,
> /* Maybe introduce hlist_first_entry?? */
> static struct qfq_class *qfq_slot_head(struct qfq_group *grp)
> {
> +	if (hlist_empty(&grp->slots[grp->front]))
> +		return NULL;
> 	return hlist_entry(grp->slots[grp->front].first,
> 			   struct qfq_class, next);
> }
> 
> /*
> - * remove the entry from the slot
> - */
> -static void qfq_front_slot_remove(struct qfq_group *grp)
> -{
> -	struct qfq_class *cl = qfq_slot_head(grp);
> -
> -	BUG_ON(!cl);
> -	hlist_del(&cl->next);
> -	if (hlist_empty(&grp->slots[grp->front]))
> -		__clear_bit(0, &grp->full_slots);
> -}
> -
> -/*
>  * Returns the first full queue in a group. As a side effect,
>  * adjust the bucket list so the first non-empty bucket is at
>  * position 0 in full_slots.
> @@ -722,6 +711,19 @@ static struct qfq_class *qfq_slot_scan(struct qfq_group *grp)
> }
> 
> /*
> + * remove the entry from the front slot
> + */
> +static void qfq_front_slot_remove(struct qfq_group *grp)
> +{
> +	struct qfq_class *cl = qfq_slot_scan(grp);
> +
> +	BUG_ON(!cl);
> +	hlist_del(&cl->next);
> +	if (hlist_empty(&grp->slots[grp->front]))
> +		__clear_bit(0, &grp->full_slots);
> +}
> +
> +/*
>  * adjust the bucket list. When the start time of a group decreases,
>  * we move the index down (modulo QFQ_MAX_SLOTS) so we don't need to
>  * move the objects. The mask of occupied slots must be shifted
> @@ -794,6 +796,8 @@ static struct sk_buff *qfq_dequeue(struct Qdisc *sch)
> 	grp = qfq_ffs(q, q->bitmaps[ER]);
> 
> 	cl = qfq_slot_head(grp);
> +	if (!cl)
> +		return NULL;
> 	skb = qdisc_dequeue_peeked(cl->qdisc);
> 	if (!skb) {
> 		WARN_ONCE(1, "qfq_dequeue: non-workconserving leaf\n");
> @@ -1018,16 +1022,23 @@ static void qfq_deactivate_class(struct qfq_sched *q, struct qfq_class *cl)
> 		__clear_bit(grp->index, &q->bitmaps[ER]);
> 	} else if (hlist_empty(&grp->slots[grp->front])) {
> 		cl = qfq_slot_scan(grp);
> -		roundedS = qfq_round_down(cl->S, grp->slot_shift);
> -		if (grp->S != roundedS) {
> +		if (!cl) {
> 			__clear_bit(grp->index, &q->bitmaps[ER]);
> 			__clear_bit(grp->index, &q->bitmaps[IR]);
> 			__clear_bit(grp->index, &q->bitmaps[EB]);
> 			__clear_bit(grp->index, &q->bitmaps[IB]);
> -			grp->S = roundedS;
> -			grp->F = roundedS + (2ULL << grp->slot_shift);
> -			s = qfq_calc_state(q, grp);
> -			__set_bit(grp->index, &q->bitmaps[s]);
> +		} else {
> +			roundedS = qfq_round_down(cl->S, grp->slot_shift);
> +			if (grp->S != roundedS) {
> +				__clear_bit(grp->index, &q->bitmaps[ER]);
> +				__clear_bit(grp->index, &q->bitmaps[IR]);
> +				__clear_bit(grp->index, &q->bitmaps[EB]);
> +				__clear_bit(grp->index, &q->bitmaps[IB]);
> +				grp->S = roundedS;
> +				grp->F = roundedS + (2ULL << grp->slot_shift);
> +				s = qfq_calc_state(q, grp);
> +				__set_bit(grp->index, &q->bitmaps[s]);
> +			}
> 		}
> 	}
> 


--
Paolo Valente                                                 
Algogroup
Dipartimento di Ingegneria dell'Informazione		
Via Vignolese 905/b
41125 Modena - Italy        				  
homepage:  http://algo.ing.unimo.it/people/paolo/

^ permalink raw reply

* Re: [PATCH net-next 02/15] 6lowpan: next header is not properly set upon decompression of a UDP header.
From: Jan Ceuleers @ 2012-10-23  7:05 UTC (permalink / raw)
  To: Tony Cheneau
  Cc: David S. Miller, netdev, linux-zigbee-devel, Alan Ott,
	Alexander Smirnov
In-Reply-To: <1350965397-12384-3-git-send-email-tony.cheneau@amnesiak.org>

On 10/23/2012 06:09 AM, Tony Cheneau wrote:
> This causes a drop of the UDP packet.
> 
> Signed-off-by: Tony Cheneau <tony.cheneau@amnesiak.org>
> ---
>  net/ieee802154/6lowpan.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
> index 6d42c17..b53a71a4 100644
> --- a/net/ieee802154/6lowpan.c
> +++ b/net/ieee802154/6lowpan.c
> @@ -913,9 +913,12 @@ lowpan_process_data(struct sk_buff *skb)
>  	}
>  
>  	/* UDP data uncompression */
> -	if (iphc0 & LOWPAN_IPHC_NH_C)
> +	if (iphc0 & LOWPAN_IPHC_NH_C) {
>  		if (lowpan_uncompress_udp_header(skb))
>  			goto drop;
> +		hdr.nexthdr = UIP_PROTO_UDP;
> +	}
> +

Superfluous newline.

>  
>  	/* Not fragmented package */
>  	hdr.payload_len = htons(skb->len);
> 

^ permalink raw reply

* Re: [PATCH net-next 05/15] 6lowpan: use short IEEE 802.15.4 addresses for broadcast destination
From: Jan Ceuleers @ 2012-10-23  7:08 UTC (permalink / raw)
  To: Tony Cheneau
  Cc: David S. Miller, netdev, linux-zigbee-devel, Alan Ott,
	Alexander Smirnov
In-Reply-To: <1350965397-12384-6-git-send-email-tony.cheneau@amnesiak.org>

On 10/23/2012 06:09 AM, Tony Cheneau wrote:
> It is intended that the IEEE 802.15.4 standard uses the 0xFFFF short address (2
> bytes) for message broadcasting.
> 
> Signed-off-by: Tony Cheneau <tony.cheneau@amnesiak.org>
> ---
>  net/ieee802154/6lowpan.c |   21 +++++++++++++--------
>  1 files changed, 13 insertions(+), 8 deletions(-)
> 
> diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
> index 49d91df..8a2ee95 100644
> --- a/net/ieee802154/6lowpan.c
> +++ b/net/ieee802154/6lowpan.c
> @@ -577,21 +577,26 @@ static int lowpan_header_create(struct sk_buff *skb,
>  	 * this isn't implemented in mainline yet, so currently we assign 0xff
>  	 */
>  	{
> +		mac_cb(skb)->flags = IEEE802154_FC_TYPE_DATA;
> +
>  		/* prepare wpan address data */
>  		sa.addr_type = IEEE802154_ADDR_LONG;
>  		sa.pan_id = 0xff;
> -
> -		da.addr_type = IEEE802154_ADDR_LONG;
> -		da.pan_id = 0xff;
> -
> -		memcpy(&(da.hwaddr), daddr, 8);
>  		memcpy(&(sa.hwaddr), saddr, 8);
>  
> -		mac_cb(skb)->flags = IEEE802154_FC_TYPE_DATA;
> +		da.pan_id = 0xff;
> +		/* if the destination address is the broadcast address,
> +		   use short address */

David likes comments in the networking code to look

		/* Like
		 * this
		 */

Note that the comment is closed on a line by itself. There's an example
at the top of this hunk.

^ permalink raw reply

* Re: [PATCH net-next 06/15] 6lowpan: fix first fragment (FRAG1) handling
From: Jan Ceuleers @ 2012-10-23  7:19 UTC (permalink / raw)
  To: Tony Cheneau
  Cc: David S. Miller, netdev, linux-zigbee-devel, Alan Ott,
	Alexander Smirnov
In-Reply-To: <1350965397-12384-7-git-send-email-tony.cheneau@amnesiak.org>

On 10/23/2012 06:09 AM, Tony Cheneau wrote:
> The first fragment, FRAG1, must contain some payload according to the
> specs. However, as it is currently written, the first fragment will
> remain empty and only contain the 6lowpan headers.
> 
> This patch also extract the transport layer information from the first
> fragment. This information is later on use when uncompressing UDP
> header.
> 
> Signed-off-by: Tony Cheneau <tony.cheneau@amnesiak.org>
> ---
>  net/ieee802154/6lowpan.c |   54 +++++++++++++++++++++++++++++++++++----------
>  1 files changed, 42 insertions(+), 12 deletions(-)
> 
> diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
> index 8a2ee95..38cecaf 100644
> --- a/net/ieee802154/6lowpan.c
> +++ b/net/ieee802154/6lowpan.c
> @@ -654,7 +654,7 @@ static void lowpan_fragment_timer_expired(unsigned long entry_addr)
>  }
>  
>  static struct lowpan_fragment *
> -lowpan_alloc_new_frame(struct sk_buff *skb, u8 len, u16 tag)
> +lowpan_alloc_new_frame(struct sk_buff *skb, u16 len, u16 tag)
>  {
>  	struct lowpan_fragment *frame;
>  
> @@ -735,6 +735,18 @@ lowpan_process_data(struct sk_buff *skb)
>  		/* adds the 3 MSB to the 8 LSB to retrieve the 11 bits length */
>  		len = ((iphc0 & 7) << 8) | slen;
>  
> +		if ((iphc0 & LOWPAN_DISPATCH_MASK) == LOWPAN_DISPATCH_FRAG1) {
> +			pr_debug("%s received a FRAG1 packet (tag: %d, "
> +				 "size of the entire IP packet: %d)"
> +				 , __func__, tag, len);

There are several schools of thought on the relative importance of
observing the 80-character line limit versus breaking up string
constants (in an attempt to maintain grepability). I think the above is
fine but others (whose opinion matters more than mine) may or may not
agree. Whatever you decide here, please apply consistently throughout.

However, the comma ahead of the __func__ should be at the end of the
previous line.

(...)

> -	/* if payload length is zero, therefore it's a first fragment */
> -	hlen = (plen == 0 ? LOWPAN_FRAG1_HEAD_SIZE :  LOWPAN_FRAGN_HEAD_SIZE);
> +	hlen = (type == LOWPAN_DISPATCH_FRAG1 ? LOWPAN_FRAG1_HEAD_SIZE :
> +			LOWPAN_FRAGN_HEAD_SIZE);

The second line of this statement should be aligned as follows:

+	hlen = (type == LOWPAN_DISPATCH_FRAG1 ? LOWPAN_FRAG1_HEAD_SIZE :
+		LOWPAN_FRAGN_HEAD_SIZE);

So the L for LOWPAN_FRAGN_HEAD_SIZE should be underneath the t for type.

^ permalink raw reply

* Re: [PATCH net-next 11/15] 6lowpan: modify udp compression/uncompression to match the standard
From: Jan Ceuleers @ 2012-10-23  7:22 UTC (permalink / raw)
  To: Tony Cheneau
  Cc: David S. Miller, netdev, linux-zigbee-devel, Alan Ott,
	Alexander Smirnov
In-Reply-To: <1350965397-12384-12-git-send-email-tony.cheneau@amnesiak.org>

On 10/23/2012 06:09 AM, Tony Cheneau wrote:
> The previous code would just compress the UDP header and send the compressed
> UDP header along with the uncompressed one.
> 
> Signed-off-by: Tony Cheneau <tony.cheneau@amnesiak.org>
> ---
>  net/ieee802154/6lowpan.c |   36 +++++++++++++++++++++++++++++++++---
>  1 files changed, 33 insertions(+), 3 deletions(-)
> 
> diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
> index 9711038..9c7ac2e 100644
> --- a/net/ieee802154/6lowpan.c
> +++ b/net/ieee802154/6lowpan.c
(...)

>  		/* copy checksum */
>  		memcpy(&uh->check, &skb->data[0], 2);
>  		skb_pull(skb, 2);
> +
> +		/* UDP lenght needs to be infered from the lower layers
> +		   here, we obtain the hint from the remaining size of the
> +		   frame */
> +		uh->len = htons(skb->len + sizeof(struct udphdr));
> +		pr_debug("uncompressed UDP length: src = %d", uh->len);

Multi-line comment style as per earlier comment.

^ permalink raw reply

* email :(mrs.kangteobeng@rocketmail.com)
From: Fawn Moser @ 2012-10-23  7:34 UTC (permalink / raw)






Good Day,



I have a secured business proposal for you,contact me on my private email :(mrs.kangteobeng@rocketmail.com<mailto:mrs.kangteobeng@rocketmail.com>)

Your earliest response to this letter will be appreciated.



Yours Sincerely,
Mrs.Kang.

^ permalink raw reply

* [PATCH net-next] ipv6: tcp: clean up tcp_v6_early_demux() icsk variable
From: Eric Dumazet @ 2012-10-23  7:41 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Neal Cardwell

From: Neal Cardwell <ncardwell@google.com>

Remove an icsk variable, which by convention should refer to an
inet_connection_sock rather than an inet_sock. In the process, make
the tcp_v6_early_demux() code and formatting a bit more like
tcp_v4_early_demux(), to ease comparisons and maintenance.

Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/ipv6/tcp_ipv6.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 26175bf..bb6782e 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1741,11 +1741,11 @@ static void tcp_v6_early_demux(struct sk_buff *skb)
 		skb->destructor = sock_edemux;
 		if (sk->sk_state != TCP_TIME_WAIT) {
 			struct dst_entry *dst = sk->sk_rx_dst;
-			struct inet_sock *icsk = inet_sk(sk);
+
 			if (dst)
 				dst = dst_check(dst, inet6_sk(sk)->rx_dst_cookie);
 			if (dst &&
-			    icsk->rx_dst_ifindex == skb->skb_iif)
+			    inet_sk(sk)->rx_dst_ifindex == skb->skb_iif)
 				skb_dst_set_noref(skb, dst);
 		}
 	}

^ permalink raw reply related

* [PATCH net-next] ipv4: tcp: clean up tcp_v4_early_demux()
From: Eric Dumazet @ 2012-10-23  7:42 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Neal Cardwell

From: Eric Dumazet <edumazet@google.com>

Use same header helpers than tcp_v6_early_demux() because they
are a bit faster, and as they make IPv4/IPv6 versions look
the same.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
---
 net/ipv4/tcp_ipv4.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index ef998b0..694ea4c 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1918,7 +1918,6 @@ EXPORT_SYMBOL(tcp_v4_do_rcv);
 
 void tcp_v4_early_demux(struct sk_buff *skb)
 {
-	struct net *net = dev_net(skb->dev);
 	const struct iphdr *iph;
 	const struct tcphdr *th;
 	struct sock *sk;
@@ -1926,16 +1925,16 @@ void tcp_v4_early_demux(struct sk_buff *skb)
 	if (skb->pkt_type != PACKET_HOST)
 		return;
 
-	if (!pskb_may_pull(skb, ip_hdrlen(skb) + sizeof(struct tcphdr)))
+	if (!pskb_may_pull(skb, skb_transport_offset(skb) + sizeof(struct tcphdr)))
 		return;
 
 	iph = ip_hdr(skb);
-	th = (struct tcphdr *) ((char *)iph + ip_hdrlen(skb));
+	th = tcp_hdr(skb);
 
 	if (th->doff < sizeof(struct tcphdr) / 4)
 		return;
 
-	sk = __inet_lookup_established(net, &tcp_hashinfo,
+	sk = __inet_lookup_established(dev_net(skb->dev), &tcp_hashinfo,
 				       iph->saddr, th->source,
 				       iph->daddr, ntohs(th->dest),
 				       skb->skb_iif);

^ permalink raw reply related


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