net/virtio: fix incorrect cast of void * The rx_queues and tx_queues fields of the data structure points to a struct virtnet_rx or virtnet_tx. Casting it to a virtqueue is an error. It does not trigger any bug because pointer is not dereferenced inside the function, but it can become a bug if this code is copy/pasted and vq is dereferenced. Fixes: 01ad44fd374f ("net/virtio: split Rx/Tx queue") Cc: stable@dpdk.org Signed-off-by: Didier Pallard <didier.pallard@6wind.com> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
net/virtio: fix Rx and Tx handler selection for arm32 On arm32, we were always selecting the simple handler, but it is only available if neon is present. This is due to a typo in the name of the config option. CONFIG_RTE_ARCH_ARM is for Makefiles. One should use RTE_ARCH_ARM. Fixes: 2d7c37194ee4 ("net/virtio: add NEON based Rx handler") Cc: stable@dpdk.org Signed-off-by: Samuel Gauthier <samuel.gauthier@6wind.com>
net/bntx: use new API to get iova address XXX XXX: use mbuf instead of m ? The functions rte_mbuf_data_dma_addr*() are deprecated. Replace them with their iova version. Also rename the 'data' variable to 'm' (for mbuf) to avoid confusion. Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
net/bnxt: fix headroom initialization When allocating a new mbuf for Rx, the value of m->data_off should not be reset to its default value (RTE_PKTMBUF_HEADROOM), instead of reusing the previous undefined value, which could cause the packet to have a too small or too high headroom. Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code") Cc: stable@dpdk.org Signed-off-by: Zijie Pan <zijie.pan@6wind.com> Signed-off-by: Didier Pallard <didier.pallard@6wind.com> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
mk: fix libs installation when installing sdk The 'install-sdk' target creates an invalid symlink in the install directory: # make install-sdk DESTDIR=/tmp/toto V=1 [...] ln -snf $(/root/dpdk.org/buildtools/relpath.sh /tmp/toto/usr/local/lib \ /tmp/toto/usr/local/share/dpdk/x86_64-native-linuxapp-gcc/) \ /tmp/toto/usr/local/share/dpdk/x86_64-native-linuxapp-gcc/lib [...] # ls -l /tmp/toto/usr/local/share/dpdk/x86_64-native-linuxapp-gcc drwxr-xr-x 2 root root 4096 Dec 11 11:49 app lrwxrwxrwx 1 root root 21 Dec 11 11:49 include -> ../../../include/dpdk lrwxrwxrwx 1 root root 12 Dec 11 11:49 lib -> ../../../lib # WRONG LINK This happens because the directory is not created. Moreover, it makes sense for install-sdk to install the libs, which could be necessary to build something against dpdk. After the patch, the link is correct and the *.a libs are properly installed: # ls -l /tmp/toto/usr/local/share/dpdk/x86_64-native-linuxapp-gcc drwxr-xr-x 2 root root 4096 Dec 11 11:53 app lrwxrwxrwx 1 root root 21 Dec 11 11:53 include -> ../../../include/dpdk lrwxrwxrwx 1 root root 12 Dec 11 11:53 lib -> ../../../lib # ls -l /tmp/toto/usr/local/share/dpdk/x86_64-native-linuxapp-gcc/lib/ -rw-r--r-- 1 root root 1378 Dec 8 14:08 libdpdk.a -rw-r--r-- 1 root root 123380 Dec 8 14:02 librte_acl.a -rw-r--r-- 1 root root 3406 Dec 8 14:02 librte_bitratestats.a [...] Fixes: 6efca1e9f873 ("mk: split install rule") Cc: stable@dpdk.org Signed-off-by: Samuel Gauthier <samuel.gauthier@6wind.com> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
ethdev: fix missing imissed counter in xstats imissed counter has been set as deprecated in commit 49f386542af4 ("ethdev: remove driver specific stats") and removed from the rte_eth_xstats_name_off structure. The imissed counter has been restored few commits later but has not been restored in the rte_eth_stats structure. Add it back again. Fixes: 4eadb8ba11b7 ("ethdev: do not deprecate imissed counter") Cc: stable@dpdk.org Signed-off-by: Thibaut Collet <thibaut.collet@6wind.com> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
scripts: enhance the get maintainer error message When the DPDK_GETMAINTAINER_PATH variable was not set, the error message from get-maintainer.sh was quite cheap: $ devtools/get-maintainer.sh --help usage: get-maintainer.sh <patch> Cannot execute DPDK_GETMAINTAINER_PATH Add a more detailed explanation about this variable in the help. Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
app/testpmd: register a specific log type Instead of using USERx logs, register a dynamic log type, as introduced in commit c1b5fa94a46f ("eal: support dynamic log types"). Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
mbuf: remove control mbuf The rte_ctrlmbuf structure is not used by any example application in dpdk. Remove it, as announced on the mailing list. Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
mbuf: fix mbuf free performance with non atomic refcnt When RTE_MBUF_REFCNT_ATOMIC=n, the decrement of the mbuf reference counter uses an atomic operation. This is not necessary and impacts the performance (seen with TRex traffic generator). We cannot replace rte_atomic16_add_return() by rte_mbuf_refcnt_update() because it would add an additional check. Solves this by introducing __rte_mbuf_refcnt_update(), which updates the reference counter without doing anything else. Fixes: 8f094a9ac5d7 ("mbuf: set mbuf fields while in pool") Suggested-by: Hanoch Haim <hhaim@cisco.com> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
net: update licence for network headers To be compliant with the DPDK licensing guidelines, switch to BSD-3-Clause. It can be done safely since the BSD headers from which these files derive also exist as a BSD-3-Clause license in FreeBSD. Link: https://raw.githubusercontent.com/freebsd/freebsd/78a6b0861813af31e1354fa407c5701e8764b4d6/sys/netinet/ip_icmp.h Link: https://raw.githubusercontent.com/freebsd/freebsd/78a6b0861813af31e1354fa407c5701e8764b4d6/sys/netinet/ip.h Link: https://raw.githubusercontent.com/freebsd/freebsd/78a6b0861813af31e1354fa407c5701e8764b4d6/sys/netinet/sctp.h Link: https://raw.githubusercontent.com/freebsd/freebsd/78a6b0861813af31e1354fa407c5701e8764b4d6/sys/netinet/tcp.h Link: https://raw.githubusercontent.com/freebsd/freebsd/78a6b0861813af31e1354fa407c5701e8764b4d6/sys/netinet/udp.h Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
eal: set affinity for control threads The management threads must not bother the dataplane or service cores. Set the affinity of these threads accordingly. Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
eal: set name when creating a control thread To avoid code duplication, add a parameter to rte_ctrl_thread_create() to specify the name of the thread. This requires to add a wrapper for the thread start routine in rte_thread_init(), which will first wait that the thread is configured. Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
eal: new function to create control threads Many parts of dpdk use their own management threads. Introduce a new wrapper for thread creation that will be extended in next commit to set the name and affinity. To be consistent with other DPDK APIs, the return value is negative in case of error, which was not the case for pthread_create(). Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
pdump: fix error code check when creating/canceling pthread On error, pthread_create() returns a positive number (an errno) but does not set the errno variable. Fixes: 278f945402c5 ("pdump: add new library for packet capture") Cc: stable@dpdk.org Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
vhost: fix error code check when creating pthread On error, pthread_create() returns a positive number (errno). Fix the test on the return value. Fixes: af1475918124 ("vhost: introduce API to start a specific driver") Fixes: e623e0c6d8a5 ("vhost: add reconnect ability") Cc: stable@dpdk.org Signed-off-by: Olivier Matz <olivier.matz@6wind.com>