mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Masayuki Ohtake" <masa-korg@dsn.okisemi.com>
To: "Eric Dumazet" <eric.dumazet@gmail.com>
Cc: "Stephen Hemminger" <shemminger@vyatta.com>,
	"Sam Ravnborg" <sam@ravnborg.org>,
	"Joe Perches" <joe@perches.com>,
	"LKML" <linux-kernel@vger.kernel.org>,
	"ML netdev" <netdev@vger.kernel.org>,
	"Greg Rose" <gregory.v.rose@intel.com>,
	"Maxime Bizon" <mbizon@freebox.fr>,
	"Kristoffer Glembo" <kristoffer@gaisler.com>,
	"Ralf Baechle" <ralf@linux-mips.org>,
	"John Linn" <john.linn@xilinx.com>,
	"Randy Dunlap" <randy.dunlap@oracle.com>,
	"David S. Miller" <davem@davemloft.net>,
	"MeeGo" <meego-dev@meego.com>, "Wang, Qi" <qi.wang@intel.com>,
	"Wang, Yong Y" <yong.y.wang@intel.com>,
	"Andrew" <andrew.chih.howe.khor@intel.com>,
	"Intel OTC" <joel.clark@intel.com>,
	"Foster, Margie" <margie.foster@intel.com>,
	"Toshiharu Okada" <okada533@dsn.okisemi.com>,
	"Tomoya Morinaga" <morinaga526@dsn.okisemi.com>,
	"Takahiro Shimizu" <shimizu394@dsn.okisemi.com>
Subject: Re: [PATCH] Gigabit Ethernet driver of Topcliff PCH
Date: Thu, 2 Sep 2010 21:39:12 +0900	[thread overview]
Message-ID: <000a01cb4a9b$e8d6ab00$66f8800a@maildom.okisemi.com> (raw)
In-Reply-To: <1283266263.2550.106.camel@edumazet-laptop>

Hi Eric

Thank you for your comments.

> 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 ?

This processing depends on hardware specification.

At the time of transmission.
Hardware accepts a packet in the following format.
  [Header: 14octet] + [padding: 2octet] + [payload]
  Also, it is necessary to align the head of a [Header: 14octet] at 64byte.

In my knowledge, SKB received by kernel are the following format.
  [padding: 2octet] + [Header:14octet] + [payload]
  Also, The head of [payload] has aligned at 16 byte.

So, it has adjusted with the format of hardware by a copy.

Thanks, Ohtake(OKISemi)
----- Original Message ----- 
From: "Eric Dumazet" <eric.dumazet@gmail.com>
To: "Masayuki Ohtake" <masa-korg@dsn.okisemi.com>
Cc: "Stephen Hemminger" <shemminger@vyatta.com>; "Sam Ravnborg" <sam@ravnborg.org>; "Joe Perches" <joe@perches.com>;
"LKML" <linux-kernel@vger.kernel.org>; "ML netdev" <netdev@vger.kernel.org>; "Greg Rose" <gregory.v.rose@intel.com>;
"Maxime Bizon" <mbizon@freebox.fr>; "Kristoffer Glembo" <kristoffer@gaisler.com>; "Ralf Baechle" <ralf@linux-mips.org>;
"John Linn" <john.linn@xilinx.com>; "Randy Dunlap" <randy.dunlap@oracle.com>; "David S. Miller" <davem@davemloft.net>;
"MeeGo" <meego-dev@meego.com>; "Wang, Qi" <qi.wang@intel.com>; "Wang, Yong Y" <yong.y.wang@intel.com>; "Andrew"
<andrew.chih.howe.khor@intel.com>; "Intel OTC" <joel.clark@intel.com>; "Foster, Margie" <margie.foster@intel.com>;
"Toshiharu Okada" <okada533@dsn.okisemi.com>; "Tomoya Morinaga" <morinaga526@dsn.okisemi.com>; "Takahiro Shimizu"
<shimizu394@dsn.okisemi.com>
Sent: Tuesday, August 31, 2010 11:51 PM
Subject: Re: [PATCH] Gigabit Ethernet driver of Topcliff PCH


> Le mardi 31 aout 2010 a 23:15 +0900, Masayuki Ohtake a ecrit :
> > 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@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>



  reply	other threads:[~2010-09-02 12:39 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-26  9:56 Masayuki Ohtake
2010-08-26 10:28 ` Sam Ravnborg
2010-08-26 12:47   ` Masayuki Ohtake
2010-08-26 14:44 ` Joe Perches
2010-08-26 15:34 ` Stephen Hemminger
2010-08-26 15:40 ` Stephen Hemminger
2010-08-26 15:41 ` Stephen Hemminger
2010-08-26 15:42 ` Stephen Hemminger
2010-08-26 15:43 ` Stephen Hemminger
2010-08-26 15:45 ` Stephen Hemminger
2010-08-26 15:47 ` Stephen Hemminger
2010-08-26 15:57 ` Stephen Hemminger
2010-08-26 16:05 ` Stephen Hemminger
2010-08-26 16:16   ` Joe Perches
2010-08-26 16:29     ` Stephen Hemminger
2010-08-26 17:02       ` Joe Perches
2010-08-31 14:15 ` Masayuki Ohtake
2010-08-31 14:51   ` Eric Dumazet
2010-09-02 12:39     ` Masayuki Ohtake [this message]
2010-09-02 13:40       ` Eric Dumazet
2010-09-02 15:10         ` Stephen Hemminger
2010-09-03 13:32           ` Masayuki Ohtake
2010-09-03 13:43             ` Eric Dumazet
2010-09-03 14:11               ` Masayuki Ohtake
2010-08-31 15:08   ` Randy Dunlap
2010-08-31 16:10   ` Joe Perches
2010-08-31 17:25     ` [PATCH] drivers/net/pch_gbe: Use bool not unsigned char Joe Perches
2010-08-31 18:38       ` [PATCH] drivers/net/pch_gbe: Cleanup stats use Joe Perches
2010-09-01  1:33         ` Stephen Hemminger
2010-09-01  1:38           ` Joe Perches
2010-09-03  2:23   ` [PATCH] Gigabit Ethernet driver of Topcliff PCH FUJITA Tomonori
2010-09-07  1:13     ` Masayuki Ohtake
2010-09-07  3:21       ` FUJITA Tomonori
2010-09-07  4:06         ` Masayuki Ohtake
2010-09-03 14:09 Masayuki Ohtake
2010-09-03 16:35 ` Jiri Slaby
2010-09-07  1:13   ` Masayuki Ohtake
2010-09-08 13:52   ` Masayuki Ohtake
2010-09-08 14:16     ` Jiri Slaby
2010-09-08 14:54       ` Stephen Hemminger
2010-09-08 14:55       ` Stephen Hemminger
2010-09-09 13:37         ` Masayuki Ohtake
2010-09-09 13:38       ` Masayuki Ohtake
2010-09-03 20:00 ` Joe Perches
2010-09-07  2:42 ` Masayuki Ohtake
2010-09-08 20:36   ` David Miller
2010-09-15 12:19     ` Masayuki Ohtake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000a01cb4a9b$e8d6ab00$66f8800a@maildom.okisemi.com' \
    --to=masa-korg@dsn.okisemi.com \
    --cc=andrew.chih.howe.khor@intel.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=gregory.v.rose@intel.com \
    --cc=joe@perches.com \
    --cc=joel.clark@intel.com \
    --cc=john.linn@xilinx.com \
    --cc=kristoffer@gaisler.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=margie.foster@intel.com \
    --cc=mbizon@freebox.fr \
    --cc=meego-dev@meego.com \
    --cc=morinaga526@dsn.okisemi.com \
    --cc=netdev@vger.kernel.org \
    --cc=okada533@dsn.okisemi.com \
    --cc=qi.wang@intel.com \
    --cc=ralf@linux-mips.org \
    --cc=randy.dunlap@oracle.com \
    --cc=sam@ravnborg.org \
    --cc=shemminger@vyatta.com \
    --cc=shimizu394@dsn.okisemi.com \
    --cc=yong.y.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome