[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <368e6437-958a-2f59-66e7-e0eaf9afc12d@intel.com>
Date: Fri, 31 Mar 2023 03:35:36 +0530
From: "Linga, Pavan Kumar" <pavan.kumar.linga@...el.com>
To: Andrew Lunn <andrew@...n.ch>
CC: <intel-wired-lan@...ts.osuosl.org>, <netdev@...r.kernel.org>,
<shiraz.saleem@...el.com>, <emil.s.tantilov@...el.com>,
<willemb@...gle.com>, <decot@...gle.com>, <joshua.a.hay@...el.com>,
<sridhar.samudrala@...el.com>, Alan Brady <alan.brady@...el.com>,
Alice Michael <alice.michael@...el.com>,
Phani Burra <phani.r.burra@...el.com>
Subject: Re: [Intel-wired-lan] [PATCH net-next 14/15] idpf: add ethtool
callbacks
On 3/29/2023 9:03 PM, Andrew Lunn wrote:
>> +static int idpf_get_link_ksettings(struct net_device *netdev,
>> + struct ethtool_link_ksettings *cmd)
>> +{
>> + struct idpf_vport *vport = idpf_netdev_to_vport(netdev);
>> +
>> + if (!vport)
>> + return -EINVAL;
>> +
>> + ethtool_link_ksettings_zero_link_mode(cmd, supported);
>> + cmd->base.autoneg = AUTONEG_DISABLE;
>> + cmd->base.port = PORT_NONE;
>> + cmd->base.duplex = DUPLEX_FULL;
>> + cmd->base.speed = vport->link_speed_mbps;
>
>
> No supported modes, yet it has a duplex and a link speed?
>
At present, the supported modes info is not provided by the device
control plane but we do get the info on the speed.
>> +static void idpf_recv_event_msg(struct idpf_vport *vport)
>> +{
>> + struct virtchnl2_event *v2e = NULL;
>> + bool link_status;
>> + u32 event;
>> +
>> + v2e = (struct virtchnl2_event *)vport->vc_msg;
>> + event = le32_to_cpu(v2e->event);
>> +
>> + switch (event) {
>> + case VIRTCHNL2_EVENT_LINK_CHANGE:
>> + vport->link_speed_mbps = le32_to_cpu(v2e->link_speed);
>> + link_status = v2e->link_status;
>> +
>> + if (vport->link_up == link_status)
>> + break;
>> +
>> + vport->link_up = link_status;
>> + if (vport->state == __IDPF_VPORT_UP) {
>> + if (vport->link_up) {
>> + netif_carrier_on(vport->netdev);
>> + netif_tx_start_all_queues(vport->netdev);
>> + } else {
>> + netif_tx_stop_all_queues(vport->netdev);
>> + netif_carrier_off(vport->netdev);
>> + }
>> + }
>
> It has a link speed even when the carrier is off? This just makes me
> think the link speed is bogus, and you would be better reporting
> DUPLEX_UNKNOWN, SPEED_UNKNOWN. Or not even implementing ksettings,
> since you don't have anything meaningful to report.
>
> Andrew
You are right. When the carrier is off, the link speed should be set to
unknown. Will fix it.
Thanks,
Pavan
Powered by blists - more mailing lists