Commit Graph

5721 Commits

Author SHA1 Message Date
Ferruh Yigit
5e7478480e net/pcap: coding convention updates
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2016-09-30 12:27:18 +02:00
Ferruh Yigit
d75b287834 net/pcap: fix missing Tx interface assignment
Missing pcap assignment may cause pcap file/interface to be opened
again, and previous one not closed.

Fixes: 1e38a7c669 ("pcap: fix storage of name and type in queues")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2016-09-30 12:27:18 +02:00
Ferruh Yigit
0c2c1f3393 net/pcap: simplify function
simplify function rte_eth_from_pcaps_common by using interim variables.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2016-09-30 12:27:18 +02:00
Ferruh Yigit
44c788daef net/pcap: remove redundant assignment
data->name assigned twice.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2016-09-30 12:27:18 +02:00
Ferruh Yigit
549a9bf486 net/pcap: remove unnecessary check
Both fields are fields of same type of struct, one's size can't be bigger
than others.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2016-09-30 12:27:18 +02:00
Ferruh Yigit
520b47132d net/pcap: update single interface handling
Remove hardcoded single interface values, make it more obvious.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2016-09-30 12:27:18 +02:00
Ferruh Yigit
4b166098d1 net/pcap: reorder functions
Reorder functions to be able to remove function declarations in .c file.
Function definitions not modified.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2016-09-30 12:27:18 +02:00
Ferruh Yigit
e3316e46be net/pcap: reorder includes
Remove unused ones and sort remaining.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2016-09-30 12:27:18 +02:00
Ferruh Yigit
c18b5979bd net/pcap: make const array static
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2016-09-30 12:27:18 +02:00
Ferruh Yigit
ccd872affd net/pcap: group stats related fields into a struct
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2016-09-30 12:27:18 +02:00
Ferruh Yigit
fa0eea389b net/pcap: use single interface flag instead of hardcoding
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2016-09-30 12:27:18 +02:00
Ferruh Yigit
cdbfc79a26 net/pcap: remove duplicated max queue number check
Remove duplicated check by reorganizing the code, no functional change.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2016-09-30 12:27:18 +02:00
Ferruh Yigit
7da1154936 net/pcap: move comment
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2016-09-30 12:27:18 +02:00
Ferruh Yigit
d48cc4cd48 net/pcap: do not carry kvlist argument
Don't carry kvlist argument into sub function and used it, use kvlist
argument in upper level of call stack.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2016-09-30 12:27:18 +02:00
Ferruh Yigit
891a658b53 net/pcap: do not carry numa node argument
Instead of defining numa_node variable upper level of call stack and
carry into sub function, set it where needs to be used.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2016-09-30 12:27:18 +02:00
Ferruh Yigit
01f800bccb net/pcap: update function to allow reuse
rte_eth_from_pcaps and rte_eth_from_pcaps_n_dumpers functions are very
close, updated rte_eth_from_pcaps function and reused.

No functional update.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2016-09-30 12:27:18 +02:00
Ferruh Yigit
6fa06c6901 net/pcap: check max queue number
Number of queues is defined by devargs, a check added to be sure this
number is not bigger than configured max number of queue.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2016-09-30 12:27:18 +02:00
Ferruh Yigit
621314f10a net/pcap: reorganize private structs
struct rx_pcaps and tx_pcaps used to point parsed devargs, but it is not
clear with current names.

Merged both into single struct and modified struct name and field names.

Functionality not changed, only struct names.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2016-09-30 12:27:18 +02:00
Ferruh Yigit
f086a31837 net/pcap: use macros for parameter string
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2016-09-30 12:27:18 +02:00
Ferruh Yigit
3c8870f8ff net/pcap: convert config option to a macro
pcap PMD is using ring PMD configuration parameters to set max number of
queues. This creates an unnecessary dependency and confusion.

Stop using configuration parameter to set max number of queues and
convert this variable into a macro within source code, to simplify
configuration file.

Default value of macro is same as ring parameter's default.

pcap pmd doesn't need to be configured in a detail to set rx and tx max
queue numbers separately, so using same macro for both queues.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2016-09-30 12:27:18 +02:00
Ali Volkan Atli
9e9a5b08e7 net/e1000: fix returned number of available Rx descriptors
Fixes: 0f6b7c7f7a ("igb: use DD bit to count RX available descriptors")

Signed-off-by: Ali Volkan Atli <volkan.atli@argela.com.tr>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2016-09-30 12:27:18 +02:00
Nélio Laranjeiro
0e8679fcdd net/mlx5: fix inline logic
To improve performance the NIC expects for large packets to have a pointer
to a cache aligned address, old inline code could break this assumption
which hurts performance.

Fixes: 2a66cf3789 ("net/mlx5: support inline send")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Signed-off-by: Vasily Philipov <vasilyf@mellanox.com>
2016-09-30 12:27:18 +02:00
Nélio Laranjeiro
d772d4408d net/mlx5: re-factorize functions
Rework logic of wqe_write() and wqe_write_vlan() which are pretty similar
to keep a single one.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2016-09-30 12:27:18 +02:00
Nélio Laranjeiro
a6ca35aa74 net/mlx5: force inline for completion function
This function was supposed to be inlined, but was not because several
functions calls it.  This function should always be inline avoid
external function calls and to optimize code in data-path.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2016-09-30 12:27:18 +02:00
Yaacov Hazan
ade188a516 net/mlx5: fix flow director drop mode
Packet rejection was routed to a polled queue.  This patch route them to a
dummy queue which is not polled.

Fixes: 76f5c99e68 ("mlx5: support flow director")

Signed-off-by: Yaacov Hazan <yaacovh@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2016-09-30 12:27:18 +02:00
Yaacov Hazan
f5d9b9990d net/mlx5: refactor allocation of flow director queues
This is done to prepare support for drop queues, which are not related to
existing Rx queues and need to be managed separately.

Signed-off-by: Yaacov Hazan <yaacovh@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2016-09-30 12:27:18 +02:00
Raslan Darawsheh
70d32d3afe net/mlx5: fix removing VLAN filter
memmove was moving bytes as the number of elements next to i, while it
should move the number of elements multiplied by the size of each element.

Fixes: e9086978 ("mlx5: support VLAN filtering")

Signed-off-by: Raslan Darawsheh <rdarawsheh@asaltech.com>
2016-09-30 12:27:18 +02:00
Adrien Mazarguil
f08b6e7104 net/mlx5: fix Rx VLAN offload capability report
This capability is implemented but not reported.

Fixes: f3db948918 ("mlx5: support Rx VLAN stripping")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2016-09-30 12:27:18 +02:00
Yaacov Hazan
c502d05197 net/mlx5: fix inconsistent return value in flow director
The return value in DPDK is negative errno on failure.
Since internal functions in mlx driver return positive
values need to negate this value when it returned to
dpdk layer.

Fixes: 76f5c99 ("mlx5: support flow director")

Signed-off-by: Yaacov Hazan <yaacovh@mellanox.com>
2016-09-30 12:27:18 +02:00
Rami Rosen
3702a284e0 doc: fix typo in VF guide
This patch fixes a typo in doc/guides/nics/intel_vf.rst.

Fixes: fc1f2750a3 ("doc: programmers guide")

Signed-off-by: Rami Rosen <rami.rosen@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2016-09-30 12:27:18 +02:00
Sagi Grimberg
15a756b637 net/mlx5: fix possible NULL dereference in Rx path
The user is allowed to call ->rx_pkt_burst() even without free
mbufs in the pool. In this scenario we'll fail allocating a rep mbuf
on the first iteration (where pkt is still NULL). This would cause us
to deref a NULL pkt (reset refcount and free).

Fix this by checking the pkt before freeing it.

Fixes: a1bdb71a32 ("net/mlx5: fix crash in Rx")

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2016-09-30 12:27:18 +02:00
Jeff Guo
8c5cb3c115 net/i40e: add packet type translation for X722
To make the PCTYPE in x722 compatible with original PCTYPE in
flow director (FD) filters, the PCTYPE in the FD programming
descriptor needs to be translated into a different PCTYPE using
GLQF_FD_PCTYPE table.
Translation needs to be done before the FD filter is programmed.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2016-09-30 12:27:18 +02:00
Jeff Guo
1ab43b6160 net/i40e: add new packet types for device X722
There are 6 new PCTYPEs enabled in the device x722.

The 6 new PCTYPEs As below:
* NonF Unicast IPv4, UDP
* NonF Multicast IPv4, UDP
* NonF IPv4, TCP, SYN, no ACK
* NonF Unicast IPv6, UDP
* NonF Multicast IPv6, UDP

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2016-09-30 12:27:18 +02:00
Yong Wang
a6cebea95c net/vmxnet3: enable LRO
This change enables device LRO if requested.

The current implementation of jumbo frame Rx can be used for LRO
directly without changes.

Note that since jumbo frame uses both ring0 and ring1, it cannot
be enabled in UPT (VMDirectPath) mode.

Signed-off-by: Yong Wang <yongwang@vmware.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2016-09-30 12:27:18 +02:00
Yong Wang
89ba919505 net/vmxnet3: update NIC documentation
Signed-off-by: Yong Wang <yongwang@vmware.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2016-09-30 12:27:18 +02:00
Yong Wang
2459504193 net/vmxnet3: update feature doc
Signed-off-by: Yong Wang <yongwang@vmware.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2016-09-30 12:27:18 +02:00
Yong Wang
8618d19b52 net/vmxnet3: reallocate shared memzone on re-config
When adding a DPDK port to ovs-vswitchd with DPDK, the vmxnet3 device
fails to activate due to mismatched magic number.  This failure causes
following operations to run: start the port, stop the port,
reconfigure and re-start the port.

During reconfigure, if there is an existing memzone, driver will reuse
it. But reconfigure may request different number of Tx/Rx queues.
This results in a memzone with wrong size and potential invalid memory
access.

To fix this, free the memzone if found and reserve a new one.

Signed-off-by: Yong Wang <yongwang@vmware.com>
Reviewed-by: Guolin Yang <gyang@vmware.com>
Reviewed-by: Daniele Di Proietto <ddiproietto@vmware.com>
Tested-by: Daniele Di Proietto <ddiproietto@vmware.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2016-09-30 12:27:18 +02:00
Yong Wang
c346551e5e net/vmxnet3: coding style changes
Signed-off-by: Yong Wang <yongwang@vmware.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2016-09-30 12:27:18 +02:00
Yong Wang
e937fb5c6f net/vmxnet3: improve error checks and return values
Signed-off-by: Yong Wang <yongwang@vmware.com>
Reviewed-by: Juho Snellman <jsnell@iki.fi>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2016-09-30 12:27:18 +02:00
Yury Kylulin
158efcdc5e net/i40e: fix mbuf leak during Rx queue release
For the vector PMD, release all mbufs from the Rx queue if no packets
are received after device start.

Fixes: 9ed94e5bb0 ("i40e: add vector Rx")

Signed-off-by: Yury Kylulin <yury.kylulin@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2016-09-30 12:27:18 +02:00
Yury Kylulin
f853230920 net/ixgbe: fix mbuf leak during Rx queue release
For the vector PMD, release all mbufs from the Rx queue if no packets
are received after device start.

Fixes: 11b220c649 ("ixgbe: fix release queue mbufs")

Signed-off-by: Yury Kylulin <yury.kylulin@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Panu Matilainen
dad7734e66 ip_frag: fix missing dependency on hash library
Not sure what exactly changed and where, but I've started getting
build failures on Fedora rawhide i386:
    lib/librte_ip_frag/ip_frag_internal.c:36:23: fatal error:
	    rte_jhash.h: No such file or directory
     #include <rte_jhash.h>
                       ^
Looking at librte_ip_frag, it clearly depends on librte_hash so
its probably more a question of something commonly masking the issue.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2016-10-05 15:47:23 +02:00
Ferruh Yigit
094be9925d kni: remove unnecessary ethtool files
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2016-10-05 15:45:21 +02:00
Ferruh Yigit
7550f1201f kni: remove unused ethtool files
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2016-10-05 15:45:11 +02:00
Maxime Coquelin
a1b87645d3 app/testpmd: reset headroom after txonly packet allocation
This patch fixes txonly raw packets allocations by resetting the
available headroom.

Indeed, some PMDs such as Virtio might prepend some data to the
packet, resulting in mbuf's data_off field to be decremented each
time the mbuf gets re-allocated.

For Virtio PMD, it means that we use only single descriptors for the
first times mbufs get allocated, as at some point there is not
enough headroom to store the header.

Other alternative would be use standard API to allocate the packets,
which does reset the headroom, but the impact on performance is too
big to consider this an option.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2016-10-05 15:17:12 +02:00
Maxime Coquelin
febf2bb46d mbuf: add function to reset headroom
Some application use rte_mbuf_raw_alloc() function to improve
performance by not resetting mbuf's fields to their default state.

This can be however problematic for mbuf consumers that need some
headroom, meaning that data_off field gets decremented after
allocation. When the mbuf is re-used afterwards, there might not
be enough room for the consumer to prepend anything, if the data_off
field is not reset to its default value.

This patch adds a new rte_pktmbuf_reset_headroom() function that
applications can call to reset the data_off field.
This patch also replaces current data_off affectations in the mbuf
lib with a call to this function.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2016-10-05 15:13:37 +02:00
Olivier Matz
4e8739e9bb mbuf: fix error handling on pool creation
On error, the mempool object has to be freed, and rte_errno should be a
positive value.

Fixes: 152ca51790 ("mbuf: use default mempool handler from config")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2016-10-05 14:21:05 +02:00
Byron Marohn
ff15d9c0ba hash: modify lookup bulk pipeline
This patch replaces the pipelined rte_hash lookup mechanism with a
loop-and-jump model, which performs significantly better,
especially for smaller table sizes and smaller table occupancies.

Signed-off-by: Byron Marohn <byron.marohn@intel.com>
Signed-off-by: Saikrishna Edupuganti <saikrishna.edupuganti@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Sameh Gobriel <sameh.gobriel@intel.com>
2016-10-05 12:10:49 +02:00
Byron Marohn
58017c98ed hash: add vectorized comparison
In lookup bulk function, the signatures of all entries
are compared against the signature of the key that is being looked up.
Now that all the signatures are together, they can be compared
with vector instructions (SSE, AVX2), achieving higher lookup performance.

Also, entries per bucket are increased to 8 when using processors
with AVX2, as 256 bits can be compared at once, which is the size of
8x32-bit signatures.

Signed-off-by: Byron Marohn <byron.marohn@intel.com>
Signed-off-by: Saikrishna Edupuganti <saikrishna.edupuganti@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Sameh Gobriel <sameh.gobriel@intel.com>
2016-10-05 12:09:50 +02:00
Byron Marohn
8a9f542f32 hash: reorganize bucket structure
Move current signatures of all entries together in the bucket
and same with all alternative signatures, instead of having
current and alternative signatures together per entry in the bucket.
This will be benefitial in the next commits, where a vectorized
comparison will be performed, achieving better performance.

The alternative signatures have been moved away from
the current signatures, to make the key indices be consecutive
to the current signatures, as these two fields are used by lookup,
so they are in the same cache line.

Signed-off-by: Byron Marohn <byron.marohn@intel.com>
Signed-off-by: Saikrishna Edupuganti <saikrishna.edupuganti@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Sameh Gobriel <sameh.gobriel@intel.com>
2016-10-05 12:08:56 +02:00