netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* e1000 speed/duplex error
@ 2006-08-01 10:18 a1
  2006-08-01 11:20 ` Jeff Kirsher
  0 siblings, 1 reply; 16+ messages in thread
From: a1 @ 2006-08-01 10:18 UTC (permalink / raw)
  To: netdev

I'm trying to set my nic to force 100Mb/FD, but I'm constantly getting 100/HD on
other side of the link.

The command is:
ethtool -s eth0 speed 100 duplex full autoneg off

e1000 driver version 7.1.9 (latest) downloaded from sourceforge.

Are there any problems?

-- 
 alkot                          mailto:a1k@mail.ru


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: e1000 speed/duplex error
  2006-08-01 10:18 e1000 speed/duplex error a1
@ 2006-08-01 11:20 ` Jeff Kirsher
  2006-08-01 12:03   ` Re[2]: " a1
       [not found]   ` <793732866.20060801153230@mail.ru>
  0 siblings, 2 replies; 16+ messages in thread
From: Jeff Kirsher @ 2006-08-01 11:20 UTC (permalink / raw)
  To: a1; +Cc: netdev

On 8/1/06, a1 <a1k@mail.ru> wrote:
> I'm trying to set my nic to force 100Mb/FD, but I'm constantly getting 100/HD on
> other side of the link.
>
> The command is:
> ethtool -s eth0 speed 100 duplex full autoneg off
>
> e1000 driver version 7.1.9 (latest) downloaded from sourceforge.
>

What are you linking to? And what is the link partner set to?

If one link partner is set to auto-negotiate, and the other partner
forced, it is common to see this issue no matter what the two link
partners are.

> Are there any problems?

Not that I am aware of.

-- 
Cheers,
Jeff

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re[2]: e1000 speed/duplex error
  2006-08-01 11:20 ` Jeff Kirsher
@ 2006-08-01 12:03   ` a1
  2006-08-01 12:21     ` Andy Gospodarek
                       ` (2 more replies)
       [not found]   ` <793732866.20060801153230@mail.ru>
  1 sibling, 3 replies; 16+ messages in thread
From: a1 @ 2006-08-01 12:03 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: netdev

He, Jeff.

Thank for quick reply.

JK> On 8/1/06, a1 <a1k@mail.ru> wrote:
>> I'm trying to set my nic to force 100Mb/FD, but I'm constantly getting 100/HD on
>> other side of the link.
>>
>> The command is:
>> ethtool -s eth0 speed 100 duplex full autoneg off
>>
>> e1000 driver version 7.1.9 (latest) downloaded from sourceforge.
>>

JK> What are you linking to? And what is the link partner set to?
I am linking to my 3com gigabit ethernet switch. And it shows
100Mbit/halfduplex.

JK> If one link partner is set to auto-negotiate, and the other partner
JK> forced, it is common to see this issue no matter what the two link
JK> partners are.
I thought the common behavior is that if one side force any particular
parameter, other side should "sense" that and go to that mode too.

In current case there is misunderstanding - one side (linux box)
reports 100/FD and other (switch) reports 100/HD.

Maybe I don't understand something...

>> Are there any problems?

JK> Not that I am aware of.


-- 
Best regards,
 a1                          mailto:a1k@mail.ru


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re[4]: e1000 speed/duplex error
       [not found]     ` <9929d2390608010445w4fd81b64g310ae90a423e1a7d@mail.gmail.com>
@ 2006-08-01 12:20       ` a1
  2006-08-01 12:34         ` Jeff Kirsher
  0 siblings, 1 reply; 16+ messages in thread
From: a1 @ 2006-08-01 12:20 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: netdev

Hi, Jeff.


JK> OPTION 2: Turn auto-negotiate on the e1000 card and tell it to only
JK> advertise 100 Full Duplex.  This will allow negotiation between the
JK> two lnk partners and the e1000 will advertise that it is only able to
JK> do 100 Full duplex.

Is there any way i could do this with ethtool? It only allows force
spd/dplx , but not set it for advertising...

If i do as follows other side reports 1000/FD:

ethtool -s eth0 speed 100 duplex full autoneg on

-- 
Best Regards,
 a1                          mailto:a1k@mail.ru


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: e1000 speed/duplex error
  2006-08-01 12:03   ` Re[2]: " a1
@ 2006-08-01 12:21     ` Andy Gospodarek
  2006-08-01 12:22     ` Re[2]: " Jamal Hadi Salim
  2006-08-01 17:03     ` Rick Jones
  2 siblings, 0 replies; 16+ messages in thread
From: Andy Gospodarek @ 2006-08-01 12:21 UTC (permalink / raw)
  To: a1; +Cc: Jeff Kirsher, netdev

On Tue, Aug 01, 2006 at 04:03:28PM +0400, a1 wrote:
> He, Jeff.
> 
> Thank for quick reply.
> 
> JK> On 8/1/06, a1 <a1k@mail.ru> wrote:
> >> I'm trying to set my nic to force 100Mb/FD, but I'm constantly getting 100/HD on
> >> other side of the link.
> >>
> >> The command is:
> >> ethtool -s eth0 speed 100 duplex full autoneg off
> >>
> >> e1000 driver version 7.1.9 (latest) downloaded from sourceforge.
> >>
> 
> JK> What are you linking to? And what is the link partner set to?
> I am linking to my 3com gigabit ethernet switch. And it shows
> 100Mbit/halfduplex.
> 
> JK> If one link partner is set to auto-negotiate, and the other partner
> JK> forced, it is common to see this issue no matter what the two link
> JK> partners are.
> I thought the common behavior is that if one side force any particular
> parameter, other side should "sense" that and go to that mode too.
> 
> In current case there is misunderstanding - one side (linux box)
> reports 100/FD and other (switch) reports 100/HD.
> 
> Maybe I don't understand something...
> 

Jeff it correct, but the behavior can change depending on the switch
hardware.  The results you see are expected since I'm quite sure the
IEEE standard says that a device should default to half-duplex when
auto-negotiation fails (which is why your 3com switch defaults to
half-duplex).

-andy


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Re[2]: e1000 speed/duplex error
  2006-08-01 12:03   ` Re[2]: " a1
  2006-08-01 12:21     ` Andy Gospodarek
@ 2006-08-01 12:22     ` Jamal Hadi Salim
  2006-08-01 17:03     ` Rick Jones
  2 siblings, 0 replies; 16+ messages in thread
From: Jamal Hadi Salim @ 2006-08-01 12:22 UTC (permalink / raw)
  To: a1; +Cc: netdev, Jeff Kirsher

On Tue, 2006-01-08 at 16:03 +0400, a1 wrote:

> I thought the common behavior is that if one side force any particular
> parameter, other side should "sense" that and go to that mode too.
> 

You _cannot_ depend on that behavior at all. IOW, if one side is not
forced the other side's setting is undefined and falls back to whatever
that side defines as "default"

> In current case there is misunderstanding - one side (linux box)
> reports 100/FD and other (switch) reports 100/HD.
> 
> Maybe I don't understand something...

You must force both sides for predictable behavior. I would say that
doing HD as default is more common. So Linux may need to change just
that one bit.

cheers,
jamal



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Re[4]: e1000 speed/duplex error
  2006-08-01 12:20       ` Re[4]: " a1
@ 2006-08-01 12:34         ` Jeff Kirsher
  2006-08-01 14:35           ` Auke Kok
  0 siblings, 1 reply; 16+ messages in thread
From: Jeff Kirsher @ 2006-08-01 12:34 UTC (permalink / raw)
  To: a1; +Cc: netdev

On 8/1/06, a1 <a1k@mail.ru> wrote:
> Hi, Jeff.
>
>
> JK> OPTION 2: Turn auto-negotiate on the e1000 card and tell it to only
> JK> advertise 100 Full Duplex.  This will allow negotiation between the
> JK> two lnk partners and the e1000 will advertise that it is only able to
> JK> do 100 Full duplex.
>
> Is there any way i could do this with ethtool? It only allows force
> spd/dplx , but not set it for advertising...

Not currently.  That would be a nice feature though... :)

>
> If i do as follows other side reports 1000/FD:
>
> ethtool -s eth0 speed 100 duplex full autoneg on
>

Which is what I would expect.  I have to step away for a bit, but if
no one responds with how to load the driver with auto-negotiate
advertising only 100 Full Duplex, I will do so when I return.

-- 
Cheers,
Jeff

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: e1000 speed/duplex error
  2006-08-01 12:34         ` Jeff Kirsher
@ 2006-08-01 14:35           ` Auke Kok
  2006-08-01 17:15             ` Jeff Kirsher
  2006-08-02  7:34             ` a1
  0 siblings, 2 replies; 16+ messages in thread
From: Auke Kok @ 2006-08-01 14:35 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: a1, netdev

Jeff Kirsher wrote:
> On 8/1/06, a1 <a1k@mail.ru> wrote:
>> Hi, Jeff.
>>
>>
>> JK> OPTION 2: Turn auto-negotiate on the e1000 card and tell it to only
>> JK> advertise 100 Full Duplex.  This will allow negotiation between the
>> JK> two lnk partners and the e1000 will advertise that it is only able to
>> JK> do 100 Full duplex.
>>
>> Is there any way i could do this with ethtool? It only allows force
>> spd/dplx , but not set it for advertising...
> 
> Not currently.  That would be a nice feature though... :)
> 
>>
>> If i do as follows other side reports 1000/FD:
>>
>> ethtool -s eth0 speed 100 duplex full autoneg on
>>
> 
> Which is what I would expect.  I have to step away for a bit, but if
> no one responds with how to load the driver with auto-negotiate
> advertising only 100 Full Duplex, I will do so when I return.

Here's that part of the driver documentation:

$ modprobe e1000 AutoNeg=0x08
e1000: 0000:00:00.0: e1000_validate_option: AutoNeg advertising 100/FD


  99 /* Auto-negotiation Advertisement Override
100  *
101  * Valid Range: 0x01-0x0F, 0x20-0x2F (copper); 0x20 (fiber)
102  *
103  * The AutoNeg value is a bit mask describing which speed and duplex
104  * combinations should be advertised during auto-negotiation.
105  * The supported speed and duplex modes are listed below
106  *
107  * Bit           7     6     5      4      3     2     1      0
108  * Speed (Mbps)  N/A   N/A   1000   N/A    100   100   10     10
109  * Duplex                    Full          Full  Half  Full   Half
110  *
111  * Default Value: 0x2F (copper); 0x20 (fiber)
112  */

hth,

Auke

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: e1000 speed/duplex error
  2006-08-01 12:03   ` Re[2]: " a1
  2006-08-01 12:21     ` Andy Gospodarek
  2006-08-01 12:22     ` Re[2]: " Jamal Hadi Salim
@ 2006-08-01 17:03     ` Rick Jones
  2 siblings, 0 replies; 16+ messages in thread
From: Rick Jones @ 2006-08-01 17:03 UTC (permalink / raw)
  To: a1; +Cc: Jeff Kirsher, netdev

> I thought the common behavior is that if one side force any particular
> parameter, other side should "sense" that and go to that mode too.

Nope.  That is a common misconception and perhaps the source of many 
duplex mismatch problems today.  Here is some boilerplate I bring-out 
from time to time that may be of help:

$ cat usenet_replies/duplex
How 100Base-T Autoneg is supposed to work:

When both sides of the link are set to autoneg, they will "negotiate"
the duplex setting and select full-duplex if both sides can do
full-duplex.

If one side is hardcoded and not using autoneg, the autoneg process
will "fail" and the side trying to autoneg is required by spec to use
half-duplex mode.

If one side is using half-duplex, and the other is using full-duplex,
sorrow and woe is the usual result.

So, the following table shows what will happen given various settings
on each side:

                  Auto       Half       Full

    Auto        Happiness   Lucky      Sorrow

    Half        Lucky       Happiness  Sorrow

    Full        Sorrow      Sorrow     Happiness

Happiness means that there is a good shot of everything going well.
Lucky means that things will likely go well, but not because you did
anything correctly :) Sorrow means that there _will_ be a duplex
mis-match.

When there is a duplex mismatch, on the side running half-duplex you
will see various errors and probably a number of _LATE_ collisions
("normal" collisions don't count here).  On the side running
full-duplex you will see things like FCS errors.  Note that those
errors are not necessarily conclusive, they are simply indicators.

Further, it is important to keep in mind that a "clean" ping (or the
like - eg "linkloop" or default netperf TCP_RR) test result is
inconclusive here - a duplex mismatch causes lost traffic _only_ when
both sides of the link try to speak at the same time. A typical ping
test, being synchronous, one at a time request/response, never tries
to have both sides talking at the same time.

Finally, when/if you migrate to 1000Base-T, everything has to be set
to auto-neg anyway.

rick jones

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: e1000 speed/duplex error
  2006-08-01 14:35           ` Auke Kok
@ 2006-08-01 17:15             ` Jeff Kirsher
  2006-08-02  7:34             ` a1
  1 sibling, 0 replies; 16+ messages in thread
From: Jeff Kirsher @ 2006-08-01 17:15 UTC (permalink / raw)
  To: Auke Kok; +Cc: a1, netdev

On 8/1/06, Auke Kok <auke-jan.h.kok@intel.com> wrote:
> Jeff Kirsher wrote:
> > On 8/1/06, a1 <a1k@mail.ru> wrote:
> >> Hi, Jeff.
> >>
> >>
> >> JK> OPTION 2: Turn auto-negotiate on the e1000 card and tell it to only
> >> JK> advertise 100 Full Duplex.  This will allow negotiation between the
> >> JK> two lnk partners and the e1000 will advertise that it is only able to
> >> JK> do 100 Full duplex.
> >>
> >> Is there any way i could do this with ethtool? It only allows force
> >> spd/dplx , but not set it for advertising...
> >
> > Not currently.  That would be a nice feature though... :)
> >
> >>
> >> If i do as follows other side reports 1000/FD:
> >>
> >> ethtool -s eth0 speed 100 duplex full autoneg on
> >>
> >
> > Which is what I would expect.  I have to step away for a bit, but if
> > no one responds with how to load the driver with auto-negotiate
> > advertising only 100 Full Duplex, I will do so when I return.
>
> Here's that part of the driver documentation:
>
> $ modprobe e1000 AutoNeg=0x08
> e1000: 0000:00:00.0: e1000_validate_option: AutoNeg advertising 100/FD
>
>
>   99 /* Auto-negotiation Advertisement Override
> 100  *
> 101  * Valid Range: 0x01-0x0F, 0x20-0x2F (copper); 0x20 (fiber)
> 102  *
> 103  * The AutoNeg value is a bit mask describing which speed and duplex
> 104  * combinations should be advertised during auto-negotiation.
> 105  * The supported speed and duplex modes are listed below
> 106  *
> 107  * Bit           7     6     5      4      3     2     1      0
> 108  * Speed (Mbps)  N/A   N/A   1000   N/A    100   100   10     10
> 109  * Duplex                    Full          Full  Half  Full   Half
> 110  *
> 111  * Default Value: 0x2F (copper); 0x20 (fiber)
> 112  */
>
> hth,
>
> Auke
>
Thanks Auke.  I got tied up longer than expected.

-- 
Cheers,
Jeff

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: e1000 speed/duplex error
  2006-08-01 14:35           ` Auke Kok
  2006-08-01 17:15             ` Jeff Kirsher
@ 2006-08-02  7:34             ` a1
  2006-08-02  7:43               ` Jeff Kirsher
  2006-08-02 16:19               ` Auke Kok
  1 sibling, 2 replies; 16+ messages in thread
From: a1 @ 2006-08-02  7:34 UTC (permalink / raw)
  To: Auke Kok; +Cc: netdev

Hi, Auke.

Auke Kok wrote:
AK> Here's that part of the driver documentation:

AK> $ modprobe e1000 AutoNeg=0x08
AK> e1000: 0000:00:00.0: e1000_validate_option: AutoNeg advertising 100/FD


AK>   99 /* Auto-negotiation Advertisement Override
AK> 100  *
AK> 101  * Valid Range: 0x01-0x0F, 0x20-0x2F (copper); 0x20 (fiber)
AK> 102  *
AK> 103  * The AutoNeg value is a bit mask describing which speed and duplex
AK> 104  * combinations should be advertised during auto-negotiation.
AK> 105  * The supported speed and duplex modes are listed below
AK> 106  *
AK> 107  * Bit           7     6     5      4      3     2     1      0
AK> 108  * Speed (Mbps)  N/A   N/A   1000   N/A    100   100   10     10
AK> 109  * Duplex                    Full          Full  Half  Full   Half
AK> 110  *
AK> 111  * Default Value: 0x2F (copper); 0x20 (fiber)
AK> 112  */

This is not what I'm thinking of. Say, for example, I have a bunch of
e1000 adapters in my box and want to dynamically change one's spd/dplx.
For that works in the way you described I need to stop all of them and
load with autoneg parameter (can I pass this parameter only to single
card?) and loose all connection I had on other adapters.
It would be better to handle it in ethtool way, since I discovered
it's a common behavior.
Thanks.


AK> hth,

AK> Auke


-- 
Best Regards,
 Alexandr Kotov                       mailto:a1k@mail.ru


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: e1000 speed/duplex error
  2006-08-02  7:34             ` a1
@ 2006-08-02  7:43               ` Jeff Kirsher
  2006-08-02  8:39                 ` a1
  2006-08-02 16:19               ` Auke Kok
  1 sibling, 1 reply; 16+ messages in thread
From: Jeff Kirsher @ 2006-08-02  7:43 UTC (permalink / raw)
  To: a1; +Cc: Auke Kok, netdev

On 8/2/06, a1 <a1k@mail.ru> wrote:
> Hi, Auke.
>
> Auke Kok wrote:
> AK> Here's that part of the driver documentation:
>
> AK> $ modprobe e1000 AutoNeg=0x08
> AK> e1000: 0000:00:00.0: e1000_validate_option: AutoNeg advertising 100/FD
>
>
> AK>   99 /* Auto-negotiation Advertisement Override
> AK> 100  *
> AK> 101  * Valid Range: 0x01-0x0F, 0x20-0x2F (copper); 0x20 (fiber)
> AK> 102  *
> AK> 103  * The AutoNeg value is a bit mask describing which speed and duplex
> AK> 104  * combinations should be advertised during auto-negotiation.
> AK> 105  * The supported speed and duplex modes are listed below
> AK> 106  *
> AK> 107  * Bit           7     6     5      4      3     2     1      0
> AK> 108  * Speed (Mbps)  N/A   N/A   1000   N/A    100   100   10     10
> AK> 109  * Duplex                    Full          Full  Half  Full   Half
> AK> 110  *
> AK> 111  * Default Value: 0x2F (copper); 0x20 (fiber)
> AK> 112  */
>
> This is not what I'm thinking of. Say, for example, I have a bunch of
> e1000 adapters in my box and want to dynamically change one's spd/dplx.
> For that works in the way you described I need to stop all of them and
> load with autoneg parameter (can I pass this parameter only to single
> card?) and loose all connection I had on other adapters.
> It would be better to handle it in ethtool way, since I discovered
> it's a common behavior.
> Thanks.
>
>
> AK> hth,
>
> AK> Auke
>
>
> --
> Best Regards,
>  Alexandr Kotov                       mailto:a1k@mail.ru
>
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

I agree.  Although ethtool does not have that functionality as of yet.
 Feel free to provide a patch to the ethtool maintainer (Jeff Garzik)
if you would like.  I will put it on my plate of things to do, but I
will admit that it is near the bottom of the list of items to get done
for me.  Feel free to ping me once in awhile to remind me.

-- 
Cheers,
Jeff

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: e1000 speed/duplex error
  2006-08-02  7:43               ` Jeff Kirsher
@ 2006-08-02  8:39                 ` a1
  2006-08-02 15:02                   ` Auke Kok
  0 siblings, 1 reply; 16+ messages in thread
From: a1 @ 2006-08-02  8:39 UTC (permalink / raw)
  To: Jeff Kirsher, Auke Kok; +Cc: netdev

Hi, Jeff.

JK> On 8/2/06, a1 <a1k@mail.ru> wrote:
>> Hi, Auke.
>>
>> Auke Kok wrote:
>> AK> Here's that part of the driver documentation:
>>
>> AK> $ modprobe e1000 AutoNeg=0x08
>> AK> e1000: 0000:00:00.0: e1000_validate_option: AutoNeg advertising 100/FD
>>
>>
>> AK>   99 /* Auto-negotiation Advertisement Override
>> AK> 100  *
>> AK> 101  * Valid Range: 0x01-0x0F, 0x20-0x2F (copper); 0x20 (fiber)
>> AK> 102  *
>> AK> 103  * The AutoNeg value is a bit mask describing which speed and duplex
>> AK> 104  * combinations should be advertised during auto-negotiation.
>> AK> 105  * The supported speed and duplex modes are listed below
>> AK> 106  *
>> AK> 107  * Bit           7     6     5      4      3     2     1      0
>> AK> 108  * Speed (Mbps)  N/A   N/A   1000   N/A    100   100   10     10
>> AK> 109  * Duplex                    Full          Full  Half  Full   Half
>> AK> 110  *
>> AK> 111  * Default Value: 0x2F (copper); 0x20 (fiber)
>> AK> 112  */
>>
>> This is not what I'm thinking of. Say, for example, I have a bunch of
>> e1000 adapters in my box and want to dynamically change one's spd/dplx.
>> For that works in the way you described I need to stop all of them and
>> load with autoneg parameter (can I pass this parameter only to single
>> card?) and loose all connection I had on other adapters.
>> It would be better to handle it in ethtool way, since I discovered
>> it's a common behavior.
>> Thanks.
>>
>>
>> AK> hth,
>>
>> AK> Auke
>>
>>
>> --
>> Best Regards,
>>  Alexandr Kotov                       mailto:a1k@mail.ru
>>
>> -
>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>

JK> I agree.  Although ethtool does not have that functionality as of yet.
JK>  Feel free to provide a patch to the ethtool maintainer (Jeff Garzik)
JK> if you would like.  I will put it on my plate of things to do, but I
JK> will admit that it is near the bottom of the list of items to get done
JK> for me.  Feel free to ping me once in awhile to remind me.

Ethtool already have support for that, but e1000 driver doesn't treat
all values passed from ethtool correctly.

For example, if I run ethtool with the following parameters:
ethtool -s eth0 speed 100 duplex full autoneg on

parameters filled by ethtool looks like:

ecmd->autoneg = AUTONEG_ENABLE;
ecmd->advertising = ADVERTISED_100baseT_Full;

but then they passed to the driver, driver fills the structure passed
to the hw layer with all possible advertise values.

static int
e1000_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
{
        struct e1000_adapter *adapter = netdev_priv(netdev);
        struct e1000_hw *hw = &adapter->hw;

        /* When SoL/IDER sessions are active, autoneg/speed/duplex
         * cannot be changed */
        if (e1000_check_phy_reset_block(hw)) {
                DPRINTK(DRV, ERR, "Cannot change link characteristics "
                        "when SoL/IDER is active.\n");
                return -EINVAL;
        }

        if (ecmd->autoneg == AUTONEG_ENABLE) {
                hw->autoneg = 1;
                if (hw->media_type == e1000_media_type_fiber)
                        hw->autoneg_advertised = ADVERTISED_1000baseT_Full |
                                     ADVERTISED_FIBRE |
                                     ADVERTISED_Autoneg;
                else
--->                    hw->autoneg_advertised = ADVERTISED_10baseT_Half |
                                                  ADVERTISED_10baseT_Full |
                                                  ADVERTISED_100baseT_Half |
                                                  ADVERTISED_100baseT_Full |
                                                  ADVERTISED_1000baseT_Full|
                                                  ADVERTISED_Autoneg |
                                                  ADVERTISED_TP;
                ecmd->advertising = hw->autoneg_advertised;
        } else
                if (e1000_set_spd_dplx(adapter, ecmd->speed + ecmd->duplex))
                        return -EINVAL;

        /* reset the link */

        if (netif_running(adapter->netdev))
                e1000_reinit_locked(adapter);
        else
                e1000_reset(adapter);

        return 0;
}

If you change it that way everything works like I thought

--- e1000_ethtool.c.orig        Mon Jun 26 14:13:26 2006
+++ e1000_ethtool.c     Wed Aug 02 12:35:36 2006
@@ -225,13 +225,7 @@
                                     ADVERTISED_FIBRE |
                                     ADVERTISED_Autoneg;
                else
-                       hw->autoneg_advertised = ADVERTISED_10baseT_Half |
-                                                 ADVERTISED_10baseT_Full |
-                                                 ADVERTISED_100baseT_Half |
-                                                 ADVERTISED_100baseT_Full |
-                                                 ADVERTISED_1000baseT_Full|
-                                                 ADVERTISED_Autoneg |
-                                                 ADVERTISED_TP;
+                       hw->autoneg_advertised = ecmd->advertising;
                ecmd->advertising = hw->autoneg_advertised;
        } else
                if (e1000_set_spd_dplx(adapter, ecmd->speed + ecmd->duplex))


-- 
Best regards,
 Alexandr Kotov                          mailto:a1k@mail.ru


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: e1000 speed/duplex error
  2006-08-02  8:39                 ` a1
@ 2006-08-02 15:02                   ` Auke Kok
  2006-08-03  7:51                     ` a1
  0 siblings, 1 reply; 16+ messages in thread
From: Auke Kok @ 2006-08-02 15:02 UTC (permalink / raw)
  To: a1; +Cc: Jeff Kirsher, Auke Kok, netdev

a1 wrote:
> JK> I agree.  Although ethtool does not have that functionality as of yet.
> JK>  Feel free to provide a patch to the ethtool maintainer (Jeff Garzik)
> JK> if you would like.  I will put it on my plate of things to do, but I
> JK> will admit that it is near the bottom of the list of items to get done
> JK> for me.  Feel free to ping me once in awhile to remind me.
> 
> Ethtool already have support for that, but e1000 driver doesn't treat
> all values passed from ethtool correctly.
> 
> For example, if I run ethtool with the following parameters:
> ethtool -s eth0 speed 100 duplex full autoneg on
> 
> parameters filled by ethtool looks like:
> 
> ecmd->autoneg = AUTONEG_ENABLE;
> ecmd->advertising = ADVERTISED_100baseT_Full;
> 
> but then they passed to the driver, driver fills the structure passed
> to the hw layer with all possible advertise values.

>         if (ecmd->autoneg == AUTONEG_ENABLE) {
>                 hw->autoneg = 1;
>                 if (hw->media_type == e1000_media_type_fiber)
>                         hw->autoneg_advertised = ADVERTISED_1000baseT_Full |
>                                      ADVERTISED_FIBRE |
>                                      ADVERTISED_Autoneg;
>                 else
> --->                    hw->autoneg_advertised = ADVERTISED_10baseT_Half |
>                                                   ADVERTISED_10baseT_Full |
>                                                   ADVERTISED_100baseT_Half |
>                                                   ADVERTISED_100baseT_Full |
>                                                   ADVERTISED_1000baseT_Full|
>                                                   ADVERTISED_Autoneg |
>                                                   ADVERTISED_TP;
>                 ecmd->advertising = hw->autoneg_advertised;
>         } else

> If you change it that way everything works like I thought
> 
> --- e1000_ethtool.c.orig        Mon Jun 26 14:13:26 2006
> +++ e1000_ethtool.c     Wed Aug 02 12:35:36 2006
> @@ -225,13 +225,7 @@
>                                      ADVERTISED_FIBRE |
>                                      ADVERTISED_Autoneg;
>                 else
> -                       hw->autoneg_advertised = ADVERTISED_10baseT_Half |
> -                                                 ADVERTISED_10baseT_Full |
> -                                                 ADVERTISED_100baseT_Half |
> -                                                 ADVERTISED_100baseT_Full |
> -                                                 ADVERTISED_1000baseT_Full|
> -                                                 ADVERTISED_Autoneg |
> -                                                 ADVERTISED_TP;
> +                       hw->autoneg_advertised = ecmd->advertising;

Don't you mean this? :

+                       hw->autoneg_advertised = ecmd->advertising |
+                                                ADVERTISED_Autoneg |
+                                                ADVERTISED_TP;

and we'd also have to do this for fibre...

 >
>                 ecmd->advertising = hw->autoneg_advertised;
>         } else
>                 if (e1000_set_spd_dplx(adapter, ecmd->speed + ecmd->duplex))


but that's not really what you want: the way ethtool works currently only 
allows you to pass *one* speed/duplex tuple and autonegotiate with that, or 
all (by omitting any speed/duplex tuple).

ethtool needs some code that allows you to specify "autonegotiate 10_half or 
100_full or 1000_full" (3 tuples, but not implying 100_half or 10_full). This 
is something mii-tool was able to do but this functionality never made it into 
ethtool AFAIK :)

This is the most useful case for everyone, you can omit advertising gig link 
if you only have 100mbit switches and speed up link times that way etc.

Auke

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: e1000 speed/duplex error
  2006-08-02  7:34             ` a1
  2006-08-02  7:43               ` Jeff Kirsher
@ 2006-08-02 16:19               ` Auke Kok
  1 sibling, 0 replies; 16+ messages in thread
From: Auke Kok @ 2006-08-02 16:19 UTC (permalink / raw)
  To: a1; +Cc: netdev

a1 wrote:
> Hi, Auke.
> 
> Auke Kok wrote:
> AK> Here's that part of the driver documentation:
> 
> AK> $ modprobe e1000 AutoNeg=0x08
> AK> e1000: 0000:00:00.0: e1000_validate_option: AutoNeg advertising 100/FD
> 
> 
> AK>   99 /* Auto-negotiation Advertisement Override
> AK> 100  *
> AK> 101  * Valid Range: 0x01-0x0F, 0x20-0x2F (copper); 0x20 (fiber)
> AK> 102  *
> AK> 103  * The AutoNeg value is a bit mask describing which speed and duplex
> AK> 104  * combinations should be advertised during auto-negotiation.
> AK> 105  * The supported speed and duplex modes are listed below
> AK> 106  *
> AK> 107  * Bit           7     6     5      4      3     2     1      0
> AK> 108  * Speed (Mbps)  N/A   N/A   1000   N/A    100   100   10     10
> AK> 109  * Duplex                    Full          Full  Half  Full   Half
> AK> 110  *
> AK> 111  * Default Value: 0x2F (copper); 0x20 (fiber)
> AK> 112  */
> 
> This is not what I'm thinking of. Say, for example, I have a bunch of
> e1000 adapters in my box and want to dynamically change one's spd/dplx.
> For that works in the way you described I need to stop all of them and
> load with autoneg parameter (can I pass this parameter only to single
> card?) and loose all connection I had on other adapters.

you can pass these parameters per card as such:

$ modprobe e1000 AutoNeg=0x2f,0x28,0x2f,0x2f

this way card #2 will see the non-default value, the other 3 will run with the 
default value (0x2f).

Auke

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: e1000 speed/duplex error
  2006-08-02 15:02                   ` Auke Kok
@ 2006-08-03  7:51                     ` a1
  0 siblings, 0 replies; 16+ messages in thread
From: a1 @ 2006-08-03  7:51 UTC (permalink / raw)
  To: Auke Kok; +Cc: netdev

Hi, Auke.

Auke Kok wrote:
AK> Don't you mean this? :

AK> +                       hw->autoneg_advertised = ecmd->advertising |
AK> +                                                ADVERTISED_Autoneg |
AK> +                                                ADVERTISED_TP;

AK> and we'd also have to do this for fibre...
Yep. I've noticed that but I already sent message...

 >>
>>                 ecmd->advertising = hw->autoneg_advertised;
>>         } else
>>                 if (e1000_set_spd_dplx(adapter, ecmd->speed + ecmd->duplex))


AK> but that's not really what you want: the way ethtool works currently only
AK> allows you to pass *one* speed/duplex tuple and autonegotiate with that, or
AK> all (by omitting any speed/duplex tuple).

AK> ethtool needs some code that allows you to specify "autonegotiate 10_half or
AK> 100_full or 1000_full" (3 tuples, but not implying 100_half or 10_full). This
AK> is something mii-tool was able to do but this functionality never made it into
AK> ethtool AFAIK :)

AK> This is the most useful case for everyone, you can omit advertising gig link
AK> if you only have 100mbit switches and speed up link times that way etc.

I'm sure of that, but today before actual ethtool patch released will
this changes be included in the driver sources? In that case IMO no other
changes need to be done to support what you've been writing of...

AK> Auke



-- 
Best regards,
Alexandr Kotov                          mailto:a1k@mail.ru


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2006-08-03  7:50 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-01 10:18 e1000 speed/duplex error a1
2006-08-01 11:20 ` Jeff Kirsher
2006-08-01 12:03   ` Re[2]: " a1
2006-08-01 12:21     ` Andy Gospodarek
2006-08-01 12:22     ` Re[2]: " Jamal Hadi Salim
2006-08-01 17:03     ` Rick Jones
     [not found]   ` <793732866.20060801153230@mail.ru>
     [not found]     ` <9929d2390608010445w4fd81b64g310ae90a423e1a7d@mail.gmail.com>
2006-08-01 12:20       ` Re[4]: " a1
2006-08-01 12:34         ` Jeff Kirsher
2006-08-01 14:35           ` Auke Kok
2006-08-01 17:15             ` Jeff Kirsher
2006-08-02  7:34             ` a1
2006-08-02  7:43               ` Jeff Kirsher
2006-08-02  8:39                 ` a1
2006-08-02 15:02                   ` Auke Kok
2006-08-03  7:51                     ` a1
2006-08-02 16:19               ` Auke Kok

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).