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: <01d201db97e9$3d50a0f0$b7f1e2d0$@trustnetic.com>
Date: Tue, 18 Mar 2025 17:36:34 +0800
From: Jiawen Wu <jiawenwu@...stnetic.com>
To: "'Mengyuan Lou'" <mengyuanlou@...-swift.com>,
	<netdev@...r.kernel.org>
Cc: <kuba@...nel.org>,
	<duanqiangwen@...-swift.com>
Subject: RE: [PATCH net-next v8 2/6] net: libwx: Add sriov api for wangxun nics

> +static int __wx_enable_sriov(struct wx *wx, u8 num_vfs)
> +{
> +	int i, ret = 0;
> +	u32 value = 0;
> +
> +	set_bit(WX_FLAG_SRIOV_ENABLED, wx->flags);
> +	wx_err(wx, "SR-IOV enabled with %d VFs\n", num_vfs);
> +
> +	/* Enable VMDq flag so device will be set in VM mode */
> +	set_bit(WX_FLAG_VMDQ_ENABLED, wx->flags);
> +	if (!wx->ring_feature[RING_F_VMDQ].limit)
> +		wx->ring_feature[RING_F_VMDQ].limit = 1;
> +	wx->ring_feature[RING_F_VMDQ].offset = num_vfs;
> +
> +	wx->vfinfo = kcalloc(num_vfs, sizeof(struct vf_data_storage),
> +			     GFP_KERNEL);
> +	if (!wx->vfinfo)
> +		return -ENOMEM;
> +
> +	ret = wx_alloc_vf_macvlans(wx, num_vfs);
> +	if (ret)
> +		return ret;
> +
> +	/* Initialize default switching mode VEB */
> +	wr32m(wx, WX_PSR_CTL, WX_PSR_CTL_SW_EN, WX_PSR_CTL_SW_EN);
> +
> +	for (i = 0; i < num_vfs; i++) {
> +		/* enable spoof checking for all VFs */
> +		wx->vfinfo[i].spoofchk_enabled = true;
> +		wx->vfinfo[i].link_enable = true;
> +		/* untrust all VFs */
> +		wx->vfinfo[i].trusted = false;
> +		/* set the default xcast mode */
> +		wx->vfinfo[i].xcast_mode = WXVF_XCAST_MODE_NONE;
> +	}
> +
> +	if (wx->mac.type == wx_mac_sp) {
> +		if (num_vfs < 32)
> +			value = WX_CFG_PORT_CTL_NUM_VT_32;
> +		else
> +			value = WX_CFG_PORT_CTL_NUM_VT_64;
> +	} else {
> +		value = WX_CFG_PORT_CTL_NUM_VT_8;
> +	}

For the intention of supporting AML devices,

switch (wx->mac.type) {
case wx_mac_sp:
case wx_mac_aml:
	...
case wx_mac_em:
	...
default:
	...
}

> +	wr32m(wx, WX_CFG_PORT_CTL,
> +	      WX_CFG_PORT_CTL_NUM_VT_MASK,
> +	      value);
> +
> +	return ret;
> +}
> +
 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ