public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] [ARM] Change the UDP Checksum code to work with ARM data alignment.
       [not found] <mailman.241.1219120922.2783.u-boot@lists.denx.de>
@ 2008-08-26  4:01 ` Tom Evans
  2008-08-26 22:17   ` Wolfgang Denk
  0 siblings, 1 reply; 11+ messages in thread
From: Tom Evans @ 2008-08-26  4:01 UTC (permalink / raw)
  To: u-boot

 > From: Ben Warren <biggerbadderben@gmail.com>
 > Subject: Re: [U-Boot] ARM: net.c: UDP Checksum code
 >          failing every packet
 > To: Tom Evans <tom@ceos.com.au>
 > Cc: U-Boot <u-boot@lists.denx.de>
 > Message-ID: <48AA4BAE.2060204@gmail.com>
 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 >
 > Tom Evans wrote:
 > > > Ben Warren wrote:
 > > ...
 > > Besides which, I've never made a patch before, and
 > > couldn't find any instructions on how to do so.
 > >
 > There is good documentation out there, just not where
 > you looked.

I followed Ben's instructions and here's the resulting patch.

I don't have any hardware that is supported in the current distribution, 
so I can't perform a full compile-run-test pass on this patch. I've run 
the changes on our modified u-boot setup and it works. I've also changed 
the distribution Makefile for our cross compiler, added "#define 
CONFIG_UDP_CHECKSUM 1" to cradle.h, done "make cradle_config ; make" 
without any errors.

Signed-off-by: Tom Evans <tom.evans@ceos.com.au>
---
  net/net.c |   12 +++++++-----
  1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/net/net.c b/net/net.c
index 313d5d8..c8cda77 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1494,10 +1494,12 @@ NetReceive(volatile uchar * inpkt, int len)

                         xsum  = ip->ip_p;
                         xsum += (ntohs(ip->udp_len));
-                       xsum += (ntohl(ip->ip_src) >> 16) & 0x0000ffff;
-                       xsum += (ntohl(ip->ip_src) >>  0) & 0x0000ffff;
-                       xsum += (ntohl(ip->ip_dst) >> 16) & 0x0000ffff;
-                       xsum += (ntohl(ip->ip_dst) >>  0) & 0x0000ffff;
+                       tmp = NetReadIP(&ip->ip_src);
+                       xsum += (ntohl(tmp) >> 16) & 0x0000ffff;
+                       xsum += (ntohl(tmp) >>  0) & 0x0000ffff;
+                       tmp = NetReadIP(&ip->ip_dst);
+                       xsum += (ntohl(tmp) >> 16) & 0x0000ffff;
+                       xsum += (ntohl(tmp) >>  0) & 0x0000ffff;

                         sumlen = ntohs(ip->udp_len);
                         sumptr = (ushort *) &(ip->udp_src);
@@ -1520,7 +1522,7 @@ NetReceive(volatile uchar * inpkt, int len)
                                 xsum = (xsum & 0x0000ffff) + ((xsum >> 
16) & 0x0000ffff);
                         }
                         if ((xsum != 0x00000000) && (xsum != 0x0000ffff)) {
-                               printf(" UDP wrong checksum %08lx %08x\n",
+                               printf("\nUDP wrong checksum %08lx %08x\n",
                                         xsum, ntohs(ip->udp_xsum));
                                 return;
                         }
--
1.5.5.1


-- 
===
Tom Evans      Tom.Evans at ceos.com.au
CEOS Pty Ltd   www.ceos.com.au
3/17 Burgundy St, Heidelberg,
Victoria 3084, Australia

Phone  (+61 3) 9458 4955
Direct         Unsupported
FAX    (+61 3) 9458 4966
Mobile         0405 776 431

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH] [ARM] Change the UDP Checksum code to work with ARM data alignment.
  2008-08-26  4:01 ` Tom Evans
@ 2008-08-26 22:17   ` Wolfgang Denk
  0 siblings, 0 replies; 11+ messages in thread
From: Wolfgang Denk @ 2008-08-26 22:17 UTC (permalink / raw)
  To: u-boot

Dear Tom Evans,

In message <48B38020.4010204@ceos.com.au> you wrote:
>
> I followed Ben's instructions and here's the resulting patch.

I'm sorry, but this patch is corrupted and cannot be applied.

> --- a/net/net.c
> +++ b/net/net.c
> @@ -1494,10 +1494,12 @@ NetReceive(volatile uchar * inpkt, int len)
> 
>                          xsum  = ip->ip_p;
>                          xsum += (ntohs(ip->udp_len));
> -                       xsum += (ntohl(ip->ip_src) >> 16) & 0x0000ffff;
> -                       xsum += (ntohl(ip->ip_src) >>  0) & 0x0000ffff;
> -                       xsum += (ntohl(ip->ip_dst) >> 16) & 0x0000ffff;
> -                       xsum += (ntohl(ip->ip_dst) >>  0) & 0x0000ffff;

In the original code, there were no spaces but TAB characters used for
indentation. Someone (you?) must have changed this, and in a way that
was not even noticed when you created the patch. This is very
strange. Something is severely broken in your setup.

> +                       tmp = NetReadIP(&ip->ip_src);
> +                       xsum += (ntohl(tmp) >> 16) & 0x0000ffff;
> +                       xsum += (ntohl(tmp) >>  0) & 0x0000ffff;
> +                       tmp = NetReadIP(&ip->ip_dst);
> +                       xsum += (ntohl(tmp) >> 16) & 0x0000ffff;
> +                       xsum += (ntohl(tmp) >>  0) & 0x0000ffff;
> 
>                          sumlen = ntohs(ip->udp_len);
>                          sumptr = (ushort *) &(ip->udp_src);
> @@ -1520,7 +1522,7 @@ NetReceive(volatile uchar * inpkt, int len)
>                                  xsum = (xsum & 0x0000ffff) + ((xsum >> 
> 16) & 0x0000ffff);
^^^^^^^^^^^^^^^^^^^^

Here your mailer wrapped long lines, which also makes the patch
useless.

Please fix and resubmit.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Fascinating, a totally parochial attitude.
	-- Spock, "Metamorphosis", stardate 3219.8

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH] [ARM] Change the UDP Checksum code to work with ARM data alignment.
       [not found] <mailman.383.1219789049.2783.u-boot@lists.denx.de>
@ 2008-08-27  5:23 ` Tom Evans
  2008-08-27  5:28   ` Ben Warren
  0 siblings, 1 reply; 11+ messages in thread
From: Tom Evans @ 2008-08-27  5:23 UTC (permalink / raw)
  To: u-boot

Wolfgang Denk wrote:
 > In message <48B38020.4010204@ceos.com.au> you wrote:
 > > >
 > > > I followed Ben's instructions and here's the resulting patch.
 >
 > I'm sorry, but this patch is corrupted and cannot be applied.
 >
 > In the original code, there were no spaces but TAB
 > characters used for indentation. Someone (you?)

Not me.

 > Something is severely broken in your setup.

Windows or Thunderbird, take your pick. :-)

I'll try to email from one of our physical or virtual linux machines. If 
that doesn't work I'll have to send the patch as a zipped attachment. Or 
gzipped. Is this allowable or does it have to be "real email text"?

-
===
Tom Evans      Tom.Evans at ceos.com.au
CEOS Pty Ltd   www.ceos.com.au
3/17 Burgundy St, Heidelberg,
Victoria 3084, Australia

Phone  (+61 3) 9458 4955
Direct         Unsupported
FAX    (+61 3) 9458 4966
Mobile         0405 776 431

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH] [ARM] Change the UDP Checksum code to work with ARM data alignment.
  2008-08-27  5:23 ` [U-Boot] [PATCH] [ARM] Change the UDP Checksum code to work with ARM data alignment Tom Evans
@ 2008-08-27  5:28   ` Ben Warren
  2008-08-27  8:39     ` Wolfgang Denk
  0 siblings, 1 reply; 11+ messages in thread
From: Ben Warren @ 2008-08-27  5:28 UTC (permalink / raw)
  To: u-boot

Hi Tom,

Tom Evans wrote:
> Wolfgang Denk wrote:
>  > In message <48B38020.4010204@ceos.com.au> you wrote:
>  > > >
>  > > > I followed Ben's instructions and here's the resulting patch.
>  >
>  > I'm sorry, but this patch is corrupted and cannot be applied.
>  >
>  > In the original code, there were no spaces but TAB
>  > characters used for indentation. Someone (you?)
>
> Not me.
>
>  > Something is severely broken in your setup.
>
> Windows or Thunderbird, take your pick. :-)
>
> I'll try to email from one of our physical or virtual linux machines. If 
> that doesn't work I'll have to send the patch as a zipped attachment. Or 
> gzipped. Is this allowable or does it have to be "real email text"?
>   
The only 100%* way to send patches is using git-send-email, but it's a 
small pain to set up especially if you're not going to be using it much. 
I've had decent luck with Thunderbird, as long as you select 'Preformat' 
for the patch part of your e-mail and send it as plain text. Please try 
this. If it still doesn't work I'll fix it manually.

regards,
Ben

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH] [ARM] Change the UDP Checksum code to work with ARM data alignment.
  2008-08-27  5:28   ` Ben Warren
@ 2008-08-27  8:39     ` Wolfgang Denk
  2008-08-27  8:58       ` Stefan Roese
  2008-08-27 14:06       ` Ben Warren
  0 siblings, 2 replies; 11+ messages in thread
From: Wolfgang Denk @ 2008-08-27  8:39 UTC (permalink / raw)
  To: u-boot

Dear Ben Warren,

In message <48B4E607.8040700@gmail.com> you wrote:
> 
> The only 100%* way to send patches is using git-send-email, but it's a 
> small pain to set up especially if you're not going to be using it much. 

oops? What do you mean by "pain to set up" ? You don;t have to set up
anything.

Just type:

	git-send-email --to u-boot at lists.denx.de patch...

> I've had decent luck with Thunderbird, as long as you select 'Preformat' 
> for the patch part of your e-mail and send it as plain text. Please try 
> this. If it still doesn't work I'll fix it manually.

You do not need Thunderbird or any other MUA at all.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Eeeek!
'eval' on strings should have been named 'evil'.    -- Tom Phoenix in
        <Pine.GSO.3.96.980526121813.27437N-100000@user2.teleport.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH] [ARM] Change the UDP Checksum code to work with ARM data alignment.
  2008-08-27  8:39     ` Wolfgang Denk
@ 2008-08-27  8:58       ` Stefan Roese
  2008-08-27  9:34         ` Wolfgang Denk
  2008-08-27 14:06       ` Ben Warren
  1 sibling, 1 reply; 11+ messages in thread
From: Stefan Roese @ 2008-08-27  8:58 UTC (permalink / raw)
  To: u-boot

On Wednesday 27 August 2008, Wolfgang Denk wrote:
> > The only 100%* way to send patches is using git-send-email, but it's a
> > small pain to set up especially if you're not going to be using it much.
>
> oops? What do you mean by "pain to set up" ? You don;t have to set up
> anything.
>
> Just type:
>
> 	git-send-email --to u-boot at lists.denx.de patch...

You forgot about the configuration you have done in your ~/.gitconfig file 
([sendemail] section, smtpserver...). But is not really hard to configure. 
And it really is worth the effort.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH] [ARM] Change the UDP Checksum code to work with ARM data alignment.
  2008-08-27  8:58       ` Stefan Roese
@ 2008-08-27  9:34         ` Wolfgang Denk
  2008-08-27  9:49           ` Stefan Roese
  0 siblings, 1 reply; 11+ messages in thread
From: Wolfgang Denk @ 2008-08-27  9:34 UTC (permalink / raw)
  To: u-boot

Dear Stefan Roese,

In message <200808271058.21467.sr@denx.de> you wrote:
> >
> > Just type:
> >
> > 	git-send-email --to u-boot at lists.denx.de patch...
> 
> You forgot about the configuration you have done in your ~/.gitconfig file 
> ([sendemail] section, smtpserver...). But is not really hard to configure. 
> And it really is worth the effort.

No, I did not forget this:

	-> ls -l ~/.gitconfig
	ls: cannot access /home/wd/.gitconfig: No such file or directory

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Testing can show the presense of bugs, but not their absence.
                                                   -- Edsger Dijkstra

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH] [ARM] Change the UDP Checksum code to work with ARM data alignment.
  2008-08-27  9:34         ` Wolfgang Denk
@ 2008-08-27  9:49           ` Stefan Roese
  2008-08-27 11:07             ` Wolfgang Denk
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Roese @ 2008-08-27  9:49 UTC (permalink / raw)
  To: u-boot

On Wednesday 27 August 2008, Wolfgang Denk wrote:
> > > Just type:
> > >
> > > 	git-send-email --to u-boot at lists.denx.de patch...
> >
> > You forgot about the configuration you have done in your ~/.gitconfig
> > file ([sendemail] section, smtpserver...). But is not really hard to
> > configure. And it really is worth the effort.
>
> No, I did not forget this:
>
> 	-> ls -l ~/.gitconfig
> 	ls: cannot access /home/wd/.gitconfig: No such file or directory

Hmmm. Then I'm really curious how git-send-email know to which SMTP server to 
send this mail.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH] [ARM] Change the UDP Checksum code to work with ARM data alignment.
  2008-08-27  9:49           ` Stefan Roese
@ 2008-08-27 11:07             ` Wolfgang Denk
  2008-08-27 12:27               ` JerryVanBaren
  0 siblings, 1 reply; 11+ messages in thread
From: Wolfgang Denk @ 2008-08-27 11:07 UTC (permalink / raw)
  To: u-boot

Dear Stefan Roese,

In message <200808271149.46867.sr@denx.de> you wrote:
>
> Hmmm. Then I'm really curious how git-send-email know to which SMTP server to 
> send this mail.

It runs "sendmail" to send the message, assuming you have  a  working
mail configuration on your host.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
This is now.  Later is later.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH] [ARM] Change the UDP Checksum code to work with ARM data alignment.
  2008-08-27 11:07             ` Wolfgang Denk
@ 2008-08-27 12:27               ` JerryVanBaren
  0 siblings, 0 replies; 11+ messages in thread
From: JerryVanBaren @ 2008-08-27 12:27 UTC (permalink / raw)
  To: u-boot

Wolfgang Denk wrote:
> Dear Stefan Roese,
> 
> In message <200808271149.46867.sr@denx.de> you wrote:
>> Hmmm. Then I'm really curious how git-send-email know to which SMTP server to 
>> send this mail.
> 
> It runs "sendmail" to send the message, assuming you have  a  working
> mail configuration on your host.
> 
> Best regards,
> 
> Wolfgang Denk

"...assuming you have a working mail configuration on your host." 
Winders hosts don't have a working mail configuration ("sendmail" or 
localhost port 25 support), which means that the people that need 
git-send-email worst (those stuck in a Winders-centric corporate borg) 
require setup and luck.

If you are a borger (that would be Germanization of "lives in a borg," 
IIRC), your Exchange server may support port 25 (IIUC, it is an optional 
configuration item, but probably configured).

You first need to know the name of your Exchange server.
1. In Outlook, select the menu selection Tools/Email Accounts which 
brings up a dialog allowing you to "View or change existing e-mail accounts"
2. Click the "Next" button which brings up the next dialog box.
3. Select the "Microsoft Exchange Server" account and click the "Change" 
button.
4. This dialog box shows your Exchange server name.  Hopefully it 
supports port 25 communications.
5. Click the "Cancel" button to exit without changing your Outlook setup.

You may need to authenticate, in which case you would use "domain\user" 
(where "domain" is your ActiveDirectory domain, "user" is your user 
name, and the backslash *is* a backslash and may need to be quoted/doubled).

I have done this with Thunderbird[1] on Windows (check my headers, but 
please don't tell the IT staff ;-), but I have *not* done it with 
git-send-email.  If anybody tries this, please let us know how it worked 
out (success or failure).

Thanks & good luck,
gvb

[1] The Exchange server I connect to actually supports IMAP as well as 
port 25 and it works very well (surprisingly).

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH] [ARM] Change the UDP Checksum code to work with ARM data alignment.
  2008-08-27  8:39     ` Wolfgang Denk
  2008-08-27  8:58       ` Stefan Roese
@ 2008-08-27 14:06       ` Ben Warren
  1 sibling, 0 replies; 11+ messages in thread
From: Ben Warren @ 2008-08-27 14:06 UTC (permalink / raw)
  To: u-boot

Wolfgang Denk wrote:
> Dear Ben Warren,
>
> In message <48B4E607.8040700@gmail.com> you wrote:
>   
>> The only 100%* way to send patches is using git-send-email, but it's a 
>> small pain to set up especially if you're not going to be using it much. 
>>     
>
> oops? What do you mean by "pain to set up" ? You don;t have to set up
> anything.
>
> Just type:
>
> 	git-send-email --to u-boot at lists.denx.de patch...
>   
Sure, if you have easy access to an SMTP server and have sendmail 
running it's trivial.  If you use gmail, there are a few hoops you need 
to jump through regarding authentication.  All-in-all, worth the effort 
if you're going to do it more than once.

regards,
Ben

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-08-27 14:06 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.383.1219789049.2783.u-boot@lists.denx.de>
2008-08-27  5:23 ` [U-Boot] [PATCH] [ARM] Change the UDP Checksum code to work with ARM data alignment Tom Evans
2008-08-27  5:28   ` Ben Warren
2008-08-27  8:39     ` Wolfgang Denk
2008-08-27  8:58       ` Stefan Roese
2008-08-27  9:34         ` Wolfgang Denk
2008-08-27  9:49           ` Stefan Roese
2008-08-27 11:07             ` Wolfgang Denk
2008-08-27 12:27               ` JerryVanBaren
2008-08-27 14:06       ` Ben Warren
     [not found] <mailman.241.1219120922.2783.u-boot@lists.denx.de>
2008-08-26  4:01 ` Tom Evans
2008-08-26 22:17   ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox