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: 
 <BY3PR18MB473725E6A31B49ABEA184810C6202@BY3PR18MB4737.namprd18.prod.outlook.com>
Date: Thu, 7 Mar 2024 10:54:41 +0000
From: Sunil Kovvuri Goutham <sgoutham@...vell.com>
To: Mengyuan Lou <mengyuanlou@...-swift.com>,
        "netdev@...r.kernel.org"
	<netdev@...r.kernel.org>
CC: "jiawenwu@...stnetic.com" <jiawenwu@...stnetic.com>
Subject: RE: [EXTERNAL] [PATCH net-next 3/5] net: libwx: Add msg task api



> -----Original Message-----
> From: Mengyuan Lou <mengyuanlou@...-swift.com>
> Sent: Thursday, March 7, 2024 3:25 PM
> To: netdev@...r.kernel.org
> Cc: jiawenwu@...stnetic.com; Mengyuan Lou <mengyuanlou@...-
> swift.com>
> Subject: [PATCH net-next 3/5] net: libwx: Add msg task api
> 
> Implement ndo_set_vf_spoofchk and ndo_set_vf_link_state
> interfaces.
> Implement wx_msg_task which is used to process mailbox
> messages sent by vf.
> Reallocate queue and int resources when sriov is enabled.
> 
> Signed-off-by: Mengyuan Lou <mengyuanlou@...-swift.com>
> ---
>  drivers/net/ethernet/wangxun/libwx/wx_hw.c    | 312 +++++-
>  drivers/net/ethernet/wangxun/libwx/wx_hw.h    |   6 +
>  drivers/net/ethernet/wangxun/libwx/wx_lib.c   | 146 ++-
>  drivers/net/ethernet/wangxun/libwx/wx_mbx.h   |  50 +
>  drivers/net/ethernet/wangxun/libwx/wx_sriov.c | 885
> +++++++++++++++++-
>  drivers/net/ethernet/wangxun/libwx/wx_sriov.h |   7 +
>  drivers/net/ethernet/wangxun/libwx/wx_type.h  |  70 +-
>  7 files changed, 1452 insertions(+), 24 deletions(-)
> 
.................
> +static int wx_rcv_msg_from_vf(struct wx *wx, u16 vf)
> +{
> +	u16 mbx_size = WX_VXMAILBOX_SIZE;
> +	u32 msgbuf[WX_VXMAILBOX_SIZE];
> +	int retval;
> +
> +	retval = wx_read_mbx_pf(wx, msgbuf, mbx_size, vf);
> +	if (retval) {
> +		wx_err(wx, "Error receiving message from VF\n");
> +		return retval;
> +	}
> +
> +	/* this is a message we already processed, do nothing */
> +	if (msgbuf[0] & (WX_VT_MSGTYPE_ACK | WX_VT_MSGTYPE_NACK))
> +		return retval;
> +
> +	if (msgbuf[0] == WX_VF_RESET)
> +		return wx_vf_reset_msg(wx, vf);
> +
> +	/* until the vf completes a virtual function reset it should not be
> +	 * allowed to start any configuration.
> +	 */
> +	if (!wx->vfinfo[vf].clear_to_send) {
> +		msgbuf[0] |= WX_VT_MSGTYPE_NACK;
> +		wx_write_mbx_pf(wx, msgbuf, 1, vf);
> +		return retval;
> +	}
> +
> +	switch ((msgbuf[0] & U16_MAX)) {
> +	case WX_VF_SET_MAC_ADDR:
> +		retval = wx_set_vf_mac_addr(wx, msgbuf, vf);
> +		break;
> +	case WX_VF_SET_MULTICAST:
> +		retval = wx_set_vf_multicasts(wx, msgbuf, vf);
> +		break;
> +	case WX_VF_SET_VLAN:
> +		retval = wx_set_vf_vlan_msg(wx, msgbuf, vf);
> +		break;
> +	case WX_VF_SET_LPE:
> +		if (msgbuf[1] > WX_MAX_JUMBO_FRAME_SIZE) {
> +			wx_err(wx, "VF max_frame %d out of range\n",
> msgbuf[1]);
> +			return -EINVAL;
> +		}
> +		retval = wx_set_vf_lpe(wx, msgbuf[1], vf);
> +		break;
> +	case WX_VF_SET_MACVLAN:
> +		retval = wx_set_vf_macvlan_msg(wx, msgbuf, vf);
> +		break;
> +	case WX_VF_API_NEGOTIATE:
> +		retval = wx_negotiate_vf_api(wx, msgbuf, vf);
> +		break;
> +	case WX_VF_GET_QUEUES:
> +		retval = wx_get_vf_queues(wx, msgbuf, vf);
> +		break;
> +	case WX_VF_GET_LINK_STATE:
> +		retval = wx_get_vf_link_state(wx, msgbuf, vf);
> +		break;
> +	case WX_VF_GET_FW_VERSION:
> +		retval = wx_get_fw_version(wx, msgbuf, vf);
> +		break;
> +	case WX_VF_UPDATE_XCAST_MODE:
> +		retval = wx_update_vf_xcast_mode(wx, msgbuf, vf);
> +		break;
> +	case WX_VF_BACKUP:
> +		break;
> +	default:
> +		wx_err(wx, "Unhandled Msg %8.8x\n", msgbuf[0]);
> +		retval = -EBUSY;
> +		break;
> +	}
> +

Seems lot of functionality introduced in a single patch.
IMO it would better to split multicast, vlan etc into separate patches.

Thanks,
Sunil.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ