svn commit: r205024 - head/sys/net

Qing Li qingli at freebsd.org
Fri Mar 12 07:27:02 UTC 2010


That's a good idea. I will take your approach.

-- Qing


On Thu, Mar 11, 2010 at 11:15 PM, Julian Elischer <julian at elischer.org> wrote:
> Juli Mallett wrote:
>>
>> On Thu, Mar 11, 2010 at 15:39, Qing Li <qingli at freebsd.org> wrote:
>>>
>>> I guess it's a good time to clean things up. The if_link_state code has
>>> been
>>> around for quite some time, either it be fully utilized or not be there
>>> at all.
>>> The inconsistency is the root cause.
>>
>> Sure.  There is an increasing amount of stuff that network drivers are
>> expected to do, but they work without doing them.  It's easy to think
>> you have a functioning network driver and that you can get by without
>> adding support for media changes and link status reporting, etc.
>>
>>> I will try going through these tonight and hopefully the fix all take a
>>> common approach.
>
> probably should add a flag that means "we have media state"
> and if it is not set, assume it is always on.
>
>>
>> If you can think of a way to add some invariants (warn the first time
>> a driver receives a packet without having ever set the link state,
>> make sure the media status callback sets the valid flag in the
>> request, etc) that would probably be very helpful for people who are
>> writing network drivers.  If I hadn't been following the threads about
>> your changes, I would have had to spend much longer fixing the Octeon
>> port's Ethernet driver, wondering why suddenly it broke and
>> instrumenting the routing code.  A printf would go a long way.
>>
>> Juli.
>
>


More information about the svn-src-head mailing list