File transfer problem

From: pramodh mallipatna (
Date: Wed May 24 2000 - 05:27:41 EST


Appreciate your patience to read this slightly long mail and answer.

I am trying trying to do File transfer over Ethernet using my own protocol
(non-IP). I read the contents in chunks (within the kernel, similar to
generic_file_read()), packetize it and send it across. I get the packet at
the other end (the contents are fine) and write it to the file (in either
of the two ways).

1. Using a routine similar to ext2_file_write() but the difference being,
   I do a memcpy() from the skbuff instead of the copy_from_user().
   PROBLEM: This works fine for files as large as 1MB but has problems
   for larger files like 25, 50MB files. I just get a huge dump and I
   can't even trace the calls. So, I don't know what is happening.

2. I mmap the output file using do_mmap() within the kernel and I memcpy
   the contents of the skbuff to this memory mapped buffer (Since do_mmap
   returns a user buffer, I map it to a kernel address and use this for
   memcpy. The user-kernel memory mapping part works fine, I have tested
   that independently). When I print out the contents of this buffer, it
   has the data which came from the skbuff. The memcpy is fine, in the
   sense that it doesn't panic/hang.

   PROBLEM: After the transfer, when I look at the contents of the file,
   it just has zeros.

I have tried transferring files within the kernel (on the same
machine) using do_mmap() for both input and output files. It just works

The communication part (transfer over Ethernet) works fine. i.e. if I just
send dummy packets, I get it at the other end without problems.

Could anyone help me debug the problem?


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

This archive was generated by hypermail 2b29 : Wed May 31 2000 - 21:00:11 EST