From: Iyappan Subramanian <isubramanian@apm.com>
To: David Laight <David.Laight@aculab.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"patches@apm.com" <patches@apm.com>,
"kchudgar@apm.com" <kchudgar@apm.com>
Subject: Re: [PATCH net-next 5/6] drivers: net: xgene-v2: Add transmit and receive
Date: Sun, 26 Feb 2017 21:11:33 -0800 [thread overview]
Message-ID: <CAKh23FnfarredMmtGiL25KmQwWus36aGv0dKoWnbmF-nwgJkKg@mail.gmail.com> (raw)
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6DB0277BB0@AcuExch.aculab.com>
On Wed, Feb 1, 2017 at 3:09 AM, David Laight <David.Laight@aculab.com> wrote:
> From Florian Fainelli
>> Sent: 31 January 2017 20:33
>> On 01/31/2017 11:03 AM, Iyappan Subramanian wrote:
>> > This patch adds,
>> > - Transmit
>> > - Transmit completion poll
>> > - Receive poll
>> > - NAPI handler
>> >
>> > and enables the driver.
>> >
>> > Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
>> > Signed-off-by: Keyur Chudgar <kchudgar@apm.com>
>> > ---
>>
>> > +
>> > + tx_ring = pdata->tx_ring;
>> > + tail = tx_ring->tail;
>> > + len = skb_headlen(skb);
>> > + raw_desc = &tx_ring->raw_desc[tail];
>> > +
>> > + /* Tx descriptor not available */
>> > + if (!GET_BITS(E, le64_to_cpu(raw_desc->m0)) ||
>> > + GET_BITS(PKT_SIZE, le64_to_cpu(raw_desc->m0)))
>> > + return NETDEV_TX_BUSY;
>
> Aren't you supposed to detect 'ring full' and stop the code
> giving you packets to transmit.
I'll add stop queue and wake queue.
>
>> > +
>> > + /* Packet buffers should be 64B aligned */
>
> Is that really a requirement of the hardware?
> Almost all ethernet frames are 4n+2 aligned.
Yes, it's a hardware requirement.
>
>> > + pkt_buf = dma_alloc_coherent(dev, XGENE_ENET_STD_MTU, &dma_addr,
>> > + GFP_ATOMIC);
>> > + if (unlikely(!pkt_buf))
>> > + goto out;
>>
>> Can't you obtain a DMA-API mapping for skb->data and pass it down to the
>> hardware? This copy here is inefficient.
>>
>> > +
>> > + memcpy(pkt_buf, skb->data, len);
>
> You really need to verify that the len <= XGENE_ENET_STD_MTU.
This version of the driver, doesn't support jumbo frame. So, the
check is not required.
>
> Isn't this code only transmitting the 'head' of the packet?
> What about the fragments??
This driver doesn't enable SG yet.
> ...
> David
>
next prev parent reply other threads:[~2017-02-27 5:11 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-31 19:03 [PATCH net-next 0/6] drivers: net: xgene-v2: Add RGMII based 1G driver Iyappan Subramanian
2017-01-31 19:03 ` [PATCH net-next 1/6] drivers: net: xgene-v2: Add DMA descriptor Iyappan Subramanian
2017-01-31 19:03 ` [PATCH net-next 2/6] drivers: net: xgene-v2: Add mac configuration Iyappan Subramanian
2017-01-31 19:03 ` [PATCH net-next 3/6] drivers: net: xgene-v2: Add ethernet hardware configuration Iyappan Subramanian
2017-01-31 19:03 ` [PATCH net-next 4/6] drivers: net: xgene-v2: Add base driver Iyappan Subramanian
2017-01-31 20:01 ` Andrew Lunn
2017-02-27 4:33 ` Iyappan Subramanian
2017-01-31 20:31 ` Florian Fainelli
2017-02-27 5:05 ` Iyappan Subramanian
2017-01-31 19:03 ` [PATCH net-next 5/6] drivers: net: xgene-v2: Add transmit and receive Iyappan Subramanian
2017-01-31 20:33 ` Florian Fainelli
2017-02-01 11:09 ` David Laight
2017-02-27 5:11 ` Iyappan Subramanian [this message]
2017-02-27 5:08 ` Iyappan Subramanian
2017-01-31 20:44 ` kbuild test robot
2017-01-31 20:49 ` kbuild test robot
2017-01-31 19:03 ` [PATCH net-next 6/6] MAINTAINERS: Add entry for APM X-Gene SoC Ethernet (v2) driver Iyappan Subramanian
2017-01-31 20:06 ` [PATCH net-next 0/6] drivers: net: xgene-v2: Add RGMII based 1G driver Andrew Lunn
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=CAKh23FnfarredMmtGiL25KmQwWus36aGv0dKoWnbmF-nwgJkKg@mail.gmail.com \
--to=isubramanian@apm.com \
--cc=David.Laight@aculab.com \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=kchudgar@apm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=netdev@vger.kernel.org \
--cc=patches@apm.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;
as well as URLs for NNTP newsgroup(s).