public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Daniel Borkmann <daniel@iogearbox.net>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [cilium:pr/bpf-tproxy 8/8] drivers/net/ethernet/intel/fm10k/fm10k_main.c:885:16: warning: division by zero is undefined
Date: Fri, 17 Apr 2026 15:41:16 +0800	[thread overview]
Message-ID: <202604171545.woUYCIGr-lkp@intel.com> (raw)

tree:   https://github.com/cilium/linux.git pr/bpf-tproxy
head:   27d1eafb8d37f1b272a991077d3bd1bb312118a9
commit: 27d1eafb8d37f1b272a991077d3bd1bb312118a9 [8/8] bpf: Support SOCK_RCU_FREE sockets in bpf_sk_assign on egress
config: powerpc64-randconfig-001-20260417 (https://download.01.org/0day-ci/archive/20260417/202604171545.woUYCIGr-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 5bac06718f502014fade905512f1d26d578a18f3)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260417/202604171545.woUYCIGr-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/202604171545.woUYCIGr-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from drivers/net/ethernet/intel/fm10k/fm10k_main.c:6:
   In file included from include/net/ipv6.h:12:
   In file included from include/linux/ipv6.h:103:
   In file included from include/linux/tcp.h:20:
   In file included from include/net/inet_connection_sock.h:21:
   In file included from include/net/inet_sock.h:24:
   include/net/request_sock.h:117:29: error: use of undeclared identifier 'sock_pfree_ref'; did you mean 'sock_kfree_s'?
     117 |                               skb->destructor == sock_pfree_ref;
         |                                                  ^~~~~~~~~~~~~~
         |                                                  sock_kfree_s
   include/net/sock.h:1901:6: note: 'sock_kfree_s' declared here
    1901 | void sock_kfree_s(struct sock *sk, void *mem, int size);
         |      ^
   In file included from drivers/net/ethernet/intel/fm10k/fm10k_main.c:6:
   In file included from include/net/ipv6.h:12:
   In file included from include/linux/ipv6.h:103:
   In file included from include/linux/tcp.h:20:
   In file included from include/net/inet_connection_sock.h:21:
   In file included from include/net/inet_sock.h:24:
   include/net/request_sock.h:117:26: warning: comparison of distinct pointer types ('void (*)(struct sk_buff *)' and 'void (*)(struct sock *, void *, int)') [-Wcompare-distinct-pointer-types]
     117 |                               skb->destructor == sock_pfree_ref;
         |                               ~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~
>> drivers/net/ethernet/intel/fm10k/fm10k_main.c:885:16: warning: division by zero is undefined [-Wdivision-by-zero]
     885 |         desc_flags |= FM10K_SET_FLAG(tx_flags, FM10K_TX_FLAGS_CSUM,
         |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     886 |                                      FM10K_TXD_FLAG_CSUM);
         |                                      ~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/intel/fm10k/fm10k_main.c:877:26: note: expanded from macro 'FM10K_SET_FLAG'
     877 |          ((u32)(_input & _flag) / (_flag / _result)))
         |                                 ^ ~~~~~~~~~~~~~~~~~
   2 warnings and 1 error generated.


vim +885 drivers/net/ethernet/intel/fm10k/fm10k_main.c

76a540d4728a379 Alexander Duyck 2014-09-20  873  
76a540d4728a379 Alexander Duyck 2014-09-20  874  #define FM10K_SET_FLAG(_input, _flag, _result) \
76a540d4728a379 Alexander Duyck 2014-09-20  875  	((_flag <= _result) ? \
76a540d4728a379 Alexander Duyck 2014-09-20  876  	 ((u32)(_input & _flag) * (_result / _flag)) : \
76a540d4728a379 Alexander Duyck 2014-09-20  877  	 ((u32)(_input & _flag) / (_flag / _result)))
76a540d4728a379 Alexander Duyck 2014-09-20  878  
76a540d4728a379 Alexander Duyck 2014-09-20  879  static u8 fm10k_tx_desc_flags(struct sk_buff *skb, u32 tx_flags)
76a540d4728a379 Alexander Duyck 2014-09-20  880  {
76a540d4728a379 Alexander Duyck 2014-09-20  881  	/* set type for advanced descriptor with frame checksum insertion */
76a540d4728a379 Alexander Duyck 2014-09-20  882  	u32 desc_flags = 0;
76a540d4728a379 Alexander Duyck 2014-09-20  883  
76a540d4728a379 Alexander Duyck 2014-09-20  884  	/* set checksum offload bits */
76a540d4728a379 Alexander Duyck 2014-09-20 @885  	desc_flags |= FM10K_SET_FLAG(tx_flags, FM10K_TX_FLAGS_CSUM,
76a540d4728a379 Alexander Duyck 2014-09-20  886  				     FM10K_TXD_FLAG_CSUM);
76a540d4728a379 Alexander Duyck 2014-09-20  887  
76a540d4728a379 Alexander Duyck 2014-09-20  888  	return desc_flags;
76a540d4728a379 Alexander Duyck 2014-09-20  889  }
76a540d4728a379 Alexander Duyck 2014-09-20  890  

:::::: The code at line 885 was first introduced by commit
:::::: 76a540d4728a379e022fb2e2e8766d502b6d345c fm10k: Add support for netdev offloads

:::::: TO: Alexander Duyck <alexander.h.duyck@intel.com>
:::::: CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

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

                 reply	other threads:[~2026-04-17  7:42 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=202604171545.woUYCIGr-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=daniel@iogearbox.net \
    --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