mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "James Kosin" <JKosin@intcomgrp.com>
To: <linux-kernel@vger.kernel.org>
Subject: arm: Optimization for ethernet MAC handling at91_ether.c
Date: Tue, 12 Jan 2010 10:39:25 -0500	[thread overview]
Message-ID: <3DBBD805E3BA064A87F551C0E8BD3674028973F5@MAILSRV.intcomgrp.com> (raw)

Everyone,

Since, a AT91_EMAC_TUND only happens when the transmitter is unable to
transfer the frame in time for a frame to be sent.  It makes sense to
RETRY the packet in this condition in the ISR.
Or would this overcomplicate a simple task?
                ... see below ...

James

---- code snippet ----

/*
 * MAC interrupt handler
 */
static irqreturn_t at91ether_interrupt(int irq, void *dev_id) { ...

                if (intstatus & AT91_EMAC_TCOM) {       /* Transmit
complete */
                                /* The TCOM bit is set even if the
transmission failed. */
                                if (intstatus & (AT91_EMAC_TUND |
AT91_EMAC_RTRY))
                                                dev->stats.tx_errors +=
1;

                                if (lp->skb) {
 
dev_kfree_skb_irq(lp->skb);
                                                lp->skb = NULL;
                                                dma_unmap_single(NULL,
lp->skb_physaddr, lp->skb_length, DMA_TO_DEVICE);
                                }
                                netif_wake_queue(dev);
                }
...

---- Alternate approach ----

                                /* The TCOM bit is set even if the
transmission failed. */
                                if (intstatus & (AT91_EMAC_TUND)) {
                                                /* Set address of the
data in the Transmit Address register */
 
at91_emac_write(AT91_EMAC_TAR, lp->skb_physaddr);
                                                /* Set length of the
packet in the Transmit Control register */
 
at91_emac_write(AT91_EMAC_TCR, skb->len);
                                }
                                else if (intstatus & (AT91_EMAC_RTRY))
                                                dev->stats.tx_errors +=
1;

...
I do know there needs to be a bit more code then to handle the
successful case below this; but, this is enough to understand what I am
talking about.  The UNDERRUN error should happen infrequently and in
ideal circumstances not happen at all.
 
 


----
James Kosin
Software Engineer

             reply	other threads:[~2010-01-12 15:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-12 15:39 James Kosin [this message]
2010-01-12 16:35 ` Eric Dumazet
2010-01-12 17:51   ` James Kosin
2010-01-12 18:08     ` Eric Dumazet
2010-01-12 18:42       ` James Kosin
2010-01-12 19:03         ` James Kosin
2010-01-12 19:24           ` Eric Dumazet
2010-01-12 19:39             ` James Kosin

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=3DBBD805E3BA064A87F551C0E8BD3674028973F5@MAILSRV.intcomgrp.com \
    --to=jkosin@intcomgrp.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®