Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Leon Romanovsky <leonro@nvidia.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [leon-rdma:ipsec-fixes 5/5] drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c:1758:10: error: incompatible pointer types assigning to '__be32 *' (aka 'unsigned int *') from '__be32 (*)[4]' (aka 'unsigned int (*)[4]')
Date: Sun, 15 Dec 2024 02:11:27 +0800	[thread overview]
Message-ID: <202412150253.vejuRmav-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git ipsec-fixes
head:   839c93393a929a87810d251d9994d1a5a069bc3f
commit: 839c93393a929a87810d251d9994d1a5a069bc3f [5/5] net/mlx5: Rely on reqid and destination address in IPsec tunnel mode
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20241215/202412150253.vejuRmav-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241215/202412150253.vejuRmav-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/202412150253.vejuRmav-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c:4:
   In file included from include/linux/netdevice.h:38:
   In file included from include/net/net_namespace.h:43:
   In file included from include/linux/skbuff.h:17:
   In file included from include/linux/bvec.h:10:
   In file included from include/linux/highmem.h:10:
   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/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c:1758:10: error: incompatible pointer types assigning to '__be32 *' (aka 'unsigned int *') from '__be32 (*)[4]' (aka 'unsigned int (*)[4]') [-Werror,-Wincompatible-pointer-types]
    1758 |                         saddr = &attrs->saddr.a6;
         |                               ^ ~~~~~~~~~~~~~~~~
   4 warnings and 1 error generated.


vim +1758 drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c

  1723	
  1724	static int tx_add_rule(struct mlx5e_ipsec_sa_entry *sa_entry)
  1725	{
  1726		struct mlx5_accel_esp_xfrm_attrs *attrs = &sa_entry->attrs;
  1727		struct mlx5_core_dev *mdev = mlx5e_ipsec_sa2dev(sa_entry);
  1728		struct mlx5e_ipsec *ipsec = sa_entry->ipsec;
  1729		struct mlx5_flow_destination dest[2];
  1730		struct mlx5_flow_act flow_act = {};
  1731		struct mlx5_flow_handle *rule;
  1732		struct mlx5_flow_spec *spec;
  1733		struct mlx5e_ipsec_tx *tx;
  1734		struct mlx5_fc *counter;
  1735		__be32 *saddr = NULL;
  1736		int err;
  1737	
  1738		tx = tx_ft_get(mdev, ipsec, attrs->type);
  1739		if (IS_ERR(tx))
  1740			return PTR_ERR(tx);
  1741	
  1742		spec = kvzalloc(sizeof(*spec), GFP_KERNEL);
  1743		if (!spec) {
  1744			err = -ENOMEM;
  1745			goto err_alloc;
  1746		}
  1747	
  1748		switch (attrs->type) {
  1749		case XFRM_DEV_OFFLOAD_PACKET:
  1750			if (attrs->mode == XFRM_MODE_TUNNEL)
  1751				/* We rely on reqid and destination address */
  1752				break;
  1753			fallthrough;
  1754		case XFRM_DEV_OFFLOAD_CRYPTO:
  1755			if (attrs->family == AF_INET)
  1756				saddr = &attrs->saddr.a4;
  1757			else
> 1758				saddr = &attrs->saddr.a6;
  1759			break;
  1760		default:
  1761			break;
  1762		}
  1763	
  1764		if (attrs->family == AF_INET)
  1765			setup_fte_addr4(spec, saddr, &attrs->daddr.a4);
  1766		else
  1767			setup_fte_addr6(spec, saddr, attrs->daddr.a6);
  1768	
  1769		setup_fte_no_frags(spec);
  1770		setup_fte_upper_proto_match(spec, &attrs->upspec);
  1771	
  1772		switch (attrs->type) {
  1773		case XFRM_DEV_OFFLOAD_CRYPTO:
  1774			setup_fte_spi(spec, attrs->spi, false);
  1775			setup_fte_esp(spec);
  1776			setup_fte_reg_a(spec);
  1777			break;
  1778		case XFRM_DEV_OFFLOAD_PACKET:
  1779			if (attrs->reqid)
  1780				setup_fte_reg_c4(spec, attrs->reqid);
  1781			err = setup_pkt_reformat(ipsec, attrs, &flow_act);
  1782			if (err)
  1783				goto err_pkt_reformat;
  1784			break;
  1785		default:
  1786			break;
  1787		}
  1788	
  1789		counter = mlx5_fc_create(mdev, true);
  1790		if (IS_ERR(counter)) {
  1791			err = PTR_ERR(counter);
  1792			goto err_add_cnt;
  1793		}
  1794	
  1795		flow_act.crypto.type = MLX5_FLOW_CONTEXT_ENCRYPT_DECRYPT_TYPE_IPSEC;
  1796		flow_act.crypto.obj_id = sa_entry->ipsec_obj_id;
  1797		flow_act.flags |= FLOW_ACT_NO_APPEND;
  1798		flow_act.action |= MLX5_FLOW_CONTEXT_ACTION_CRYPTO_ENCRYPT |
  1799				   MLX5_FLOW_CONTEXT_ACTION_COUNT;
  1800		if (attrs->drop)
  1801			flow_act.action |= MLX5_FLOW_CONTEXT_ACTION_DROP;
  1802		else
  1803			flow_act.action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
  1804	
  1805		dest[0].ft = tx->ft.status;
  1806		dest[0].type = MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE;
  1807		dest[1].type = MLX5_FLOW_DESTINATION_TYPE_COUNTER;
  1808		dest[1].counter_id = mlx5_fc_id(counter);
  1809		rule = mlx5_add_flow_rules(tx->ft.sa, spec, &flow_act, dest, 2);
  1810		if (IS_ERR(rule)) {
  1811			err = PTR_ERR(rule);
  1812			mlx5_core_err(mdev, "fail to add TX ipsec rule err=%d\n", err);
  1813			goto err_add_flow;
  1814		}
  1815	
  1816		kvfree(spec);
  1817		sa_entry->ipsec_rule.rule = rule;
  1818		sa_entry->ipsec_rule.fc = counter;
  1819		sa_entry->ipsec_rule.pkt_reformat = flow_act.pkt_reformat;
  1820		return 0;
  1821	
  1822	err_add_flow:
  1823		mlx5_fc_destroy(mdev, counter);
  1824	err_add_cnt:
  1825		if (flow_act.pkt_reformat)
  1826			mlx5_packet_reformat_dealloc(mdev, flow_act.pkt_reformat);
  1827	err_pkt_reformat:
  1828		kvfree(spec);
  1829	err_alloc:
  1830		tx_ft_put(ipsec, attrs->type);
  1831		return err;
  1832	}
  1833	

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

                 reply	other threads:[~2024-12-14 18: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=202412150253.vejuRmav-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=leonro@nvidia.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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