lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53741774-bf50-4c17-9ea9-0c101ea21d52@lunn.ch>
Date:   Wed, 29 Mar 2023 17:33:09 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Pavan Kumar Linga <pavan.kumar.linga@...el.com>
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

> +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?

> +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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ