All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bgmac: omit the fcs
@ 2013-02-28 17:16 Hauke Mehrtens
  2013-02-28 17:57 ` Rafał Miłecki
  2013-02-28 20:38 ` David Miller
  0 siblings, 2 replies; 7+ messages in thread
From: Hauke Mehrtens @ 2013-02-28 17:16 UTC (permalink / raw)
  To: davem; +Cc: zajec5, netdev, Hauke Mehrtens

Do not include the frame check sequence when adding the skb to
netif_receive_skb(). This causes problems when this interface was
bridged to a wifi ap and a big package should be forwarded from this
Ethernet driver through a bride to the wifi client.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 drivers/net/ethernet/broadcom/bgmac.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index bf985c0..bce30e7 100644
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -301,12 +301,16 @@ static int bgmac_dma_rx_read(struct bgmac *bgmac, struct bgmac_dma_ring *ring,
 			bgmac_err(bgmac, "Found poisoned packet at slot %d, DMA issue!\n",
 				  ring->start);
 		} else {
+			/* Omit CRC. */
+			len -= ETH_FCS_LEN;
+
 			new_skb = netdev_alloc_skb_ip_align(bgmac->net_dev, len);
 			if (new_skb) {
 				skb_put(new_skb, len);
 				skb_copy_from_linear_data_offset(skb, BGMAC_RX_FRAME_OFFSET,
 								 new_skb->data,
 								 len);
+				skb_checksum_none_assert(skb);
 				new_skb->protocol =
 					eth_type_trans(new_skb, bgmac->net_dev);
 				netif_receive_skb(new_skb);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] bgmac: omit the fcs
  2013-02-28 17:16 [PATCH] bgmac: omit the fcs Hauke Mehrtens
@ 2013-02-28 17:57 ` Rafał Miłecki
  2013-02-28 18:13   ` Hauke Mehrtens
                     ` (2 more replies)
  2013-02-28 20:38 ` David Miller
  1 sibling, 3 replies; 7+ messages in thread
From: Rafał Miłecki @ 2013-02-28 17:57 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: davem, netdev

2013/2/28 Hauke Mehrtens <hauke@hauke-m.de>:
> Do not include the frame check sequence when adding the skb to
> netif_receive_skb(). This causes problems when this interface was
> bridged to a wifi ap and a big package should be forwarded from this
> Ethernet driver through a bride to the wifi client.

Is this a real fix?

Don't get me wrong, but it sounds a little like a workaround for some
issue in another network layer ;)

-- 
Rafał

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] bgmac: omit the fcs
  2013-02-28 17:57 ` Rafał Miłecki
@ 2013-02-28 18:13   ` Hauke Mehrtens
  2013-02-28 19:21   ` David Miller
  2013-02-28 22:16   ` Eric Dumazet
  2 siblings, 0 replies; 7+ messages in thread
From: Hauke Mehrtens @ 2013-02-28 18:13 UTC (permalink / raw)
  To: Rafał Miłecki; +Cc: davem, netdev

On 02/28/2013 06:57 PM, Rafał Miłecki wrote:
> 2013/2/28 Hauke Mehrtens <hauke@hauke-m.de>:
>> Do not include the frame check sequence when adding the skb to
>> netif_receive_skb(). This causes problems when this interface was
>> bridged to a wifi ap and a big package should be forwarded from this
>> Ethernet driver through a bride to the wifi client.
> 
> Is this a real fix?
> 
> Don't get me wrong, but it sounds a little like a workaround for some
> issue in another network layer ;)
> 
Many drivers are doing similar things, b44 is one of them. Hopefully
someone more familiar with the network stack could say if this is the
right way to do this.

On a wireless client I saw that all packages directly from my router did
not had a FCS, but all the packages send from an other LAN client which
went through this driver had a FCS and where 4 bytes bigger and this FCS
was wrong.

Hauke

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] bgmac: omit the fcs
  2013-02-28 17:57 ` Rafał Miłecki
  2013-02-28 18:13   ` Hauke Mehrtens
@ 2013-02-28 19:21   ` David Miller
  2013-02-28 19:25     ` Rafał Miłecki
  2013-02-28 22:16   ` Eric Dumazet
  2 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2013-02-28 19:21 UTC (permalink / raw)
  To: zajec5; +Cc: hauke, netdev

From: Rafał Miłecki <zajec5@gmail.com>
Date: Thu, 28 Feb 2013 18:57:03 +0100

> 2013/2/28 Hauke Mehrtens <hauke@hauke-m.de>:
>> Do not include the frame check sequence when adding the skb to
>> netif_receive_skb(). This causes problems when this interface was
>> bridged to a wifi ap and a big package should be forwarded from this
>> Ethernet driver through a bride to the wifi client.
> 
> Is this a real fix?
> 
> Don't get me wrong, but it sounds a little like a workaround for some
> issue in another network layer ;)

FCS should never be included in the SKB unless a specific debugging
configuration knob has enabled it.

Having the FCS there will screw up things like device provided partial
checksums (CHECKSUM_PARTIAL), which operate over the entire contents
of the packet starting at a particular offset, so if the FCS is there
we'll include it.

This change is therefore about as correct as can possibly be.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] bgmac: omit the fcs
  2013-02-28 19:21   ` David Miller
@ 2013-02-28 19:25     ` Rafał Miłecki
  0 siblings, 0 replies; 7+ messages in thread
From: Rafał Miłecki @ 2013-02-28 19:25 UTC (permalink / raw)
  To: David Miller; +Cc: hauke, netdev

2013/2/28 David Miller <davem@davemloft.net>:
> From: Rafał Miłecki <zajec5@gmail.com>
> Date: Thu, 28 Feb 2013 18:57:03 +0100
>
>> 2013/2/28 Hauke Mehrtens <hauke@hauke-m.de>:
>>> Do not include the frame check sequence when adding the skb to
>>> netif_receive_skb(). This causes problems when this interface was
>>> bridged to a wifi ap and a big package should be forwarded from this
>>> Ethernet driver through a bride to the wifi client.
>>
>> Is this a real fix?
>>
>> Don't get me wrong, but it sounds a little like a workaround for some
>> issue in another network layer ;)
>
> FCS should never be included in the SKB unless a specific debugging
> configuration knob has enabled it.
>
> Having the FCS there will screw up things like device provided partial
> checksums (CHECKSUM_PARTIAL), which operate over the entire contents
> of the packet starting at a particular offset, so if the FCS is there
> we'll include it.
>
> This change is therefore about as correct as can possibly be.

OK, thanks! :)

-- 
Rafał

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] bgmac: omit the fcs
  2013-02-28 17:16 [PATCH] bgmac: omit the fcs Hauke Mehrtens
  2013-02-28 17:57 ` Rafał Miłecki
@ 2013-02-28 20:38 ` David Miller
  1 sibling, 0 replies; 7+ messages in thread
From: David Miller @ 2013-02-28 20:38 UTC (permalink / raw)
  To: hauke; +Cc: zajec5, netdev

From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Thu, 28 Feb 2013 18:16:54 +0100

> Do not include the frame check sequence when adding the skb to
> netif_receive_skb(). This causes problems when this interface was
> bridged to a wifi ap and a big package should be forwarded from this
> Ethernet driver through a bride to the wifi client.
> 
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

Applied.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] bgmac: omit the fcs
  2013-02-28 17:57 ` Rafał Miłecki
  2013-02-28 18:13   ` Hauke Mehrtens
  2013-02-28 19:21   ` David Miller
@ 2013-02-28 22:16   ` Eric Dumazet
  2 siblings, 0 replies; 7+ messages in thread
From: Eric Dumazet @ 2013-02-28 22:16 UTC (permalink / raw)
  To: Rafał Miłecki; +Cc: Hauke Mehrtens, davem, netdev

On Thu, 2013-02-28 at 18:57 +0100, Rafał Miłecki wrote:

> Is this a real fix?
> 
> Don't get me wrong, but it sounds a little like a workaround for some
> issue in another network layer ;)

It looks a real fix in a forwarding workload, or else MTU would need 4
extra bytes.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-02-28 22:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-28 17:16 [PATCH] bgmac: omit the fcs Hauke Mehrtens
2013-02-28 17:57 ` Rafał Miłecki
2013-02-28 18:13   ` Hauke Mehrtens
2013-02-28 19:21   ` David Miller
2013-02-28 19:25     ` Rafał Miłecki
2013-02-28 22:16   ` Eric Dumazet
2013-02-28 20:38 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.