Linux-kernel mailing list archive 2000-02,: Re: dev->hard_header() calling mess

# Re: dev->hard_header() calling mess

kuznet@ms2.inr.ac.ru
Mon, 10 Jan 2000 19:56:06 +0300 (MSK)

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Bjorn Wesen: "Re: how to set DVD read speed for Pioneer DVD-303S ?"
- Previous message: Andrea Arcangeli: "Re: [2.2.13aa6 (bugfix release II) ]"

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/

- Next message: Bjorn Wesen: "Re: how to set DVD read speed for Pioneer DVD-303S ?"
- Previous message: Andrea Arcangeli: "Re: [2.2.13aa6 (bugfix release II) ]"