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] [day] [month] [year] [list]
Message-ID:
 <PH0PR18MB47344F6BCCD1B629AC012065C7252@PH0PR18MB4734.namprd18.prod.outlook.com>
Date: Sat, 16 Nov 2024 17:21:51 +0000
From: Shinas Rasheed <srasheed@...vell.com>
To: Jakub Kicinski <kuba@...nel.org>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Haseeb Gani
	<hgani@...vell.com>, Sathesh B Edara <sedara@...vell.com>,
        Vimlesh Kumar
	<vimleshk@...vell.com>,
        "thaller@...hat.com" <thaller@...hat.com>,
        "wizhao@...hat.com" <wizhao@...hat.com>,
        "kheib@...hat.com"
	<kheib@...hat.com>,
        "egallen@...hat.com" <egallen@...hat.com>,
        "konguyen@...hat.com" <konguyen@...hat.com>,
        "horms@...nel.org"
	<horms@...nel.org>,
        "einstein.xue@...axg.com" <einstein.xue@...axg.com>,
        Veerasenareddy Burru <vburru@...vell.com>,
        Andrew Lunn
	<andrew+netdev@...n.ch>,
        "David S. Miller" <davem@...emloft.net>,
        Eric
 Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>
Subject: RE: [EXTERNAL] Re: [PATCH net-next v2] octeon_ep: add ndo ops for VFs
 in PF driver

Hi Jakub,

> On Tue, 12 Nov 2024 10:54:31 -0800 Shinas Rasheed wrote:
> > These APIs are needed to support applications that use netlink to get VF
> > information from a PF driver.
> >
> > Signed-off-by: Shinas Rasheed <srasheed@...vell.com>
> 
> > +static int octep_get_vf_config(struct net_device *dev, int vf, struct
> ifla_vf_info *ivi)
> 
> Please don't go over 80 chars for no good reason.
> use checkpatch with --strict --max-line-length=80
> 
ACK

> > +{
> > +	struct octep_device *oct = netdev_priv(dev);
> > +
> > +	ivi->vf = vf;
> > +	ether_addr_copy(ivi->mac, oct->vf_info[vf].mac_addr);
> > +	ivi->vlan = 0;
> > +	ivi->qos = 0;
> 
> no need to clear these fields
> 
ACK

> > +	ivi->spoofchk = 0;
> > +	ivi->linkstate = IFLA_VF_LINK_STATE_ENABLE;
> > +	ivi->trusted = true;
> 
> so you set spoofchk to 0 and trusted to true, indicating no
> enforcement [1]
> 
Will fix this in next patch

> > +	ivi->max_tx_rate = 10000;
> > +	ivi->min_tx_rate = 0;
> 
> Why are you setting max rate to a fixed value?
> 

This is the max tx rate we offer for VFs

> > +
> > +	return 0;
> > +}
> > +
> > +static int octep_set_vf_mac(struct net_device *dev, int vf, u8 *mac)
> > +{
> > +	struct octep_device *oct = netdev_priv(dev);
> > +	int err;
> > +
> > +	if (!is_valid_ether_addr(mac)) {
> > +		dev_err(&oct->pdev->dev, "Invalid  MAC Address %pM\n",
> mac);
> > +		return -EADDRNOTAVAIL;
> > +	}
> > +
> > +	dev_dbg(&oct->pdev->dev, "set vf-%d mac to %pM\n", vf, mac);
> > +	ether_addr_copy(oct->vf_info[vf].mac_addr, mac);
> > +	oct->vf_info[vf].flags |=  OCTEON_PFVF_FLAG_MAC_SET_BY_PF;
> 
> double space
> 

ACK

> > +
> > +	err = octep_ctrl_net_set_mac_addr(oct, vf, mac, true);
> > +	if (err)
> > +		dev_err(&oct->pdev->dev, "Set VF%d MAC address failed via
> host control Mbox\n", vf);
> > +
> > +	return err;
> > +}
> > +
> >  static const struct net_device_ops octep_netdev_ops = {
> >  	.ndo_open                = octep_open,
> >  	.ndo_stop                = octep_stop,
> > @@ -1146,6 +1184,9 @@ static const struct net_device_ops
> octep_netdev_ops = {
> >  	.ndo_set_mac_address     = octep_set_mac,
> >  	.ndo_change_mtu          = octep_change_mtu,
> >  	.ndo_set_features        = octep_set_features,
> > +	/* for VFs */
> 
> what does this comment achieve?
> 

Will remove

> > diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.h
> b/drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.h
> > index 0dc6eead292a..339977c7131a 100644
> > --- a/drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.h
> > +++ b/drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.h
> > @@ -23,6 +23,9 @@ enum octep_pfvf_mbox_version {
> >
> >  #define OCTEP_PFVF_MBOX_VERSION_CURRENT
> 	OCTEP_PFVF_MBOX_VERSION_V2
> >
> > +/* VF flags */
> > +#define OCTEON_PFVF_FLAG_MAC_SET_BY_PF  BIT_ULL(0) /* PF has set VF
> MAC address */
> 
> [2] but the bit definition uses ULL ?
> 

Will fix in next patch

Thanks for the comments

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ