netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Zhu, Lingshan" <lingshan.zhu@intel.com>
To: Jason Wang <jasowang@redhat.com>, mst@redhat.com
Cc: virtualization@lists.linux-foundation.org,
	netdev@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH 3/3] vDPA/ifcvf: set_status() should get a adapter from the mgmt dev
Date: Mon, 5 Jul 2021 17:46:45 +0800	[thread overview]
Message-ID: <15c5660e-3db8-a41e-072a-c8f710d10ab0@intel.com> (raw)
In-Reply-To: <81d8aaed-f2e8-bbf8-a7d5-71e41837d866@redhat.com>



On 7/5/2021 1:09 PM, Jason Wang wrote:
>
> 在 2021/6/30 下午4:21, Zhu Lingshan 写道:
>> ifcvf_vdpa_set_status() should get a adapter from the
>> management device
>>
>> Signed-off-by: Zhu Lingshan <lingshan.zhu@intel.com>
>> ---
>>   drivers/vdpa/ifcvf/ifcvf_main.c | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c 
>> b/drivers/vdpa/ifcvf/ifcvf_main.c
>> index 7c2f64ca2163..28c71eef1d2b 100644
>> --- a/drivers/vdpa/ifcvf/ifcvf_main.c
>> +++ b/drivers/vdpa/ifcvf/ifcvf_main.c
>> @@ -212,13 +212,15 @@ static u8 ifcvf_vdpa_get_status(struct 
>> vdpa_device *vdpa_dev)
>>     static void ifcvf_vdpa_set_status(struct vdpa_device *vdpa_dev, 
>> u8 status)
>>   {
>> +    struct ifcvf_vdpa_mgmt_dev *ifcvf_mgmt_dev;
>>       struct ifcvf_adapter *adapter;
>>       struct ifcvf_hw *vf;
>>       u8 status_old;
>>       int ret;
>>         vf  = vdpa_to_vf(vdpa_dev);
>> -    adapter = dev_get_drvdata(vdpa_dev->dev.parent);
>
>
> If this is a fix for patch 2, you need to squash this into that one.
sure will squash it to patch 2
>
> Any reason that vdpa_to_adapter() can't work?
will use it in V2.
>
> And I see:
>
> +struct ifcvf_vdpa_mgmt_dev {
> +    struct vdpa_mgmt_dev mdev;
> +    struct ifcvf_adapter *adapter;
> +    struct pci_dev *pdev;
> +};
>
> What's the reason for having a adapter pointer here?
because in ifcvf_remove(), we need to get the management device from 
pdev struct, so need to set the management device pointor
to the pdev drvdata, then need this *adapter pointor to address the adapter.

Thanks
>
>
> Thanks
>
>
>> +    ifcvf_mgmt_dev = dev_get_drvdata(vdpa_dev->dev.parent);
>> +    adapter = ifcvf_mgmt_dev->adapter;
>>       status_old = ifcvf_get_status(vf);
>>         if (status_old == status)
>


      reply	other threads:[~2021-07-05  9:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-30  8:21 [PATCH 0/3] vDPA/ifcvf: implement management netlink framework Zhu Lingshan
2021-06-30  8:21 ` [PATCH 1/3] vDPA/ifcvf: introduce get_dev_type() which returns virtio dev id Zhu Lingshan
2021-06-30  8:21 ` [PATCH 2/3] vDPA/ifcvf: implement management netlink framework for ifcvf Zhu Lingshan
2021-06-30 19:04   ` kernel test robot
2021-07-03  9:02     ` Michael S. Tsirkin
2021-07-03  9:04     ` Michael S. Tsirkin
2021-07-05  5:04   ` Jason Wang
2021-07-05  6:34     ` Michael S. Tsirkin
2021-07-05  6:38       ` Zhu, Lingshan
2021-06-30  8:21 ` [PATCH 3/3] vDPA/ifcvf: set_status() should get a adapter from the mgmt dev Zhu Lingshan
2021-07-05  5:09   ` Jason Wang
2021-07-05  9:46     ` Zhu, Lingshan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15c5660e-3db8-a41e-072a-c8f710d10ab0@intel.com \
    --to=lingshan.zhu@intel.com \
    --cc=jasowang@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).