virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vdpa/vp_vdpa: implement kick_vq_with_data callback
@ 2024-12-02  3:36 Yuxue Liu yuxue.liu@jaguarmicro.com
  2024-12-02  4:21 ` Jason Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Yuxue Liu yuxue.liu@jaguarmicro.com @ 2024-12-02  3:36 UTC (permalink / raw)
  To: jasowang, mst
  Cc: xuanzhuo, virtualization, linux-kernel, yuxue.liu, angus.chen

From: Yuxue Liu <yuxue.liu@jaguarmicro.com>

Implement the kick_vq_with_data vDPA callback.
On kick, we pass the next available data to the hardware by writing it in
the kick offset.

Signed-off-by: Yuxue Liu <yuxue.liu@jaguarmicro.com>
---
 drivers/vdpa/virtio_pci/vp_vdpa.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/vdpa/virtio_pci/vp_vdpa.c b/drivers/vdpa/virtio_pci/vp_vdpa.c
index 16380764275e..a9034c59b020 100644
--- a/drivers/vdpa/virtio_pci/vp_vdpa.c
+++ b/drivers/vdpa/virtio_pci/vp_vdpa.c
@@ -367,6 +367,14 @@ static void vp_vdpa_kick_vq(struct vdpa_device *vdpa, u16 qid)
 	vp_iowrite16(qid, vp_vdpa->vring[qid].notify);
 }
 
+static void vp_vdpa_kick_vq_with_data(struct vdpa_device *vdpa_dev, u32 data)
+{
+	struct vp_vdpa *vp_vdpa = vdpa_to_vp(vdpa);
+	u16 qid = data & 0xFFFF;
+
+	vp_iowrite32(data, vp_vdpa->vring[qid].notify);
+}
+
 static u32 vp_vdpa_get_generation(struct vdpa_device *vdpa)
 {
 	struct virtio_pci_modern_device *mdev = vdpa_to_mdev(vdpa);
@@ -472,6 +480,7 @@ static const struct vdpa_config_ops vp_vdpa_ops = {
 	.get_vq_size	= vp_vdpa_get_vq_size,
 	.set_vq_address	= vp_vdpa_set_vq_address,
 	.kick_vq	= vp_vdpa_kick_vq,
+	.kick_vq_with_data      = vp_vdpa_kick_vq_with_data,
 	.get_generation	= vp_vdpa_get_generation,
 	.get_device_id	= vp_vdpa_get_device_id,
 	.get_vendor_id	= vp_vdpa_get_vendor_id,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] vdpa/vp_vdpa: implement kick_vq_with_data callback
  2024-12-02  3:36 [PATCH] vdpa/vp_vdpa: implement kick_vq_with_data callback Yuxue Liu yuxue.liu@jaguarmicro.com
@ 2024-12-02  4:21 ` Jason Wang
  2024-12-03  2:37   ` [PATCH v2] " Yuxue Liu yuxue.liu@jaguarmicro.com
  2024-12-02 12:20 ` [PATCH] " kernel test robot
  2024-12-02 12:41 ` kernel test robot
  2 siblings, 1 reply; 7+ messages in thread
From: Jason Wang @ 2024-12-02  4:21 UTC (permalink / raw)
  To: Yuxue Liu yuxue.liu@jaguarmicro.com
  Cc: mst, xuanzhuo, virtualization, linux-kernel, angus.chen

On Mon, Dec 2, 2024 at 11:36 AM Yuxue Liu yuxue.liu@jaguarmicro.com
<yuxue.liu@jaguarmicro.com> wrote:
>
> From: Yuxue Liu <yuxue.liu@jaguarmicro.com>
>
> Implement the kick_vq_with_data vDPA callback.
> On kick, we pass the next available data to the hardware by writing it in
> the kick offset.
>
> Signed-off-by: Yuxue Liu <yuxue.liu@jaguarmicro.com>
> ---

Acked-by: Jason Wang <jasowang@redhat.com>

Thanks


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] vdpa/vp_vdpa: implement kick_vq_with_data callback
  2024-12-02  3:36 [PATCH] vdpa/vp_vdpa: implement kick_vq_with_data callback Yuxue Liu yuxue.liu@jaguarmicro.com
  2024-12-02  4:21 ` Jason Wang
@ 2024-12-02 12:20 ` kernel test robot
  2024-12-02 12:41 ` kernel test robot
  2 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2024-12-02 12:20 UTC (permalink / raw)
  To: Yuxue Liu yuxue.liu@jaguarmicro.com, jasowang, mst
  Cc: oe-kbuild-all, xuanzhuo, virtualization, linux-kernel, yuxue.liu,
	angus.chen

Hi Yuxue,

kernel test robot noticed the following build errors:

[auto build test ERROR on linus/master]
[also build test ERROR on v6.13-rc1 next-20241128]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Yuxue-Liu-yuxue-liu-jaguarmicro-com/vdpa-vp_vdpa-implement-kick_vq_with_data-callback/20241202-114053
base:   linus/master
patch link:    https://lore.kernel.org/r/20241202033611.1374-1-yuxue.liu%40jaguarmicro.com
patch subject: [PATCH] vdpa/vp_vdpa: implement kick_vq_with_data callback
config: loongarch-allyesconfig (https://download.01.org/0day-ci/archive/20241202/202412021926.Sg38msHn-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241202/202412021926.Sg38msHn-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412021926.Sg38msHn-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/vdpa/virtio_pci/vp_vdpa.c: In function 'vp_vdpa_kick_vq_with_data':
>> drivers/vdpa/virtio_pci/vp_vdpa.c:372:46: error: 'vdpa' undeclared (first use in this function)
     372 |         struct vp_vdpa *vp_vdpa = vdpa_to_vp(vdpa);
         |                                              ^~~~
   drivers/vdpa/virtio_pci/vp_vdpa.c:372:46: note: each undeclared identifier is reported only once for each function it appears in


vim +/vdpa +372 drivers/vdpa/virtio_pci/vp_vdpa.c

   369	
   370	static void vp_vdpa_kick_vq_with_data(struct vdpa_device *vdpa_dev, u32 data)
   371	{
 > 372		struct vp_vdpa *vp_vdpa = vdpa_to_vp(vdpa);
   373		u16 qid = data & 0xFFFF;
   374	
   375		vp_iowrite32(data, vp_vdpa->vring[qid].notify);
   376	}
   377	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] vdpa/vp_vdpa: implement kick_vq_with_data callback
  2024-12-02  3:36 [PATCH] vdpa/vp_vdpa: implement kick_vq_with_data callback Yuxue Liu yuxue.liu@jaguarmicro.com
  2024-12-02  4:21 ` Jason Wang
  2024-12-02 12:20 ` [PATCH] " kernel test robot
@ 2024-12-02 12:41 ` kernel test robot
  2 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2024-12-02 12:41 UTC (permalink / raw)
  To: Yuxue Liu yuxue.liu@jaguarmicro.com, jasowang, mst
  Cc: llvm, oe-kbuild-all, xuanzhuo, virtualization, linux-kernel,
	yuxue.liu, angus.chen

Hi Yuxue,

kernel test robot noticed the following build errors:

[auto build test ERROR on linus/master]
[also build test ERROR on v6.13-rc1 next-20241128]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Yuxue-Liu-yuxue-liu-jaguarmicro-com/vdpa-vp_vdpa-implement-kick_vq_with_data-callback/20241202-114053
base:   linus/master
patch link:    https://lore.kernel.org/r/20241202033611.1374-1-yuxue.liu%40jaguarmicro.com
patch subject: [PATCH] vdpa/vp_vdpa: implement kick_vq_with_data callback
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20241202/202412022030.EVj2Z5mv-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 592c0fe55f6d9a811028b5f3507be91458ab2713)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241202/202412022030.EVj2Z5mv-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412022030.EVj2Z5mv-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from drivers/vdpa/virtio_pci/vp_vdpa.c:12:
   In file included from include/linux/module.h:19:
   In file included from include/linux/elf.h:6:
   In file included from arch/s390/include/asm/elf.h:181:
   In file included from arch/s390/include/asm/mmu_context.h:11:
   In file included from arch/s390/include/asm/pgalloc.h:18:
   In file included from include/linux/mm.h:2223:
   include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     504 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     505 |                            item];
         |                            ~~~~
   include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     511 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     512 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     518 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     524 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     525 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
>> drivers/vdpa/virtio_pci/vp_vdpa.c:372:39: error: use of undeclared identifier 'vdpa'
     372 |         struct vp_vdpa *vp_vdpa = vdpa_to_vp(vdpa);
         |                                              ^
   4 warnings and 1 error generated.


vim +/vdpa +372 drivers/vdpa/virtio_pci/vp_vdpa.c

   369	
   370	static void vp_vdpa_kick_vq_with_data(struct vdpa_device *vdpa_dev, u32 data)
   371	{
 > 372		struct vp_vdpa *vp_vdpa = vdpa_to_vp(vdpa);
   373		u16 qid = data & 0xFFFF;
   374	
   375		vp_iowrite32(data, vp_vdpa->vring[qid].notify);
   376	}
   377	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2] vdpa/vp_vdpa: implement kick_vq_with_data callback
  2024-12-02  4:21 ` Jason Wang
@ 2024-12-03  2:37   ` Yuxue Liu yuxue.liu@jaguarmicro.com
  2024-12-04  3:09     ` Jason Wang
  2025-01-08 12:02     ` Michael S. Tsirkin
  0 siblings, 2 replies; 7+ messages in thread
From: Yuxue Liu yuxue.liu@jaguarmicro.com @ 2024-12-03  2:37 UTC (permalink / raw)
  To: jasowang, lkp
  Cc: mst, angus.chen, linux-kernel, virtualization, xuanzhuo,
	oe-kbuild-all, llvm, yuxue.liu

From: Yuxue Liu <yuxue.liu@jaguarmicro.com>

Implement the kick_vq_with_data vDPA callback.
On kick, we pass the next available data to the hardware by writing it in
the kick offset.

Signed-off-by: Yuxue Liu <yuxue.liu@jaguarmicro.com>
---
v2: fix build error for kernel test robot

 drivers/vdpa/virtio_pci/vp_vdpa.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/vdpa/virtio_pci/vp_vdpa.c b/drivers/vdpa/virtio_pci/vp_vdpa.c
index 16380764275e..8787407f75b0 100644
--- a/drivers/vdpa/virtio_pci/vp_vdpa.c
+++ b/drivers/vdpa/virtio_pci/vp_vdpa.c
@@ -367,6 +367,14 @@ static void vp_vdpa_kick_vq(struct vdpa_device *vdpa, u16 qid)
 	vp_iowrite16(qid, vp_vdpa->vring[qid].notify);
 }
 
+static void vp_vdpa_kick_vq_with_data(struct vdpa_device *vdpa, u32 data)
+{
+	struct vp_vdpa *vp_vdpa = vdpa_to_vp(vdpa);
+	u16 qid = data & 0xFFFF;
+
+	vp_iowrite32(data, vp_vdpa->vring[qid].notify);
+}
+
 static u32 vp_vdpa_get_generation(struct vdpa_device *vdpa)
 {
 	struct virtio_pci_modern_device *mdev = vdpa_to_mdev(vdpa);
@@ -472,6 +480,7 @@ static const struct vdpa_config_ops vp_vdpa_ops = {
 	.get_vq_size	= vp_vdpa_get_vq_size,
 	.set_vq_address	= vp_vdpa_set_vq_address,
 	.kick_vq	= vp_vdpa_kick_vq,
+	.kick_vq_with_data      = vp_vdpa_kick_vq_with_data,
 	.get_generation	= vp_vdpa_get_generation,
 	.get_device_id	= vp_vdpa_get_device_id,
 	.get_vendor_id	= vp_vdpa_get_vendor_id,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] vdpa/vp_vdpa: implement kick_vq_with_data callback
  2024-12-03  2:37   ` [PATCH v2] " Yuxue Liu yuxue.liu@jaguarmicro.com
@ 2024-12-04  3:09     ` Jason Wang
  2025-01-08 12:02     ` Michael S. Tsirkin
  1 sibling, 0 replies; 7+ messages in thread
From: Jason Wang @ 2024-12-04  3:09 UTC (permalink / raw)
  To: Yuxue Liu yuxue.liu@jaguarmicro.com
  Cc: lkp, mst, angus.chen, linux-kernel, virtualization, xuanzhuo,
	oe-kbuild-all, llvm

On Tue, Dec 3, 2024 at 10:37 AM Yuxue Liu yuxue.liu@jaguarmicro.com
<yuxue.liu@jaguarmicro.com> wrote:
>
> From: Yuxue Liu <yuxue.liu@jaguarmicro.com>
>
> Implement the kick_vq_with_data vDPA callback.
> On kick, we pass the next available data to the hardware by writing it in
> the kick offset.
>
> Signed-off-by: Yuxue Liu <yuxue.liu@jaguarmicro.com>
> ---
> v2: fix build error for kernel test robot
>

Acked-by: Jason Wang <jasowang@redhat.com>

Thanks


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] vdpa/vp_vdpa: implement kick_vq_with_data callback
  2024-12-03  2:37   ` [PATCH v2] " Yuxue Liu yuxue.liu@jaguarmicro.com
  2024-12-04  3:09     ` Jason Wang
@ 2025-01-08 12:02     ` Michael S. Tsirkin
  1 sibling, 0 replies; 7+ messages in thread
From: Michael S. Tsirkin @ 2025-01-08 12:02 UTC (permalink / raw)
  To: Yuxue Liu yuxue.liu@jaguarmicro.com
  Cc: jasowang, lkp, angus.chen, linux-kernel, virtualization, xuanzhuo,
	oe-kbuild-all, llvm

On Tue, Dec 03, 2024 at 10:37:43AM +0800, Yuxue Liu yuxue.liu@jaguarmicro.com wrote:
> From: Yuxue Liu <yuxue.liu@jaguarmicro.com>
> 
> Implement the kick_vq_with_data vDPA callback.
> On kick, we pass the next available data to the hardware by writing it in
> the kick offset.
> 
> Signed-off-by: Yuxue Liu <yuxue.liu@jaguarmicro.com>

Pls do not send v2 as reply to v1.
I am not sure all tools test the patch if you do.

> ---
> v2: fix build error for kernel test robot
> 
>  drivers/vdpa/virtio_pci/vp_vdpa.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/vdpa/virtio_pci/vp_vdpa.c b/drivers/vdpa/virtio_pci/vp_vdpa.c
> index 16380764275e..8787407f75b0 100644
> --- a/drivers/vdpa/virtio_pci/vp_vdpa.c
> +++ b/drivers/vdpa/virtio_pci/vp_vdpa.c
> @@ -367,6 +367,14 @@ static void vp_vdpa_kick_vq(struct vdpa_device *vdpa, u16 qid)
>  	vp_iowrite16(qid, vp_vdpa->vring[qid].notify);
>  }
>  
> +static void vp_vdpa_kick_vq_with_data(struct vdpa_device *vdpa, u32 data)
> +{
> +	struct vp_vdpa *vp_vdpa = vdpa_to_vp(vdpa);
> +	u16 qid = data & 0xFFFF;
> +
> +	vp_iowrite32(data, vp_vdpa->vring[qid].notify);
> +}
> +
>  static u32 vp_vdpa_get_generation(struct vdpa_device *vdpa)
>  {
>  	struct virtio_pci_modern_device *mdev = vdpa_to_mdev(vdpa);
> @@ -472,6 +480,7 @@ static const struct vdpa_config_ops vp_vdpa_ops = {
>  	.get_vq_size	= vp_vdpa_get_vq_size,
>  	.set_vq_address	= vp_vdpa_set_vq_address,
>  	.kick_vq	= vp_vdpa_kick_vq,
> +	.kick_vq_with_data      = vp_vdpa_kick_vq_with_data,
>  	.get_generation	= vp_vdpa_get_generation,
>  	.get_device_id	= vp_vdpa_get_device_id,
>  	.get_vendor_id	= vp_vdpa_get_vendor_id,
> -- 
> 2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-01-08 12:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-02  3:36 [PATCH] vdpa/vp_vdpa: implement kick_vq_with_data callback Yuxue Liu yuxue.liu@jaguarmicro.com
2024-12-02  4:21 ` Jason Wang
2024-12-03  2:37   ` [PATCH v2] " Yuxue Liu yuxue.liu@jaguarmicro.com
2024-12-04  3:09     ` Jason Wang
2025-01-08 12:02     ` Michael S. Tsirkin
2024-12-02 12:20 ` [PATCH] " kernel test robot
2024-12-02 12:41 ` kernel test robot

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).