From: Pantelis Antoniou <panto@intracom.gr>
To: joakim.tjernlund@lumentis.se
Cc: Linuxppc-Embedded <linuxppc-embedded@lists.linuxppc.org>
Subject: Re: [PATCH] arch/ppc/8xx_io/enet.c, version 3
Date: Mon, 10 Feb 2003 16:51:10 +0200 [thread overview]
Message-ID: <3E47BC5E.2010903@intracom.gr> (raw)
In-Reply-To: <IGEFJKJNHJDCBKALBJLLGECAFKAA.joakim.tjernlund@lumentis.se>
[-- Attachment #1: Type: text/plain, Size: 496 bytes --]
Joakim Tjernlund wrote:
>>Hi guys,
>>
>>I have created a patch that applies cleanly to the head of
>>linuxppc_2_4_devel
>>and it works great.
>>
>>Keep up the good work!
>>
>>Pantelis
>>
>>
>
>Hi Pantelis
>
>I don't follow you here. Didn't my patch apply cleanly against linuxppc_2_4_devel?
>I generated my patch against linuxppc_2_4_devel(I think).
>
> Jocke
>
>
>
>
>
Nope.
Fails at hunks #7 and #8.
Don't worry, it's trivial stuff.
Here is enet.c.rej, if you want to check it.
Regards
[-- Attachment #2: enet.c.rej --]
[-- Type: text/plain, Size: 5586 bytes --]
***************
*** 458,540 ****
*/
bdp = cep->cur_rx;
- for (;;) {
- if (bdp->cbd_sc & BD_ENET_RX_EMPTY)
- break;
-
#ifndef final_version
- /* Since we have allocated space to hold a complete frame, both
- * the first and last indicators should be set.
- */
- if ((bdp->cbd_sc & (BD_ENET_RX_FIRST | BD_ENET_RX_LAST)) !=
- (BD_ENET_RX_FIRST | BD_ENET_RX_LAST))
printk("CPM ENET: rcv is not first+last\n");
#endif
-
- /* Frame too long or too short.
- */
- if (bdp->cbd_sc & (BD_ENET_RX_LG | BD_ENET_RX_SH))
- cep->stats.rx_length_errors++;
- if (bdp->cbd_sc & BD_ENET_RX_NO) /* Frame alignment */
- cep->stats.rx_frame_errors++;
- if (bdp->cbd_sc & BD_ENET_RX_CR) /* CRC Error */
- cep->stats.rx_crc_errors++;
- if (bdp->cbd_sc & BD_ENET_RX_OV) /* FIFO overrun */
- cep->stats.rx_crc_errors++;
-
- /* Report late collisions as a frame error.
- * On this error, the BD is closed, but we don't know what we
- * have in the buffer. So, just drop this frame on the floor.
- */
- if (bdp->cbd_sc & BD_ENET_RX_CL) {
- cep->stats.rx_frame_errors++;
- }
- else {
-
- /* Process the incoming frame.
- */
- cep->stats.rx_packets++;
- pkt_len = bdp->cbd_datlen;
- cep->stats.rx_bytes += pkt_len;
-
- /* This does 16 byte alignment, much more than we need.
- * The packet length includes FCS, but we don't want to
- * include that when passing upstream as it messes up
- * bridging applications.
- */
- skb = dev_alloc_skb(pkt_len-4);
-
- if (skb == NULL) {
- printk("%s: Memory squeeze, dropping packet.\n", dev->name);
- cep->stats.rx_dropped++;
- }
- else {
- skb->dev = dev;
- skb_put(skb,pkt_len-4); /* Make room */
- eth_copy_and_sum(skb,
- cep->rx_vaddr[bdp - cep->rx_bd_base],
- pkt_len-4, 0);
- skb->protocol=eth_type_trans(skb,dev);
- netif_rx(skb);
}
}
-
- /* Clear the status flags for this buffer.
- */
- bdp->cbd_sc &= ~BD_ENET_RX_STATS;
-
- /* Mark the buffer empty.
- */
- bdp->cbd_sc |= BD_ENET_RX_EMPTY;
-
- /* Update BD pointer to next entry.
- */
- if (bdp->cbd_sc & BD_ENET_RX_WRAP)
- bdp = cep->rx_bd_base;
- else
- bdp++;
-
- }
cep->cur_rx = (cbd_t *)bdp;
return 0;
--- 464,556 ----
*/
bdp = cep->cur_rx;
+ for (;;) {
+ if (bdp->cbd_sc & BD_ENET_RX_EMPTY)
+ break;
+
+ #define RX_BD_ERRORS (BD_ENET_RX_LG | BD_ENET_RX_SH | BD_ENET_RX_NO | BD_ENET_RX_CR | BD_ENET_RX_OV | BD_ENET_RX_CL)
#ifndef final_version
+ /* Since we have allocated space to hold a complete frame, both
+ * the first and last indicators should be set.
+ */
+ if ((bdp->cbd_sc & (BD_ENET_RX_FIRST | BD_ENET_RX_LAST)) !=
+ (BD_ENET_RX_FIRST | BD_ENET_RX_LAST))
printk("CPM ENET: rcv is not first+last\n");
#endif
+ if(bdp->cbd_sc & RX_BD_ERRORS){ /* Receive errors ? */
+ cep->stats.rx_errors++;
+ if (bdp->cbd_sc & (BD_ENET_RX_LG | BD_ENET_RX_SH)) /* Frame too long or too short. */
+ cep->stats.rx_length_errors++;
+ if (bdp->cbd_sc & BD_ENET_RX_NO) /* Frame alignment */
+ cep->stats.rx_frame_errors++;
+ if (bdp->cbd_sc & BD_ENET_RX_CR) /* CRC Error */
+ cep->stats.rx_crc_errors++;
+ if (bdp->cbd_sc & BD_ENET_RX_OV) /* FIFO overrun */
+ cep->stats.rx_fifo_errors++;
+ if (bdp->cbd_sc & BD_ENET_RX_CL) /* Late collision */
+ cep->stats.collisions++;
+ } else {
+ /* Process the incoming frame.
+ */
+ cep->stats.rx_packets++;
+ pkt_len = bdp->cbd_datlen;
+ cep->stats.rx_bytes += pkt_len;
+ pkt_len -= 4; /* The packet length includes FCS, but we don't want to
+ * include that when passing upstream as it messes up
+ * bridging applications. Is this still true ???? */
+ #ifdef COPY_SMALL_FRAMES
+ /* Allocate the next buffer now so we are sure to have one when needed
+ * This does 16 byte alignment, exactly what we need(L1_CACHE aligned). */
+ if(pkt_len < RX_COPYBREAK)
+ skb_tmp = __dev_alloc_skb(pkt_len, GFP_ATOMIC | GFP_DMA);
+ else
+ #endif
+ skb_tmp = __dev_alloc_skb(CPM_ENET_RX_FRSIZE, GFP_ATOMIC | GFP_DMA);
+
+ if (skb_tmp == NULL) {
+ printk("%s: Memory squeeze, dropping packet.\n", dev->name);
+ cep->stats.rx_dropped++;
+
+ } else {
+ skb = cep->rx_vaddr[bdp - cep->rx_bd_base];
+ #ifdef COPY_SMALL_FRAMES
+ if(pkt_len < RX_COPYBREAK) {
+ typeof(skb) skb_swap = skb;
+ memcpy(skb_put(skb_tmp, pkt_len), skb->data, pkt_len);
+ /* swap the skb and skb_tmp */
+ skb = skb_tmp;
+ skb_tmp = skb_swap;
+ }
+ else
+ #endif
+ {
+ skb_put(skb, pkt_len); /* Make room */
+ bdp->cbd_bufaddr = __pa(skb_tmp->data);
+ cep->rx_vaddr[bdp - cep->rx_bd_base] = skb_tmp;
+ }
+ dma_cache_inv((unsigned long) skb_tmp->data, CPM_ENET_RX_FRSIZE);
+ skb->dev = dev;
+ skb->protocol=eth_type_trans(skb, dev);
+ netif_rx(skb);
+ }
}
+
+ /* Clear the status flags for this buffer.
+ */
+ bdp->cbd_sc &= ~BD_ENET_RX_STATS;
+
+ /* Mark the buffer empty.
+ */
+ bdp->cbd_sc |= BD_ENET_RX_EMPTY;
+
+ /* Update BD pointer to next entry.
+ */
+ if (bdp->cbd_sc & BD_ENET_RX_WRAP)
+ bdp = cep->rx_bd_base;
+ else
+ bdp++;
+
}
cep->cur_rx = (cbd_t *)bdp;
return 0;
***************
*** 608,614 ****
dmi = dev->mc_list;
- for (i=0; i<dev->mc_count; i++) {
/* Only support group multicast for now.
*/
--- 624,630 ----
dmi = dev->mc_list;
+ for (i=0; i<dev->mc_count; i++, dmi = dmi->next) {
/* Only support group multicast for now.
*/
next prev parent reply other threads:[~2003-02-10 14:51 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <IGEFJKJNHJDCBKALBJLLCEOFFJAA.joakim.tjernlund@lumentis.se>
2003-02-04 9:50 ` [PATCH] arch/ppc/8xx_io/enet.c, version 3 Stephan Linke
2003-02-04 9:58 ` Joakim Tjernlund
2003-02-10 11:10 ` Pantelis Antoniou
2003-02-10 14:29 ` Joakim Tjernlund
2003-02-10 14:51 ` Pantelis Antoniou [this message]
2003-02-10 15:28 ` Joakim Tjernlund
2003-02-10 15:28 ` Pantelis Antoniou
2003-02-10 16:16 ` Joakim Tjernlund
2003-02-12 8:22 ` Pantelis Antoniou
2003-02-10 11:57 ` Steven Scholz
2003-02-10 12:28 ` Joakim Tjernlund
2003-02-10 14:35 ` Joakim Tjernlund
[not found] <FCEAKDJJAPHPLJFINDAJGEGICNAA.Stephan.Linke@epygi.de>
2003-02-04 10:06 ` Stephan Linke
2002-10-24 15:46 [PATCH] arch/ppc/8xx_io/enet.c, version 2 Joakim Tjernlund
2003-01-28 11:54 ` [PATCH] arch/ppc/8xx_io/enet.c, version 3 Joakim Tjernlund
2003-02-03 10:21 ` Joakim Tjernlund
2003-02-03 12:28 ` Pantelis Antoniou
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=3E47BC5E.2010903@intracom.gr \
--to=panto@intracom.gr \
--cc=joakim.tjernlund@lumentis.se \
--cc=linuxppc-embedded@lists.linuxppc.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 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.