Re: dev->hard_header() calling mess

From: kuznet@ms2.inr.ac.ru
Date: Mon Jan 10 2000 - 11:56:06 EST


Hello!

> function is called. In many places in the kernel its return value is
> not checked.

It is not checked, when it is useless to check it. It is supplied with
correct addresses and protocols and it has no reasons to fail.

You are right, certainly. If some devices do fail to digest
valid information, it should be repaired.

> This means that in the Sangoma drivers when an
> incompatible frame type is transmitted the hard_header function
> returns 0, sets skb->protocol to zero,

It is absolutely wrong. It must not touch skb->protocol!

If it wants to report error, it should return negative value
and reserve necessary room, probably filling the space with necessary
control/error information.

> and discards the packet down
> in the hard_header_xmit routine AFTER sending the packet throught the
> device transmit queue. If the return value was checked from calls to
> the hard_header routine, the packet could be immediately discarded
> instead of wasting time and CPU cycles feeding it throught the device
> transmit queues.

Do you want to say that transmission of "incompatible frame types"
in several exceptional situations eats some CPU? 8)8)8)
Do not be silly, we will lose by several order more time checking
this return value.

It does not cancel the fact, that it should be fixed yet.

Alexey

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jan 15 2000 - 21:00:15 EST