Jean Tourrilhes <[EMAIL PROTECTED]> writes:
> @@ -852,6 +861,12 @@ static int irda_sendmsg(struct socket *s
> }
>
> /* Check that we don't send out to big frames */
> + /* I'm not sure, but I believe that around here we should split
> + * big frames into smaller chunk
Yes, this is exactly what this function does (but in collaboration with the
client) In a STREAM based protocol, you should just chop the data into
smaller chunks. But this function does however not fragment a big frame
into many smaller frames. It will only take one bite of it and tell the
client how big bite it took. The client must then repeat this process until
all data is sent. It must do this anyway, since it cannot depend upon the
kernel sending all the data (this is the same for TCP). So this moves the
fragmentation from the kernel to the client. Why? Well, now this function
can be used for both STREAM and SEQPACK services. You could reduce the
number of syscalls by doing frag' in the kernel, but ...
> and perform coalesce on smaller
> + * chunks to group them in bigger packets, as it is done
> + * in 'tcp_do_sendmsg'...
The Linux-IrDA socket interface does not buffer frames, since this must be
done by TTP anyway, so such a feature should probably be impl. by TTP
instead.
> + * As the service is reliable AND sequenced, the higher layer won't
> + * see the difference and the performance will be better... */
Yes, it might perform a little better. But the issue here is not SEQUENCED
but STREAMING. You _cannot_ do this thing in a sequenced packet service!!!
This is only for a streaming service where message boundaries are not
preserved. Think of IrLAN. IrLAN needs a sequenced packet service (TTP with
SAR), and you cannot start fragmenting IrLAN frames at random places or
join IrLAN frames in order to transport the data faster. TTP SAR may
fragment, but similar to UDP, it will make sure that they are defragmented
into the _original_ frames again.
> if (len > self->max_data_size) {
> IRDA_DEBUG(0, __FUNCTION__ "(), Warning to much data! "
> "Chopping frame from %d to %d bytes!\n", len,
> @@ -883,6 +898,71 @@ static int irda_sendmsg(struct socket *s
> }
PS. I'm applying your changes (UNITDATA), but as a datagram service. If
somebody needs ULTRA, they will deal with the name conflicts later.
-- Dag
--
/ Dag Brattli | The Linux-IrDA Project /
// University of Tromsoe, Norway | Infrared communication for Linux //
/// http://www.cs.uit.no/~dagb | http://www.cs.uit.no/linux-irda/ ///
_______________________________________________
Linux-IrDA mailing list - [EMAIL PROTECTED]
http://www4.pasta.cs.UiT.No/mailman/listinfo/linux-irda