public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Toke Høiland-Jørgensen" <toke@redhat.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: [toke:xdp-queueing-03 3/9] net/bpf/test_run.c:1372:15: warning: cast to pointer from integer of different size
Date: Fri, 11 Mar 2022 19:59:41 +0800	[thread overview]
Message-ID: <202203111957.Pexg2qR6-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/toke/linux.git xdp-queueing-03
head:   91c92d46077f70b03fd162128dd3373663d529d4
commit: eb1f31b3643b9fb49f4785deab32e3461eca777f [3/9] xdp: add dequeue program type for getting packets from a PIFO
config: xtensa-buildonly-randconfig-r004-20220310 (https://download.01.org/0day-ci/archive/20220311/202203111957.Pexg2qR6-lkp@intel.com/config)
compiler: xtensa-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/toke/linux.git/commit/?id=eb1f31b3643b9fb49f4785deab32e3461eca777f
        git remote add toke https://git.kernel.org/pub/scm/linux/kernel/git/toke/linux.git
        git fetch --no-tags toke xdp-queueing-03
        git checkout eb1f31b3643b9fb49f4785deab32e3461eca777f
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=xtensa SHELL=/bin/bash net/bpf/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   net/bpf/test_run.c: In function 'bpf_prog_test_run_dequeue':
>> net/bpf/test_run.c:1372:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    1372 |         pkt = (void *)retval;
         |               ^


vim +1372 net/bpf/test_run.c

  1347	
  1348	int bpf_prog_test_run_dequeue(struct bpf_prog *prog, const union bpf_attr *kattr,
  1349				      union bpf_attr __user *uattr)
  1350	{
  1351		struct xdp_txq_info txq = { .dev = current->nsproxy->net_ns->loopback_dev };
  1352		u32 repeat = kattr->test.repeat, duration, size;
  1353		struct dequeue_data ctx = { .txq = &txq };
  1354		struct xdp_buff xdp = {};
  1355		struct xdp_frame *pkt;
  1356		int ret = -EINVAL;
  1357		u64 retval;
  1358	
  1359		if (prog->expected_attach_type)
  1360			return -EINVAL;
  1361	
  1362		if (kattr->test.data_in || kattr->test.data_size_in ||
  1363		    kattr->test.ctx_in || kattr->test.ctx_out || repeat > 1)
  1364			return -EINVAL;
  1365	
  1366		ret = bpf_test_run(prog, &ctx, repeat, &retval, &duration, false);
  1367		if (ret)
  1368			return ret;
  1369		if (!retval)
  1370			return bpf_test_finish(kattr, uattr, NULL, NULL, 0, retval, duration);
  1371	
> 1372		pkt = (void *)retval;
  1373		xdp_convert_frame_to_buff(pkt, &xdp);
  1374		size = xdp.data_end - xdp.data_meta;
  1375		/* We set retval == 1 if pkt != NULL, otherwise 0 */
  1376		ret = bpf_test_finish(kattr, uattr, xdp.data_meta, NULL, size, !!retval, duration);
  1377		xdp_return_frame(pkt);
  1378		return ret;
  1379	}
  1380	

---
0-DAY CI Kernel Test Service
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

                 reply	other threads:[~2022-03-11 12:00 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=202203111957.Pexg2qR6-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=toke@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