mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Maxime Chevallier <maxime.chevallier@bootlin.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Paolo Abeni <pabeni@redhat.com>, Andrew Lunn <andrew@lunn.ch>
Subject: drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c:1494:24: sparse: sparse: incorrect type in assignment (different base types)
Date: Sun, 01 Nov 2026 05:11:53 +0100	[thread overview]
Message-ID: <202611010511.Mk620DTd-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   cbbddb6b08cc9900a87cccaa9b22bbe06aa4f50a
commit: 9a56a27e6002e29a6707dc4238d469ec84c3a68e net: stmmac: selftests: Pass the IP proto mask in the TC selftest
date:   9 weeks ago
config: hexagon-randconfig-r2309-20261101 (https://download.01.org/0day-ci/archive/20261101/202611010511.Mk620DTd-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 8f6b51ca8bab1d49006ddaa042bc7e4e7306975d)
sparse: v0.6.5-rc1-21-g84ec0658
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261101/202611010511.Mk620DTd-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
| Fixes: 9a56a27e6002 ("net: stmmac: selftests: Pass the IP proto mask in the TC selftest")
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202611010511.Mk620DTd-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c:1118:27: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be32 [usertype] mask @@     got int @@
   drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c:1118:27: sparse:     expected restricted __be32 [usertype] mask
   drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c:1118:27: sparse:     got int
   drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c:1363:18: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be32 [addressable] [usertype] src @@     got unsigned int [usertype] src_mask @@
   drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c:1363:18: sparse:     expected restricted __be32 [addressable] [usertype] src
   drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c:1363:18: sparse:     got unsigned int [usertype] src_mask
   drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c:1364:18: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be32 [addressable] [usertype] dst @@     got unsigned int [usertype] dst_mask @@
   drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c:1364:18: sparse:     expected restricted __be32 [addressable] [usertype] dst
   drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c:1364:18: sparse:     got unsigned int [usertype] dst_mask
>> drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c:1494:24: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be16 [addressable] [assigned] [usertype] src @@     got unsigned int [usertype] src_mask @@
   drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c:1494:24: sparse:     expected restricted __be16 [addressable] [assigned] [usertype] src
   drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c:1494:24: sparse:     got unsigned int [usertype] src_mask
>> drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c:1495:24: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be16 [addressable] [assigned] [usertype] dst @@     got unsigned int [usertype] dst_mask @@
   drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c:1495:24: sparse:     expected restricted __be16 [addressable] [assigned] [usertype] dst
   drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c:1495:24: sparse:     got unsigned int [usertype] dst_mask

vim +1494 drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c

4647e021193d63 Jose Abreu        2019-09-04  1427  
4647e021193d63 Jose Abreu        2019-09-04  1428  #ifdef CONFIG_NET_CLS_ACT
4647e021193d63 Jose Abreu        2019-09-04  1429  static int __stmmac_test_l4filt(struct stmmac_priv *priv, u32 dst, u32 src,
4647e021193d63 Jose Abreu        2019-09-04  1430  				u32 dst_mask, u32 src_mask, bool udp)
4647e021193d63 Jose Abreu        2019-09-04  1431  {
4647e021193d63 Jose Abreu        2019-09-04  1432  	struct {
4647e021193d63 Jose Abreu        2019-09-04  1433  		struct flow_dissector_key_basic bkey;
4647e021193d63 Jose Abreu        2019-09-04  1434  		struct flow_dissector_key_ports key;
9a56a27e6002e2 Maxime Chevallier 2026-08-25  1435  	} __aligned(BITS_PER_LONG / 8) keys = { };
4647e021193d63 Jose Abreu        2019-09-04  1436  	struct {
4647e021193d63 Jose Abreu        2019-09-04  1437  		struct flow_dissector_key_basic bmask;
4647e021193d63 Jose Abreu        2019-09-04  1438  		struct flow_dissector_key_ports mask;
9a56a27e6002e2 Maxime Chevallier 2026-08-25  1439  	} __aligned(BITS_PER_LONG / 8) masks = { };
4647e021193d63 Jose Abreu        2019-09-04  1440  	unsigned long dummy_cookie = 0xdeadbeef;
4647e021193d63 Jose Abreu        2019-09-04  1441  	struct stmmac_packet_attrs attr = { };
4647e021193d63 Jose Abreu        2019-09-04  1442  	struct flow_dissector *dissector;
4647e021193d63 Jose Abreu        2019-09-04  1443  	struct flow_cls_offload *cls;
e715d745043529 Jose Abreu        2020-01-10  1444  	int ret, old_enable = 0;
4647e021193d63 Jose Abreu        2019-09-04  1445  	struct flow_rule *rule;
4647e021193d63 Jose Abreu        2019-09-04  1446  
4647e021193d63 Jose Abreu        2019-09-04  1447  	if (!tc_can_offload(priv->dev))
4647e021193d63 Jose Abreu        2019-09-04  1448  		return -EOPNOTSUPP;
4647e021193d63 Jose Abreu        2019-09-04  1449  	if (!priv->dma_cap.l3l4fnum)
4647e021193d63 Jose Abreu        2019-09-04  1450  		return -EOPNOTSUPP;
e715d745043529 Jose Abreu        2020-01-10  1451  	if (priv->rss.enable) {
e715d745043529 Jose Abreu        2020-01-10  1452  		old_enable = priv->rss.enable;
e715d745043529 Jose Abreu        2020-01-10  1453  		priv->rss.enable = false;
b6b6cc9acd7b99 Arnd Bergmann     2019-09-19  1454  		stmmac_rss_configure(priv, priv->hw, NULL,
4647e021193d63 Jose Abreu        2019-09-04  1455  				     priv->plat->rx_queues_to_use);
e715d745043529 Jose Abreu        2020-01-10  1456  	}
4647e021193d63 Jose Abreu        2019-09-04  1457  
bf4afc53b77aea Linus Torvalds    2026-02-21  1458  	dissector = kzalloc_obj(*dissector);
4647e021193d63 Jose Abreu        2019-09-04  1459  	if (!dissector) {
4647e021193d63 Jose Abreu        2019-09-04  1460  		ret = -ENOMEM;
4647e021193d63 Jose Abreu        2019-09-04  1461  		goto cleanup_rss;
4647e021193d63 Jose Abreu        2019-09-04  1462  	}
4647e021193d63 Jose Abreu        2019-09-04  1463  
2b3082c6ef3b01 Ratheesh Kannoth  2023-07-29  1464  	dissector->used_keys |= (1ULL << FLOW_DISSECTOR_KEY_BASIC);
2b3082c6ef3b01 Ratheesh Kannoth  2023-07-29  1465  	dissector->used_keys |= (1ULL << FLOW_DISSECTOR_KEY_PORTS);
4647e021193d63 Jose Abreu        2019-09-04  1466  	dissector->offset[FLOW_DISSECTOR_KEY_BASIC] = 0;
4647e021193d63 Jose Abreu        2019-09-04  1467  	dissector->offset[FLOW_DISSECTOR_KEY_PORTS] = offsetof(typeof(keys), key);
4647e021193d63 Jose Abreu        2019-09-04  1468  
bf4afc53b77aea Linus Torvalds    2026-02-21  1469  	cls = kzalloc_obj(*cls);
4647e021193d63 Jose Abreu        2019-09-04  1470  	if (!cls) {
4647e021193d63 Jose Abreu        2019-09-04  1471  		ret = -ENOMEM;
4647e021193d63 Jose Abreu        2019-09-04  1472  		goto cleanup_dissector;
4647e021193d63 Jose Abreu        2019-09-04  1473  	}
4647e021193d63 Jose Abreu        2019-09-04  1474  
4647e021193d63 Jose Abreu        2019-09-04  1475  	cls->common.chain_index = 0;
4647e021193d63 Jose Abreu        2019-09-04  1476  	cls->command = FLOW_CLS_REPLACE;
4647e021193d63 Jose Abreu        2019-09-04  1477  	cls->cookie = dummy_cookie;
4647e021193d63 Jose Abreu        2019-09-04  1478  
323bbfcf1ef883 Linus Torvalds    2026-02-21  1479  	rule = kzalloc_flex(*rule, action.entries, 1);
4647e021193d63 Jose Abreu        2019-09-04  1480  	if (!rule) {
4647e021193d63 Jose Abreu        2019-09-04  1481  		ret = -ENOMEM;
4647e021193d63 Jose Abreu        2019-09-04  1482  		goto cleanup_cls;
4647e021193d63 Jose Abreu        2019-09-04  1483  	}
4647e021193d63 Jose Abreu        2019-09-04  1484  
4647e021193d63 Jose Abreu        2019-09-04  1485  	rule->match.dissector = dissector;
4647e021193d63 Jose Abreu        2019-09-04  1486  	rule->match.key = (void *)&keys;
4647e021193d63 Jose Abreu        2019-09-04  1487  	rule->match.mask = (void *)&masks;
4647e021193d63 Jose Abreu        2019-09-04  1488  
4647e021193d63 Jose Abreu        2019-09-04  1489  	keys.bkey.ip_proto = udp ? IPPROTO_UDP : IPPROTO_TCP;
4647e021193d63 Jose Abreu        2019-09-04  1490  	keys.key.src = htons(src);
4647e021193d63 Jose Abreu        2019-09-04  1491  	keys.key.dst = htons(dst);
9a56a27e6002e2 Maxime Chevallier 2026-08-25  1492  	/* Match the full IP proto field */
9a56a27e6002e2 Maxime Chevallier 2026-08-25  1493  	masks.bmask.ip_proto = 0xff;
4647e021193d63 Jose Abreu        2019-09-04 @1494  	masks.mask.src = src_mask;
4647e021193d63 Jose Abreu        2019-09-04 @1495  	masks.mask.dst = dst_mask;
4647e021193d63 Jose Abreu        2019-09-04  1496  
4647e021193d63 Jose Abreu        2019-09-04  1497  	cls->rule = rule;
4647e021193d63 Jose Abreu        2019-09-04  1498  
4647e021193d63 Jose Abreu        2019-09-04  1499  	rule->action.entries[0].id = FLOW_ACTION_DROP;
0dfb2d82af4cd7 Jakub Kicinski    2020-03-19  1500  	rule->action.entries[0].hw_stats = FLOW_ACTION_HW_STATS_ANY;
4647e021193d63 Jose Abreu        2019-09-04  1501  	rule->action.num_entries = 1;
4647e021193d63 Jose Abreu        2019-09-04  1502  
4647e021193d63 Jose Abreu        2019-09-04  1503  	attr.dst = priv->dev->dev_addr;
4647e021193d63 Jose Abreu        2019-09-04  1504  	attr.tcp = !udp;
4647e021193d63 Jose Abreu        2019-09-04  1505  	attr.sport = src;
4647e021193d63 Jose Abreu        2019-09-04  1506  	attr.dport = dst;
4647e021193d63 Jose Abreu        2019-09-04  1507  	attr.ip_dst = 0;
4647e021193d63 Jose Abreu        2019-09-04  1508  
4647e021193d63 Jose Abreu        2019-09-04  1509  	/* Shall receive packet */
4647e021193d63 Jose Abreu        2019-09-04  1510  	ret = __stmmac_test_loopback(priv, &attr);
4647e021193d63 Jose Abreu        2019-09-04  1511  	if (ret)
4647e021193d63 Jose Abreu        2019-09-04  1512  		goto cleanup_rule;
4647e021193d63 Jose Abreu        2019-09-04  1513  
4647e021193d63 Jose Abreu        2019-09-04  1514  	ret = stmmac_tc_setup_cls(priv, priv, cls);
4647e021193d63 Jose Abreu        2019-09-04  1515  	if (ret)
4647e021193d63 Jose Abreu        2019-09-04  1516  		goto cleanup_rule;
4647e021193d63 Jose Abreu        2019-09-04  1517  
4647e021193d63 Jose Abreu        2019-09-04  1518  	/* Shall NOT receive packet */
4647e021193d63 Jose Abreu        2019-09-04  1519  	ret = __stmmac_test_loopback(priv, &attr);
4647e021193d63 Jose Abreu        2019-09-04  1520  	ret = ret ? 0 : -EINVAL;
4647e021193d63 Jose Abreu        2019-09-04  1521  
4647e021193d63 Jose Abreu        2019-09-04  1522  	cls->command = FLOW_CLS_DESTROY;
4647e021193d63 Jose Abreu        2019-09-04  1523  	stmmac_tc_setup_cls(priv, priv, cls);
4647e021193d63 Jose Abreu        2019-09-04  1524  cleanup_rule:
4647e021193d63 Jose Abreu        2019-09-04  1525  	kfree(rule);
4647e021193d63 Jose Abreu        2019-09-04  1526  cleanup_cls:
4647e021193d63 Jose Abreu        2019-09-04  1527  	kfree(cls);
4647e021193d63 Jose Abreu        2019-09-04  1528  cleanup_dissector:
4647e021193d63 Jose Abreu        2019-09-04  1529  	kfree(dissector);
4647e021193d63 Jose Abreu        2019-09-04  1530  cleanup_rss:
e715d745043529 Jose Abreu        2020-01-10  1531  	if (old_enable) {
e715d745043529 Jose Abreu        2020-01-10  1532  		priv->rss.enable = old_enable;
4647e021193d63 Jose Abreu        2019-09-04  1533  		stmmac_rss_configure(priv, priv->hw, &priv->rss,
4647e021193d63 Jose Abreu        2019-09-04  1534  				     priv->plat->rx_queues_to_use);
4647e021193d63 Jose Abreu        2019-09-04  1535  	}
4647e021193d63 Jose Abreu        2019-09-04  1536  
4647e021193d63 Jose Abreu        2019-09-04  1537  	return ret;
4647e021193d63 Jose Abreu        2019-09-04  1538  }
4647e021193d63 Jose Abreu        2019-09-04  1539  #else
4647e021193d63 Jose Abreu        2019-09-04  1540  static int __stmmac_test_l4filt(struct stmmac_priv *priv, u32 dst, u32 src,
4647e021193d63 Jose Abreu        2019-09-04  1541  				u32 dst_mask, u32 src_mask, bool udp)
4647e021193d63 Jose Abreu        2019-09-04  1542  {
4647e021193d63 Jose Abreu        2019-09-04  1543  	return -EOPNOTSUPP;
4647e021193d63 Jose Abreu        2019-09-04  1544  }
4647e021193d63 Jose Abreu        2019-09-04  1545  #endif
4647e021193d63 Jose Abreu        2019-09-04  1546  

:::::: The code at line 1494 was first introduced by commit
:::::: 4647e021193d638d3c87d1f1b9a5f7f7a48f36a3 net: stmmac: selftests: Add selftest for L3/L4 Filters

:::::: TO: Jose Abreu <Jose.Abreu@synopsys.com>
:::::: CC: David S. Miller <davem@davemloft.net>

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

                 reply	other threads:[~2026-11-01  4:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202611010511.Mk620DTd-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=andrew@lunn.ch \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.chevallier@bootlin.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pabeni@redhat.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

all inboxes | Powered by JetHome®