virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Daniel Jurgens <danielj@nvidia.com>,
	netdev@vger.kernel.org, mst@redhat.com, jasowang@redhat.com,
	alex.williamson@redhat.com, virtualization@lists.linux.dev,
	pabeni@redhat.com
Cc: oe-kbuild-all@lists.linux.dev, parav@nvidia.com,
	shshitrit@nvidia.com, yohadt@nvidia.com,
	Daniel Jurgens <danielj@nvidia.com>
Subject: Re: [PATCH net-next 05/11] virtio_net: Create a FF group for ethtool steering
Date: Fri, 29 Aug 2025 04:52:47 +0800	[thread overview]
Message-ID: <202508290458.9QTyiC0K-lkp@intel.com> (raw)
In-Reply-To: <20250827183852.2471-6-danielj@nvidia.com>

Hi Daniel,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Daniel-Jurgens/virtio-pci-Expose-generic-device-capability-operations/20250828-024128
base:   net-next/main
patch link:    https://lore.kernel.org/r/20250827183852.2471-6-danielj%40nvidia.com
patch subject: [PATCH net-next 05/11] virtio_net: Create a FF group for ethtool steering
config: x86_64-randconfig-121-20250828 (https://download.01.org/0day-ci/archive/20250829/202508290458.9QTyiC0K-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250829/202508290458.9QTyiC0K-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/202508290458.9QTyiC0K-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   drivers/net/virtio_net/virtio_net_ff.c: note: in included file (through include/linux/virtio_admin.h):
   include/uapi/linux/virtio_net_ff.h:45:48: sparse: sparse: array of flexible structures
>> drivers/net/virtio_net/virtio_net_ff.c:99:13: sparse: sparse: restricted __le32 degrades to integer
>> drivers/net/virtio_net/virtio_net_ff.c:99:13: sparse: sparse: cast to restricted __le32
>> drivers/net/virtio_net/virtio_net_ff.c:103:35: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le32 [usertype] groups_limit @@     got int @@
   drivers/net/virtio_net/virtio_net_ff.c:103:35: sparse:     expected restricted __le32 [usertype] groups_limit
   drivers/net/virtio_net/virtio_net_ff.c:103:35: sparse:     got int

vim +99 drivers/net/virtio_net/virtio_net_ff.c

    29	
    30	void virtnet_ff_init(struct virtnet_ff *ff, struct virtio_device *vdev)
    31	{
    32		struct virtio_admin_cmd_query_cap_id_result *cap_id_list __free(kfree) = NULL;
    33		size_t ff_mask_size = sizeof(struct virtio_net_ff_cap_mask_data) +
    34				      sizeof(struct virtio_net_ff_selector) *
    35				      VIRTIO_NET_FF_MASK_TYPE_MAX;
    36		struct virtio_net_resource_obj_ff_group ethtool_group = {};
    37		struct virtio_net_ff_selector *sel;
    38		int err;
    39		int i;
    40	
    41		cap_id_list = kzalloc(sizeof(*cap_id_list), GFP_KERNEL);
    42		if (!cap_id_list)
    43			return;
    44	
    45		err = virtio_device_cap_id_list_query(vdev, cap_id_list);
    46		if (err)
    47			return;
    48	
    49		if (!(VIRTIO_CAP_IN_LIST(cap_id_list,
    50					 VIRTIO_NET_FF_RESOURCE_CAP) &&
    51		      VIRTIO_CAP_IN_LIST(cap_id_list,
    52					 VIRTIO_NET_FF_SELECTOR_CAP) &&
    53		      VIRTIO_CAP_IN_LIST(cap_id_list,
    54					 VIRTIO_NET_FF_ACTION_CAP)))
    55			return;
    56	
    57		ff->ff_caps = kzalloc(sizeof(*ff->ff_caps), GFP_KERNEL);
    58		if (!ff->ff_caps)
    59			return;
    60	
    61		err = virtio_device_cap_get(vdev,
    62					    VIRTIO_NET_FF_RESOURCE_CAP,
    63					    ff->ff_caps,
    64					    sizeof(*ff->ff_caps));
    65	
    66		if (err)
    67			goto err_ff;
    68	
    69		/* VIRTIO_NET_FF_MASK_TYPE start at 1 */
    70		for (i = 1; i <= VIRTIO_NET_FF_MASK_TYPE_MAX; i++)
    71			ff_mask_size += get_mask_size(i);
    72	
    73		ff->ff_mask = kzalloc(ff_mask_size, GFP_KERNEL);
    74		if (!ff->ff_mask)
    75			goto err_ff;
    76	
    77		err = virtio_device_cap_get(vdev,
    78					    VIRTIO_NET_FF_SELECTOR_CAP,
    79					    ff->ff_mask,
    80					    ff_mask_size);
    81	
    82		if (err)
    83			goto err_ff_mask;
    84	
    85		ff->ff_actions = kzalloc(sizeof(*ff->ff_actions) +
    86						VIRTIO_NET_FF_ACTION_MAX,
    87						GFP_KERNEL);
    88		if (!ff->ff_actions)
    89			goto err_ff_mask;
    90	
    91		err = virtio_device_cap_get(vdev,
    92					    VIRTIO_NET_FF_ACTION_CAP,
    93					    ff->ff_actions,
    94					    sizeof(*ff->ff_actions) + VIRTIO_NET_FF_ACTION_MAX);
    95	
    96		if (err)
    97			goto err_ff_action;
    98	
  > 99		if (le32_to_cpu(ff->ff_caps->groups_limit < VIRTNET_FF_MAX_GROUPS)) {
   100			err = -ENOSPC;
   101			goto err_ff_action;
   102		}
 > 103		ff->ff_caps->groups_limit = VIRTNET_FF_MAX_GROUPS;
   104	
   105		err = virtio_device_cap_set(vdev,
   106					    VIRTIO_NET_FF_RESOURCE_CAP,
   107					    ff->ff_caps,
   108					    sizeof(*ff->ff_caps));
   109		if (err)
   110			goto err_ff_action;
   111	
   112		ff_mask_size = sizeof(struct virtio_net_ff_cap_mask_data);
   113		sel = &ff->ff_mask->selectors[0];
   114	
   115		for (int i = 0; i < ff->ff_mask->count; i++) {
   116			ff_mask_size += sizeof(struct virtio_net_ff_selector) + sel->length;
   117			sel = (struct virtio_net_ff_selector *)((u8 *)sel + sizeof(*sel) + sel->length);
   118		}
   119	
   120		err = virtio_device_cap_set(vdev,
   121					    VIRTIO_NET_FF_SELECTOR_CAP,
   122					    ff->ff_mask,
   123					    ff_mask_size);
   124		if (err)
   125			goto err_ff_action;
   126	
   127		err = virtio_device_cap_set(vdev,
   128					    VIRTIO_NET_FF_ACTION_CAP,
   129					    ff->ff_actions,
   130					    sizeof(*ff->ff_actions) + VIRTIO_NET_FF_ACTION_MAX);
   131		if (err)
   132			goto err_ff_action;
   133	
   134		ethtool_group.group_priority = cpu_to_le16(VIRTNET_FF_ETHTOOL_GROUP_PRIORITY);
   135	
   136		/* Use priority for the object ID. */
   137		err = virtio_device_object_create(vdev,
   138						  VIRTIO_NET_RESOURCE_OBJ_FF_GROUP,
   139						  VIRTNET_FF_ETHTOOL_GROUP_PRIORITY,
   140						  &ethtool_group,
   141						  sizeof(ethtool_group));
   142		if (err)
   143			goto err_ff_action;
   144	
   145		ff->vdev = vdev;
   146		ff->ff_supported = true;
   147	
   148		return;
   149	
   150	err_ff_action:
   151		kfree(ff->ff_actions);
   152	err_ff_mask:
   153		kfree(ff->ff_mask);
   154	err_ff:
   155		kfree(ff->ff_caps);
   156	}
   157	

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

  reply	other threads:[~2025-08-28 20:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-27 18:38 [PATCH net-next 00/11] virtio_net: Add ethtool flow rules support Daniel Jurgens
2025-08-27 18:38 ` [PATCH net-next 01/11] virtio-pci: Expose generic device capability operations Daniel Jurgens
2025-08-27 18:38 ` [PATCH net-next 02/11] virtio-pci: Expose object create and destroy API Daniel Jurgens
2025-08-27 18:38 ` [PATCH net-next 03/11] virtio_net: Create virtio_net directory Daniel Jurgens
2025-08-27 18:38 ` [PATCH net-next 04/11] virtio_net: Query and set flow filter caps Daniel Jurgens
2025-08-28  0:15   ` kernel test robot
2025-08-27 18:38 ` [PATCH net-next 05/11] virtio_net: Create a FF group for ethtool steering Daniel Jurgens
2025-08-28 20:52   ` kernel test robot [this message]
2025-08-27 18:38 ` [PATCH net-next 06/11] virtio_net: Implement layer 2 ethtool flow rules Daniel Jurgens
2025-08-28 22:27   ` kernel test robot
2025-08-29 18:39   ` ALOK TIWARI
2025-08-29 20:16     ` Dan Jurgens
2025-08-27 18:38 ` [PATCH net-next 07/11] virtio_net: Use existing classifier if possible Daniel Jurgens
2025-08-27 18:38 ` [PATCH net-next 08/11] virtio_net: Implement IPv4 ethtool flow rules Daniel Jurgens
2025-08-29  0:27   ` kernel test robot
2025-08-27 18:38 ` [PATCH net-next 09/11] virtio_net: Add support for IPv6 ethtool steering Daniel Jurgens
2025-08-27 18:38 ` [PATCH net-next 10/11] virtio_net: Add support for TCP and UDP ethtool rules Daniel Jurgens
2025-08-27 18:38 ` [PATCH net-next 11/11] virtio_net: Add get ethtool flow rules ops Daniel Jurgens

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=202508290458.9QTyiC0K-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=alex.williamson@redhat.com \
    --cc=danielj@nvidia.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pabeni@redhat.com \
    --cc=parav@nvidia.com \
    --cc=shshitrit@nvidia.com \
    --cc=virtualization@lists.linux.dev \
    --cc=yohadt@nvidia.com \
    /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).