Subject: Re: [PATCH 2/2] net: hinic: Add control command support for VF PMD driver in DPDK

From: Cai Huoqing <[email-masked]>
Date: Tue, 1 Nov 2022 09:49:17 +0800

On 31 10月 22 16:52:55, Jakub Kicinski wrote:
> On Sat, 29 Oct 2022 15:53:35 +0800 Cai Huoqing wrote:
> > On 28 10月 22 08:56:51, Jakub Kicinski wrote:
> > > > if the cmd is not added to 'nic_cmd_support_vf',
> > > > the PF will return false, and the error messsage "PF Receive VFx
> > > > unsupported cmd x" in the function 'hinic_mbox_check_cmd_valid',
> > > > then, the configuration will not be set to hardware.  
> > > 
> > > You're describing the behavior before the patch?
> > > 
> > > After the patch the command is ignored silently, like I said, right?
> > > Because there is no handler added to nic_vf_cmd_msg_handler[].
> > > Why is that okay? Or is there handler somewhere else?  
> > 
> > No need to add handlers to nic_vf_cmd_msg_handler[].
> > It will run the path,
> > if (i == ARRAY_SIZE(nic_vf_cmd_msg_handler))
> > 	err = hinic_msg_to_mgmt(&pfhwdev->pf_to_mgmt, HINIC_MOD_L2NIC,
> > 				cmd, buf_in, in_size, buf_out,
> > 				out_size, HINIC_MGMT_MSG_SYNC);
> 
> Meaning it just forwards it to the firmware?
Yes, host driver just forwards it to the firmware.
Actually the firmware works on a coprocessor MGMT_CPU(inside the NIC)
which will recv and deal with these commands.

Thanks,
Cai
> 
> > right? or if not please show the related code.
> 
> I don't know, I don't know this random driver. I'm just asking you
> questions because as the author of the patch _you_ are supposed to know.