Go to file
Ferruh Yigit dbd8bdfc04 net/virtio: fix 32-bit build with gcc 6
This is for target i686-native-linuxapp-gcc and gcc6,

Compilation error is:

In file included from
  include/rte_mempool.h:77:0, from
  drivers/net/virtio/virtio_rxtx_simple.c:
In function `virtio_xmit_pkts_simple':
  include/rte_memcpy.h:551:2: error:
    array subscript is above array bounds
      rte_mov16((uint8_t *)dst + 1 * 16, (const uint8_t *)src + 1 * 16);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Call stack is as following:

virtio_xmit_pkts_simple
  virtio_xmit_cleanup
    rte_mempool_put_bulk
      rte_mempool_generic_put
        __mempool_generic_put
	  rte_memcpy

The array used as source buffer in virtio_xmit_cleanup (free) is a
pointer array with 32 elements, in 32bit this makes 128 bytes.

in rte_memcpy() implementation, there a code piece as following:
if (size > 256) {
    rte_move128(...);
    rte_move128(...); <--- [1]
    ....
}

The compiler traces the array all through the call stack and knows the
size of array is 128 and generates a warning on above [1] which tries to
access beyond byte 128.
But unfortunately it ignores the "(size > 256)" check.

Giving a hint to compiler that variable "size" is related to the size of
the source buffer fixes compiler warning.

Fixes: 863bfb4744 ("mempool: optimize copy in cache")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-07-11 07:41:09 +02:00
app app/test: remove useless clock estimation 2016-07-10 16:19:56 +02:00
buildtools pmdinfogen: fix build on FreeBSD 2016-07-10 14:51:09 +02:00
config net/virtio-user: fix missing default config value 2016-07-04 04:08:41 +02:00
doc doc: explain virtio Rx/Tx functions 2016-07-05 13:30:25 +02:00
drivers net/virtio: fix 32-bit build with gcc 6 2016-07-11 07:41:09 +02:00
examples examples/vhost: print error logs on failure 2016-07-11 04:57:15 +02:00
lib vhost: fix potential null pointer dereference 2016-07-04 04:08:41 +02:00
mk mk: fix verbose pmdinfogen run 2016-07-08 17:07:05 +02:00
pkg version: 16.04 2016-04-11 23:56:34 +02:00
scripts scripts: add more git log capitalization checks 2016-07-10 17:01:02 +02:00
tools tools: fix pmdinfo for FreeBSD 2016-07-10 14:51:09 +02:00
.gitignore init DPDK repository 2013-03-07 10:57:42 +01:00
GNUmakefile pmdinfogen: add buildtools and pmdinfogen utility 2016-07-06 22:34:39 +02:00
LICENSE.GPL doc: GPL/LGPL licenses 2013-07-25 14:43:06 +02:00
LICENSE.LGPL doc: fix file format (dos to unix) 2013-09-06 11:43:07 +02:00
MAINTAINERS maintainers: add section for pmdinfo 2016-07-08 17:48:15 +02:00
Makefile remove trailing whitespaces 2014-06-11 00:29:34 +02:00
README doc: add readme file 2015-12-13 22:06:58 +01:00

DPDK is a set of libraries and drivers for fast packet processing.
It supports many processor architectures and both FreeBSD and Linux.

The DPDK uses the Open Source BSD license for the core libraries and
drivers. The kernel components are GPLv2 licensed.

Please check the doc directory for release notes,
API documentation, and sample application information.

For questions and usage discussions, subscribe to: users@dpdk.org
Report bugs and issues to the development mailing list: dev@dpdk.org