* Re: [PATCH 0/4 v3 net-next] tg3: Add hwmon support
From: David Miller @ 2012-07-17 6:11 UTC (permalink / raw)
To: mchan; +Cc: netdev
In-Reply-To: <1342491842-29818-1-git-send-email-mchan@broadcom.com>
From: "Michael Chan" <mchan@broadcom.com>
Date: Mon, 16 Jul 2012 19:23:58 -0700
> David, I've removed the binary sysfs attribute and now use
> hwmon only. Please consider this patchset for net-next.
Applied, thanks Michael.
You might want to add some Kconfig logic so that it's easier
to get the hwmon stuff automatically when tg3 is selected.
^ permalink raw reply
* Re: [PATCH net-next] bnx2: Try to recover from PCI block reset
From: David Miller @ 2012-07-17 6:12 UTC (permalink / raw)
To: mchan; +Cc: netdev, nhorman
In-Reply-To: <1342484756-29615-1-git-send-email-mchan@broadcom.com>
From: "Michael Chan" <mchan@broadcom.com>
Date: Mon, 16 Jul 2012 17:25:56 -0700
> If the PCI block has reset, the memory enable bit will be reset and
> the device will not respond to MMIO access. bnx2_reset_task() currently
> will not recover when this happens. Add code to detect this condition
> and restore the PCI state. This scenario has been reported by some
> users.
>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
Applied, thanks Michael.
^ permalink raw reply
* Re: [PATCH 2/7] net-tcp: Fast Open client - cookie cache
From: David Miller @ 2012-07-17 6:15 UTC (permalink / raw)
To: ycheng; +Cc: hkchu, edumazet, ncardwell, sivasankar, netdev
In-Reply-To: <1342473410-6265-3-git-send-email-ycheng@google.com>
From: Yuchung Cheng <ycheng@google.com>
Date: Mon, 16 Jul 2012 14:16:45 -0700
> The Fast Open cookie cache is used by a TCP Fast Open client to store
> remote servers' Fast Open cookies. It stores one Fast Open cookie
> per IP (v4 or v6) and by default 1024 cookies total. The size is
> tunable via /proc/sys/net/ipv4/tcp_fastopen_cookies. Setting it to 0
> will flush the cache.
>
> The inetpeer cache also caches remote peer's information but the
> in-active cache entries are recycled on the scale of minutes. Therefore
> a separate storage is required but the lookup is done via inetpeer.
> Each inetpeer entry holds a cookie cache entry pointer (if TFO is used
> on that IP). On cache write, the cookie cache entry is allocated and
> stored in a list for LRU replacement. A spinlock protects any R/W
> operation on the cookie cache entry and the list.
>
> Signed-off-by: Yuchung Cheng <ycheng@google.com>
I would store these in the new tcp metrics cache.
Any argument against doing so wrt. expiry is bogus, because you can
implement whatever time limit you want using a jiffies based
expiration value.
^ permalink raw reply
* Re: [PATCH 1/7] net-tcp: Fast Open base
From: David Miller @ 2012-07-17 6:16 UTC (permalink / raw)
To: ycheng; +Cc: hkchu, edumazet, ncardwell, sivasankar, netdev
In-Reply-To: <1342473410-6265-2-git-send-email-ycheng@google.com>
From: Yuchung Cheng <ycheng@google.com>
Date: Mon, 16 Jul 2012 14:16:44 -0700
> +#define TCPOPT_EXP 254 /* Experimental */
> +/* Magic number to be after the option value for sharing TCP
> + * experimental options. See draft-ietf-tcpm-experimental-options-00.txt
> + */
> +#define TCPOPT_FASTOPEN_MAGIC 0xF989
If I apply this, we're stuck supporting this experimental number
forever.
Because somewhere, someone will have a kernel running using this
number, so we have to support this option value as well as whatever
the official one is.
Therefore I think the only logical thing we can do is only deploy
this once an official option number is choosen.
^ permalink raw reply
* Re: [net 0/2][pull request] Intel Wired LAN Driver Updates
From: David Miller @ 2012-07-17 6:20 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, sassmann
In-Reply-To: <1342252063-27023-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Sat, 14 Jul 2012 00:47:41 -0700
> This series contains fixes to e1000e.
>
> The following are changes since commit 7ac2908e4b2edaec60e9090ddb4d9ceb76c05e7d:
> sch_sfb: Fix missing NULL check
> and are available in the git repository at:
> git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net master
>
> Bruce Allan (1):
> e1000e: fix test for PHY being accessible on 82577/8/9 and I217
>
> Tushar Dave (1):
> e1000e: Correct link check logic for 82571 serdes
Pulled, thanks Jeff.
^ permalink raw reply
* Re: [PATCH] MAINTAINERS: reflect actual changes in IEEE 802.15.4 maintainership
From: David Miller @ 2012-07-17 6:20 UTC (permalink / raw)
To: dbaryshkov; +Cc: linux-kernel, netdev, alex.bluesman.smirnov
In-Reply-To: <1342246534-22562-1-git-send-email-dbaryshkov@gmail.com>
From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Date: Sat, 14 Jul 2012 10:15:34 +0400
> As the life flows, developers priorities shifts a bit. Reflect actual
> changes in the maintainership of IEEE 802.15.4 code: Sergey mostly
> stopped cared about this piece of code. Most of the work recently was
> done by Alexander, so put him to the MAINTAINERS file to reflect his
> status and to ease the life of respective patches.
>
> Also add new net/mac802154/ directory to the list of maintained files.
>
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> Cc: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] ax25: Fix missing break
From: David Miller @ 2012-07-17 6:22 UTC (permalink / raw)
To: alan; +Cc: netdev, ralf
In-Reply-To: <20120713163247.22674.82793.stgit@localhost.localdomain>
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
Date: Fri, 13 Jul 2012 17:33:08 +0100
> From: Alan Cox <alan@linux.intel.com>
>
> At least there seems to be no reason to disallow ROSE sockets when
> NETROM is loaded.
>
> Signed-off-by: Alan Cox <alan@linux.intel.com>
Applied, thanks Alan.
^ permalink raw reply
* Re: [PATCH] sctp: fix sparse warning for sctp_init_cause_fixed
From: David Miller @ 2012-07-17 6:24 UTC (permalink / raw)
To: ioanorghici; +Cc: vyasevich, sri, netdev
In-Reply-To: <1342199797-11305-1-git-send-email-ioanorghici@gmail.com>
From: Ioan Orghici <ioanorghici@gmail.com>
Date: Fri, 13 Jul 2012 20:16:37 +0300
> Fix the following sparse warning:
> * symbol 'sctp_init_cause_fixed' was not declared. Should it be
> static?
>
> Signed-off-by: Ioan Orghici <ioanorghici@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH] irda: Fix typo in irda
From: David Miller @ 2012-07-17 6:24 UTC (permalink / raw)
To: standby24x7; +Cc: netdev, samuel, linux-kernel, trivial
In-Reply-To: <1342200167-14934-1-git-send-email-standby24x7@gmail.com>
From: Masanari Iida <standby24x7@gmail.com>
Date: Sat, 14 Jul 2012 02:22:47 +0900
> Correct spelling typo in irda.
>
> Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH] drivers: connector: fixed coding style issues
From: David Miller @ 2012-07-17 6:24 UTC (permalink / raw)
To: joe; +Cc: valentin.ilie, zbr, netdev
In-Reply-To: <1342298026.8377.33.camel@joe2Laptop>
I applied v2 of this patch, thanks.
^ permalink raw reply
* Re: [PATCH] gigaset: silence GCC warning for unused 'format_ie'
From: David Miller @ 2012-07-17 6:24 UTC (permalink / raw)
To: pebolle; +Cc: tilman, hjlipp, isdn, gigaset307x-common, netdev, linux-kernel
In-Reply-To: <1342343515.1780.2.camel@x61.thuisdomein>
From: Paul Bolle <pebolle@tiscali.nl>
Date: Sun, 15 Jul 2012 11:11:55 +0200
> Building Gigaset's CAPI support without Gigaset's debugging enabled
> triggers this GCC warning:
> 'format_ie' defined but not used [-Wunused-function]
>
> Silence this warning by wrapping format_ie() in an "#ifdef
> CONFIG_GIGASET_DEBUG" and "#endif" pair.
>
> Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Applied.
^ permalink raw reply
* Re: [PATCH v3 0/3] Add a driver for the ASIX AX88172A with phylib support
From: David Miller @ 2012-07-17 6:26 UTC (permalink / raw)
To: christian.riesch
Cc: netdev, oneukum, edumazet, allan, kernel, grundler, bhutchings,
joe, michael
In-Reply-To: <1342193191-18822-1-git-send-email-christian.riesch@omicron.at>
From: Christian Riesch <christian.riesch@omicron.at>
Date: Fri, 13 Jul 2012 17:26:28 +0200
> this is v3 of my patchset that adds a driver for the ASIX AX88172A USB 2.0
> to 10/100M Fast Ethernet Controller.
All applied, thanks.
^ permalink raw reply
* Re: [BUG] tg3: frequent freezes
From: Michael Chan @ 2012-07-17 6:56 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev
In-Reply-To: <1342503329.2626.30.camel@edumazet-glaptop>
On Tue, 2012-07-17 at 07:35 +0200, Eric Dumazet wrote:
> [ 266.248330] tg3 0000:09:00.0: eth0: 0x00004800: 0x080303fe,
> 0x00000010, 0x00000000, 0x00000020
RDMAC_STATUS (0x4804) is showing 0x10 which is parity error.
>[ 266.247878] tg3 0000:09:00.0: eth0: 0x00000000: 0x167314e4,
>0x40100506, 0x02000002, 0x00000010
PCI Status (0x06) is also showing SERR (0x4000)
Assuming your chip is not a bad chip, I'll have to look around for a
5755M and see if I can duplicate the problem.
^ permalink raw reply
* Re: [PATCH 1/4] pch_gbe: Fix the checksum fill to the error location
From: Eric Dumazet @ 2012-07-17 7:09 UTC (permalink / raw)
To: Andy Cress; +Cc: netdev, Zhong Hongbo
In-Reply-To: <40680C535D6FE6498883F1640FACD44D011432D4@ka-exchange-1.kontronamerica.local>
On Mon, 2012-07-16 at 13:03 -0700, Andy Cress wrote:
> Author: Zhong Hongbo <hongbo.zhong@windriver.com>
>
> Due to some unknown hardware limitations the pch_gbe hardware cannot
> calculate checksums when the length of network package is less
> than 64 bytes, where we will surprisingly encounter a problem of
> the destination IP incorrectly changed.
>
> When forwarding network packages at the network layer the IP packages
> won't be relayed to the upper transport layer and analyzed there,
> consequently, skb->transport_header pointer will be mistakenly remained
> the same as that of skb->network_header, resulting in TCP checksum
> wrongly
> filled into the field of destination IP in IP header.
>
> We can fix this issue by manually calculate the offset of the TCP
> checksum
> and update it accordingly.
>
> We would normally use the skb_checksum_start_offset(skb) here, but in
> this
> case it is sometimes -2 (csum_start=0 - skb_headroom=2 => -2), hence the
> manual calculation.
>
> Signed-off-by: Zhong Hongbo <hongbo.zhong@windriver.com>
> Merged-by: Andy Cress <andy.cress@us.kontron.com>
Hmm... I fail to understand why you care about NIC doing checksums,
while pch_gbe_tx_queue() make a _copy_ of each outgoing
packets.
There _must_ be a way to avoid most of these copies (ie not touching
payload), only mess with the header to insert these 2 nul bytes ?
/* [Header:14][payload] ---> [Header:14][paddong:2][payload] */
So at device setup : dev->needed_headroom = 2;
and in xmit,
if (skb_headroom(skb) < 2) {
struct sk_buff *skb_new;
skb_new = skb_realloc_headroom(skb, 2);
if (!skb_new) { handle error }
consume_skb(skb);
skb = skb_new;
}
ptr = skb_push(skb, 2);
memmove(ptr, ptr + 2, ETH_HLEN);
ptr[ETH_HLEN] = 0;
ptr[ETH_HLEN + 1] = 0;
^ permalink raw reply
* [PATCH] ipv6: fix unappropriate errno returned for non-multicast address
From: Li Wei @ 2012-07-17 7:28 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
We need to check the passed in multicast address and return
appropriate errno(EINVAL) if it is not valid. And it's no need
to walk through the ipv6_mc_list in this situation.
Signed-off-by: Li Wei <lw@cn.fujitsu.com>
---
net/ipv6/mcast.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 6d0f5dc..92f8e48 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -211,6 +211,9 @@ int ipv6_sock_mc_drop(struct sock *sk, int ifindex, const struct in6_addr *addr)
struct ipv6_mc_socklist __rcu **lnk;
struct net *net = sock_net(sk);
+ if (!ipv6_addr_is_multicast(addr))
+ return -EINVAL;
+
spin_lock(&ipv6_sk_mc_lock);
for (lnk = &np->ipv6_mc_list;
(mc_lst = rcu_dereference_protected(*lnk,
--
1.7.1
^ permalink raw reply related
* Re: [PATCH 1/4] pch_gbe: Fix the checksum fill to the error location
From: Eric Dumazet @ 2012-07-17 7:33 UTC (permalink / raw)
To: Andy Cress; +Cc: netdev, Zhong Hongbo
In-Reply-To: <1342508968.2626.148.camel@edumazet-glaptop>
On Tue, 2012-07-17 at 09:09 +0200, Eric Dumazet wrote:
> Hmm... I fail to understand why you care about NIC doing checksums,
> while pch_gbe_tx_queue() make a _copy_ of each outgoing
> packets.
>
> There _must_ be a way to avoid most of these copies (ie not touching
> payload), only mess with the header to insert these 2 nul bytes ?
>
> /* [Header:14][payload] ---> [Header:14][paddong:2][payload] */
>
> So at device setup : dev->needed_headroom = 2;
>
> and in xmit,
>
> if (skb_headroom(skb) < 2) {
> struct sk_buff *skb_new;
>
> skb_new = skb_realloc_headroom(skb, 2);
> if (!skb_new) { handle error }
> consume_skb(skb);
> skb = skb_new;
> }
> ptr = skb_push(skb, 2);
> memmove(ptr, ptr + 2, ETH_HLEN);
> ptr[ETH_HLEN] = 0;
> ptr[ETH_HLEN + 1] = 0;
>
>
Something like the following (untested) patch
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 55 +++++-----
1 file changed, 29 insertions(+), 26 deletions(-)
diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
index b100656..2d3d982 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
@@ -1163,7 +1163,7 @@ static void pch_gbe_tx_queue(struct pch_gbe_adapter *adapter,
struct pch_gbe_hw *hw = &adapter->hw;
struct pch_gbe_tx_desc *tx_desc;
struct pch_gbe_buffer *buffer_info;
- struct sk_buff *tmp_skb;
+ char *ptr;
unsigned int frame_ctrl;
unsigned int ring_num;
@@ -1221,18 +1221,27 @@ static void pch_gbe_tx_queue(struct pch_gbe_adapter *adapter,
buffer_info = &tx_ring->buffer_info[ring_num];
- tmp_skb = buffer_info->skb;
+ if (skb_headroom(skb) < 2) {
+ struct sk_buff *skb_new;
+
+ skb_new = skb_realloc_headroom(skb, 2);
+ if (!skb_new) {
+ tx_ring->next_to_use = ring_num;
+ dev_kfree_skb_any(skb);
+ return;
+ }
+ consume_skb(skb);
+ skb = skb_new;
+ }
/* [Header:14][payload] ---> [Header:14][paddong:2][payload] */
- memcpy(tmp_skb->data, skb->data, ETH_HLEN);
- tmp_skb->data[ETH_HLEN] = 0x00;
- tmp_skb->data[ETH_HLEN + 1] = 0x00;
- tmp_skb->len = skb->len;
- memcpy(&tmp_skb->data[ETH_HLEN + 2], &skb->data[ETH_HLEN],
- (skb->len - ETH_HLEN));
+ ptr = skb_push(skb, 2);
+ memmove(ptr, ptr + 2, ETH_HLEN);
+ ptr[ETH_HLEN] = 0x00;
+ ptr[ETH_HLEN + 1] = 0x00;
/*-- Set Buffer information --*/
- buffer_info->length = tmp_skb->len;
- buffer_info->dma = dma_map_single(&adapter->pdev->dev, tmp_skb->data,
+ buffer_info->length = skb->len;
+ buffer_info->dma = dma_map_single(&adapter->pdev->dev, skb->data,
buffer_info->length,
DMA_TO_DEVICE);
if (dma_mapping_error(&adapter->pdev->dev, buffer_info->dma)) {
@@ -1240,18 +1249,20 @@ static void pch_gbe_tx_queue(struct pch_gbe_adapter *adapter,
buffer_info->dma = 0;
buffer_info->time_stamp = 0;
tx_ring->next_to_use = ring_num;
+ dev_kfree_skb_any(skb);
return;
}
buffer_info->mapped = true;
buffer_info->time_stamp = jiffies;
+ buffer_info->skb = skb;
/*-- Set Tx descriptor --*/
tx_desc = PCH_GBE_TX_DESC(*tx_ring, ring_num);
- tx_desc->buffer_addr = (buffer_info->dma);
- tx_desc->length = (tmp_skb->len);
- tx_desc->tx_words_eob = ((tmp_skb->len + 3));
+ tx_desc->buffer_addr = buffer_info->dma;
+ tx_desc->length = skb->len;
+ tx_desc->tx_words_eob = skb->len + 3;
tx_desc->tx_frame_ctrl = (frame_ctrl);
- tx_desc->gbec_status = (DSC_INIT16);
+ tx_desc->gbec_status = DSC_INIT16;
if (unlikely(++ring_num == tx_ring->count))
ring_num = 0;
@@ -1265,7 +1276,6 @@ static void pch_gbe_tx_queue(struct pch_gbe_adapter *adapter,
pch_tx_timestamp(adapter, skb);
#endif
- dev_kfree_skb_any(skb);
}
/**
@@ -1543,19 +1553,12 @@ static void pch_gbe_alloc_tx_buffers(struct pch_gbe_adapter *adapter,
struct pch_gbe_tx_ring *tx_ring)
{
struct pch_gbe_buffer *buffer_info;
- struct sk_buff *skb;
unsigned int i;
- unsigned int bufsz;
struct pch_gbe_tx_desc *tx_desc;
- bufsz =
- adapter->hw.mac.max_frame_size + PCH_GBE_DMA_ALIGN + NET_IP_ALIGN;
-
for (i = 0; i < tx_ring->count; i++) {
buffer_info = &tx_ring->buffer_info[i];
- skb = netdev_alloc_skb(adapter->netdev, bufsz);
- skb_reserve(skb, PCH_GBE_DMA_ALIGN);
- buffer_info->skb = skb;
+ buffer_info->skb = NULL;
tx_desc = PCH_GBE_TX_DESC(*tx_ring, i);
tx_desc->gbec_status = (DSC_INIT16);
}
@@ -1622,9 +1625,9 @@ pch_gbe_clean_tx(struct pch_gbe_adapter *adapter,
buffer_info->length, DMA_TO_DEVICE);
buffer_info->mapped = false;
}
- if (buffer_info->skb) {
- pr_debug("trim buffer_info->skb : %d\n", i);
- skb_trim(buffer_info->skb, 0);
+ if (skb) {
+ dev_kfree_skb_any(skb);
+ buffer_info->skb = NULL;
}
tx_desc->gbec_status = DSC_INIT16;
if (unlikely(++i == tx_ring->count))
^ permalink raw reply related
* Re: [PATCH] drivers: connector: fixed coding style issues
From: Evgeniy Polyakov @ 2012-07-17 7:26 UTC (permalink / raw)
To: David Miller; +Cc: joe, valentin.ilie, netdev
In-Reply-To: <20120716.232441.1586213661098921458.davem@davemloft.net>
On Mon, Jul 16, 2012 at 11:24:41PM -0700, David Miller (davem@davemloft.net) wrote:
>
> I applied v2 of this patch, thanks.
Thanks, everyone!
--
Evgeniy Polyakov
^ permalink raw reply
* pull request: linux-can-next 2012-07-17
From: Marc Kleine-Budde @ 2012-07-17 7:50 UTC (permalink / raw)
To: davem; +Cc: Linux Netdev List, linux-can@vger.kernel.org,
kernel@pengutronix.de
[-- Attachment #1: Type: text/plain, Size: 1570 bytes --]
Hello David,
the fifth pull request for upcoming v3.6 net-next. The first two
patches (created by me) add const qualifiers to the flexcan and
mpc5xxx_can driver. The next patch by Julia Lawall fixes a return value
problem in the error path of the softing driver.
regards, Marc
--
The following changes since commit 6ba6047bf99cf4ade4f63b6b3d97cc3ad763b678:
gigaset: silence GCC warning for unused 'format_ie' (2012-07-16 23:23:53 -0700)
are available in the git repository at:
git://gitorious.org/linux-can/linux-can-next.git for-davem
for you to fetch changes up to da78b7998e365b3f90b2a1a55d3b6ba6cc0c5905:
can: softing: softing_main: ensure a consistent return value in error case (2012-07-17 09:35:59 +0200)
----------------------------------------------------------------
Julia Lawall (1):
can: softing: softing_main: ensure a consistent return value in error case
Marc Kleine-Budde (2):
can: flexcan: make flexcan_priv.devtype_data member point to const data
can: mpc5xxx_can: make data in mpc5xxx_can_probe const
drivers/net/can/flexcan.c | 4 ++--
drivers/net/can/mscan/mpc5xxx_can.c | 2 +-
drivers/net/can/softing/softing_main.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
^ permalink raw reply
* Re: [PATCH 1/4] pch_gbe: Fix the checksum fill to the error location
From: Zhong Hongbo @ 2012-07-17 8:04 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Andy Cress, netdev
In-Reply-To: <1342508968.2626.148.camel@edumazet-glaptop>
On 07/17/2012 03:09 PM, Eric Dumazet wrote:
> On Mon, 2012-07-16 at 13:03 -0700, Andy Cress wrote:
>> Author: Zhong Hongbo <hongbo.zhong@windriver.com>
>>
>> Due to some unknown hardware limitations the pch_gbe hardware cannot
>> calculate checksums when the length of network package is less
>> than 64 bytes, where we will surprisingly encounter a problem of
>> the destination IP incorrectly changed.
>>
>> When forwarding network packages at the network layer the IP packages
>> won't be relayed to the upper transport layer and analyzed there,
>> consequently, skb->transport_header pointer will be mistakenly remained
>> the same as that of skb->network_header, resulting in TCP checksum
>> wrongly
>> filled into the field of destination IP in IP header.
>>
>> We can fix this issue by manually calculate the offset of the TCP
>> checksum
>> and update it accordingly.
>>
>> We would normally use the skb_checksum_start_offset(skb) here, but in
>> this
>> case it is sometimes -2 (csum_start=0 - skb_headroom=2 => -2), hence the
>> manual calculation.
>>
>> Signed-off-by: Zhong Hongbo <hongbo.zhong@windriver.com>
>> Merged-by: Andy Cress <andy.cress@us.kontron.com>
>
> Hmm... I fail to understand why you care about NIC doing checksums,
Hi Eric,
When forwarding network packages at the network layer, the variable value of skb->transport_header is unknown. In my test, the variable value of skb->transport_header is equal to skb->network_header. So When you count the checksum as following:
offset = skb_transport_offset(skb);
skb->csum = skb_checksum(skb, offset, skb->len - offset, 0);
We should only count the TCP checksum, But it maybe include IP part.
tcp_hdr(skb)->check = csum_tcpudp_magic(iph->saddr, iph->daddr, skb->len - offset, IPPROTO_TCP, skb->csum);
We should fill the checksum in TCP package, But maybe fill it in other location and cover the useful information, such as source ip.
So We should count the TCP checksum and fill it in the correct location. Or else the forwarding network package will be drop for the error checksum.
> while pch_gbe_tx_queue() make a _copy_ of each outgoing
> packets.
>
> There _must_ be a way to avoid most of these copies (ie not touching
> payload), only mess with the header to insert these 2 nul bytes ?
This is other fix, my patch just fix checksum error issue.
Thanks,
hongbo
>
> /* [Header:14][payload] ---> [Header:14][paddong:2][payload] */
>
> So at device setup : dev->needed_headroom = 2;
>
> and in xmit,
>
> if (skb_headroom(skb) < 2) {
> struct sk_buff *skb_new;
>
> skb_new = skb_realloc_headroom(skb, 2);
> if (!skb_new) { handle error }
> consume_skb(skb);
> skb = skb_new;
> }
> ptr = skb_push(skb, 2);
> memmove(ptr, ptr + 2, ETH_HLEN);
> ptr[ETH_HLEN] = 0;
> ptr[ETH_HLEN + 1] = 0;
>
>
>
>
>
^ permalink raw reply
* bnx2x: organize BDs calculation for stop/resumelogin
From: Dmitry Kravkov @ 2012-07-17 8:08 UTC (permalink / raw)
To: davem; +Cc: netdev
Hi Dave,
I see this patch has been marked as "accepted" in patchwork
http://patchwork.ozlabs.org/patch/167337/
But i can't see it applied to the git-tree.
Was it missed somehow? Or delayed for some reason?
Thanks,
Dmitry
^ permalink raw reply
* [PATCH net-next v2] tcp: implement RFC 5961 3.2
From: Eric Dumazet @ 2012-07-17 8:13 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Kiran Kumar Kella
From: Eric Dumazet <edumazet@google.com>
Implement the RFC 5691 mitigation against Blind
Reset attack using RST bit.
Idea is to validate incoming RST sequence,
to match RCV.NXT value, instead of previouly accepted
window : (RCV.NXT <= SEG.SEQ < RCV.NXT+RCV.WND)
If sequence is in window but not an exact match, send
a "challenge ACK", so that the other part can resend an
RST with the appropriate sequence.
Add a new sysctl, tcp_challenge_ack_limit, to limit
number of challenge ACK sent per second.
Add a new SNMP counter to count number of challenge acks sent.
(netstat -s | grep TCPChallengeACK)
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Kiran Kumar Kella <kkiran@broadcom.com>
---
v2: respin to net-next, better changelog
tcp_challengeack_limit -> tcp_challenge_ack_limit
tcp_time_stamp -> jiffies
Documentation/networking/ip-sysctl.txt | 5 +++
include/linux/snmp.h | 1
include/net/tcp.h | 1
net/ipv4/proc.c | 1
net/ipv4/sysctl_net_ipv4.c | 7 +++++
net/ipv4/tcp_input.c | 31 ++++++++++++++++++++++-
6 files changed, 45 insertions(+), 1 deletion(-)
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index e20c17a..e1e0215 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -565,6 +565,11 @@ tcp_limit_output_bytes - INTEGER
reduce the size of individual GSO packet (64KB being the max)
Default: 131072
+tcp_challenge_ack_limit - INTEGER
+ Limits number of Challenge ACK sent per second, as recommended
+ in RFC 5961 (Improving TCP's Robustness to Blind In-Window Attacks)
+ Default: 100
+
UDP variables:
udp_mem - vector of 3 INTEGERs: min, pressure, max
diff --git a/include/linux/snmp.h b/include/linux/snmp.h
index 6e4c511..673e0e9 100644
--- a/include/linux/snmp.h
+++ b/include/linux/snmp.h
@@ -237,6 +237,7 @@ enum
LINUX_MIB_TCPOFOQUEUE, /* TCPOFOQueue */
LINUX_MIB_TCPOFODROP, /* TCPOFODrop */
LINUX_MIB_TCPOFOMERGE, /* TCPOFOMerge */
+ LINUX_MIB_TCPCHALLENGEACK, /* TCPChallengeACK */
__LINUX_MIB_MAX
};
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 439984b..85c5090 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -254,6 +254,7 @@ extern int sysctl_tcp_thin_linear_timeouts;
extern int sysctl_tcp_thin_dupack;
extern int sysctl_tcp_early_retrans;
extern int sysctl_tcp_limit_output_bytes;
+extern int sysctl_tcp_challenge_ack_limit;
extern atomic_long_t tcp_memory_allocated;
extern struct percpu_counter tcp_sockets_allocated;
diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c
index dae25e76..3e8e78f 100644
--- a/net/ipv4/proc.c
+++ b/net/ipv4/proc.c
@@ -261,6 +261,7 @@ static const struct snmp_mib snmp4_net_list[] = {
SNMP_MIB_ITEM("TCPOFOQueue", LINUX_MIB_TCPOFOQUEUE),
SNMP_MIB_ITEM("TCPOFODrop", LINUX_MIB_TCPOFODROP),
SNMP_MIB_ITEM("TCPOFOMerge", LINUX_MIB_TCPOFOMERGE),
+ SNMP_MIB_ITEM("TCPChallengeACK", LINUX_MIB_TCPCHALLENGEACK),
SNMP_MIB_SENTINEL
};
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index 70730f7..3f6a1e7 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -605,6 +605,13 @@ static struct ctl_table ipv4_table[] = {
.mode = 0644,
.proc_handler = proc_dointvec
},
+ {
+ .procname = "tcp_challenge_ack_limit",
+ .data = &sysctl_tcp_challenge_ack_limit,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .proc_handler = proc_dointvec
+ },
#ifdef CONFIG_NET_DMA
{
.procname = "tcp_dma_copybreak",
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index cc4e12f..c841a89 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -88,6 +88,9 @@ int sysctl_tcp_app_win __read_mostly = 31;
int sysctl_tcp_adv_win_scale __read_mostly = 1;
EXPORT_SYMBOL(sysctl_tcp_adv_win_scale);
+/* rfc5961 challenge ack rate limiting */
+int sysctl_tcp_challenge_ack_limit = 100;
+
int sysctl_tcp_stdurg __read_mostly;
int sysctl_tcp_rfc1337 __read_mostly;
int sysctl_tcp_max_orphans __read_mostly = NR_FILE;
@@ -5247,6 +5250,23 @@ out:
}
#endif /* CONFIG_NET_DMA */
+static void tcp_send_challenge_ack(struct sock *sk)
+{
+ /* unprotected vars, we dont care of overwrites */
+ static u32 challenge_timestamp;
+ static unsigned int challenge_count;
+ u32 now = jiffies / HZ;
+
+ if (now != challenge_timestamp) {
+ challenge_timestamp = now;
+ challenge_count = 0;
+ }
+ if (++challenge_count <= sysctl_tcp_challenge_ack_limit) {
+ NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPCHALLENGEACK);
+ tcp_send_ack(sk);
+ }
+}
+
/* Does PAWS and seqno based validation of an incoming segment, flags will
* play significant role here.
*/
@@ -5283,7 +5303,16 @@ static int tcp_validate_incoming(struct sock *sk, struct sk_buff *skb,
/* Step 2: check RST bit */
if (th->rst) {
- tcp_reset(sk);
+ /* RFC 5961 3.2 :
+ * If sequence number exactly matches RCV.NXT, then
+ * RESET the connection
+ * else
+ * Send a challenge ACK
+ */
+ if (TCP_SKB_CB(skb)->seq == tp->rcv_nxt)
+ tcp_reset(sk);
+ else
+ tcp_send_challenge_ack(sk);
goto discard;
}
^ permalink raw reply related
* Re: bnx2x: organize BDs calculation for stop/resumelogin
From: David Miller @ 2012-07-17 8:32 UTC (permalink / raw)
To: dmitry; +Cc: netdev
In-Reply-To: <1342512490.16812.4.camel@lb-tlvb-dmitry>
From: "Dmitry Kravkov" <dmitry@broadcom.com>
Date: Tue, 17 Jul 2012 11:08:10 +0300
> Hi Dave,
>
> I see this patch has been marked as "accepted" in patchwork
> http://patchwork.ozlabs.org/patch/167337/
>
> But i can't see it applied to the git-tree.
>
> Was it missed somehow? Or delayed for some reason?
Thanks for catching that, I've fixed this up, it's applied for
sure now :-)
^ permalink raw reply
* Re: pull request: linux-can-next 2012-07-17
From: David Miller @ 2012-07-17 8:34 UTC (permalink / raw)
To: mkl; +Cc: netdev, linux-can, kernel
In-Reply-To: <5005194A.4090900@pengutronix.de>
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Tue, 17 Jul 2012 09:50:34 +0200
> the fifth pull request for upcoming v3.6 net-next. The first two
> patches (created by me) add const qualifiers to the flexcan and
> mpc5xxx_can driver. The next patch by Julia Lawall fixes a return value
> problem in the error path of the softing driver.
Pulled, thanks.
^ permalink raw reply
* Re: [PATCH] ipv6: fix unappropriate errno returned for non-multicast address
From: David Miller @ 2012-07-17 8:35 UTC (permalink / raw)
To: lw; +Cc: netdev
In-Reply-To: <5005143B.9000301@cn.fujitsu.com>
From: Li Wei <lw@cn.fujitsu.com>
Date: Tue, 17 Jul 2012 15:28:59 +0800
> We need to check the passed in multicast address and return
> appropriate errno(EINVAL) if it is not valid. And it's no need
> to walk through the ipv6_mc_list in this situation.
>
> Signed-off-by: Li Wei <lw@cn.fujitsu.com>
Applied to net-next, thanks.
^ permalink raw reply
* Re: [PATCH net-next v2] tcp: implement RFC 5961 3.2
From: David Miller @ 2012-07-17 8:36 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, kkiran
In-Reply-To: <1342512785.2626.230.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 17 Jul 2012 10:13:05 +0200
> From: Eric Dumazet <edumazet@google.com>
>
> Implement the RFC 5691 mitigation against Blind
> Reset attack using RST bit.
>
> Idea is to validate incoming RST sequence,
> to match RCV.NXT value, instead of previouly accepted
> window : (RCV.NXT <= SEG.SEQ < RCV.NXT+RCV.WND)
>
> If sequence is in window but not an exact match, send
> a "challenge ACK", so that the other part can resend an
> RST with the appropriate sequence.
>
> Add a new sysctl, tcp_challenge_ack_limit, to limit
> number of challenge ACK sent per second.
>
> Add a new SNMP counter to count number of challenge acks sent.
> (netstat -s | grep TCPChallengeACK)
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Looks good, applied, thanks Eric.
^ 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