lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1283266263.2550.106.camel@edumazet-laptop>
Date:	Tue, 31 Aug 2010 16:51:03 +0200
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Masayuki Ohtake <masa-korg@....okisemi.com>
Cc:	Stephen Hemminger <shemminger@...tta.com>,
	Sam Ravnborg <sam@...nborg.org>, Joe Perches <joe@...ches.com>,
	LKML <linux-kernel@...r.kernel.org>,
	ML netdev <netdev@...r.kernel.org>,
	Greg Rose <gregory.v.rose@...el.com>,
	Maxime Bizon <mbizon@...ebox.fr>,
	Kristoffer Glembo <kristoffer@...sler.com>,
	Ralf Baechle <ralf@...ux-mips.org>,
	John Linn <john.linn@...inx.com>,
	Randy Dunlap <randy.dunlap@...cle.com>,
	"David S. Miller" <davem@...emloft.net>,
	MeeGo <meego-dev@...go.com>, "Wang, Qi" <qi.wang@...el.com>,
	"Wang, Yong Y" <yong.y.wang@...el.com>,
	Andrew <andrew.chih.howe.khor@...el.com>,
	Intel OTC <joel.clark@...el.com>,
	"Foster, Margie" <margie.foster@...el.com>,
	Toshiharu Okada <okada533@....okisemi.com>,
	Tomoya Morinaga <morinaga526@....okisemi.com>,
	Takahiro Shimizu <shimizu394@....okisemi.com>
Subject: Re: [PATCH] Gigabit Ethernet driver of Topcliff PCH

Le mardi 31 août 2010 à 23:15 +0900, Masayuki Ohtake a écrit :
> Hi Sam, Joe and Stephen
> 
> Thank you for your comments.
> We have modified this driver for your comment.
> 
> ---
> Gigabit Ethernet driver of Topcliff PCH

> +			skb->protocol = eth_type_trans(skb, netdev);
> +			if ((tcp_ip_status & PCH_GBE_RXD_ACC_STAT_TCPIPOK) ==
> +			    PCH_GBE_RXD_ACC_STAT_TCPIPOK) {
> +				skb->ip_summed = CHECKSUM_UNNECESSARY;
> +			} else {
> +				skb->ip_summed = CHECKSUM_NONE;
> +			}
> +
> +			if (netif_receive_skb(skb) == NET_RX_DROP) {
> +				adapter->stats.rx_dropped++;

dont use pr_err() here, dropping a frame is a normal condition.

> +				pr_err("Receive Netif Receive Dropped Error\n");
> +			}
> +			(*work_done)++;
> +			netdev->last_rx = jiffies;

really ? last_rx is a thing of the past.

> +			pr_debug
> +			    ("Receive skb->ip_summed: %d length: %d\n",
> +			     skb->ip_summed, length);
> +		}
> +dorrop:
> +		/* return some buffers to hardware, one at a time is too slow */
> +		if (unlikely(cleaned_count >= PCH_GBE_RX_BUFFER_WRITE)) {
> +			pch_gbe_alloc_rx_buffers(adapter, rx_ring,
> +						 cleaned_count);
> +			cleaned_count = 0;
> +		}
> +		if (++i == rx_ring->count)
> +			i = 0;
> +	}
> +	rx_ring->next_to_clean = i;
> +	if (cleaned_count)
> +		pch_gbe_alloc_rx_buffers(adapter, rx_ring, cleaned_count);
> +	return cleaned;
> +}
> +



I find hard to believe this driver needs to copy all outgoing frames on
pre-allocated skbs.

+       /* [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));
+       buffer_info->kernel_skb = skb;
+       skb = tmp_skb;

Whats the deal here please ?


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ