Commit Graph

1384 Commits

Author SHA1 Message Date
Christian Ehrhardt
2bf4c83555 net/bonding: fix exported symbol versioning
The older versions of rte_eth_bond_8023ad_conf_get and
rte_eth_bond_8023ad_setup were available in the old way since 2.0 - at
least according to the map file.

But versioning in the code was set to 16.04.
That breaks compatibility checks for 2.0 on that library.

For example with the dpdk abi checker:
http://people.canonical.com/~paelzer/compat_report.html

To fix, version the old symbols on the 2.0 version as they were
initially added to the map file.

See http://people.canonical.com/~paelzer/compat_report.html

Fixes: dc40f17a ("net/bonding: allow external state machine in mode 4")

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
2016-07-11 14:56:51 +02:00
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
Rich Lane
f4e4b1f1f8 net/vhost: fix queue state not reset on destroy
Fixes a bug where rte_eth_vhost_get_queue_event would not return enabled
queues after a guest application restart.

Fixes: ee584e9710 ("vhost: add driver on top of the library")

Signed-off-by: Rich Lane <rich.lane@bigswitch.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-07-11 04:57:39 +02:00
Jianfeng Tan
3bd60a27e9 net/virtio: fix null pointer dereference
There is a logic bug in this code, that could lead to null pointer
dereference when cvq is NULL. Fix this problem by changing logic
&& to logic ||.

   >> CID 127480:  Null pointer dereferences  (FORWARD_NULL)
   >> Dereferencing null pointer "cvq".
   	if (!cvq && !cvq->vq) {
            ...
        }

Coverity issue: 127480
Fixes: 01ad44fd37 ("net/virtio: split Rx/Tx queue")

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-07-05 14:14:40 +02:00
Jianfeng Tan
542849c09c net/virtio-user: fix string unterminated
When use strcpy() to copy string with length exceeding the last
parameter of strcpy(), it may lead to the destination string
unterminated.

We replaced strncpy with snprintf to make sure it's NULL terminated.

Coverity issue: 127476
Fixes: ce2eabdd43 ("net/virtio-user: add virtual device")

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-07-05 13:30:25 +02:00
Jianfeng Tan
14f06474b8 net/virtio-user: fix resource leaks
The return value by rte_kvargs_parse is not free(d), which leads
to memory leak.

Coverity issue: 127482
Fixes: ce2eabdd43 ("net/virtio-user: add virtual device")

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-07-05 13:30:24 +02:00
Jianfeng Tan
80ceb374e2 net/virtio-user: fix string overflow
When parsing /proc/self/maps to get hugepage information, the string
was being copied with strcpy(), which could, theoretically but in fact
not possiblly, overflow the destination buffer. Anyway, to avoid the
false alarm, we replaced strncpy with snprintf for safely copying the
strings.

Coverity issue: 127484
Fixes: 6a84c37e39 ("net/virtio-user: add vhost-user adapter layer")

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-07-05 13:30:24 +02:00
Jianfeng Tan
404bd6bfe3 net/virtio-user: fix return value not checked
When return values of function calls are not checked, Coverity will
report errors like:

    if (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_PATH) == 1)
    >>>     CID 127477:    (CHECKED_RETURN)
    >>>     Calling "rte_kvargs_process" without checking return value
            (as is done elsewhere 25 out of 30 times).
         		rte_kvargs_process(kvlist, VIRTIO_USER_ARG_PATH,
         				   &get_string_arg, &path);

Coverity issue: 127477, 127478
Fixes: ce2eabdd43 ("net/virtio-user: add virtual device")
Fixes: 6a84c37e39 ("net/virtio-user: add vhost-user adapter layer")

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-07-05 13:30:00 +02:00
Jianfeng Tan
17450351ff net/virtio-user: fix build on Suse 11
On some older systems, such as SUSE 11, the compiling error shows
as:
   .../dpdk/drivers/net/virtio/virtio_user/virtio_user_dev.c:67:22:
         error: ‘O_CLOEXEC’ undeclared (first use in this function)

The fix is to use EFD_CLOEXEC, which is defined in sys/eventfd.h,
instead of O_CLOEXEC which needs _GNU_SOURCE defined on some old
systems.

Fixes: 37a7eb2ae8 ("net/virtio-user: add device emulation layer")

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-07-04 04:08:41 +02:00
Jan Medala
5e02e19eb1 net/ena: fix unneeded doorbell submission
Avoid submitting doorbell when:
* no packets have been submitted to TX
* no free resources have been submitted while RX

Sending doorbell without actual work to be performed by device
violates ENA specification and can lead to unpredictable behavior.

Fixes: 1173fca25a ("ena: add polling-mode driver")

Signed-off-by: Alexander Matushevsky <matua@amazon.com>
Signed-off-by: Jan Medala <jan@semihalf.com>
2016-07-08 23:03:59 +02:00
Nelson Escobar
620b173ae0 net/enic: fix removing old MAC address when setting new one
enic_set_mac_address() meant to remove the old MAC address before
setting the new one, but accidentally tried removing the new MAC
address before setting the new MAC address.

Fixes: fefed3d1e6 ("enic: new driver")

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2016-07-08 22:59:52 +02:00
Nelson Escobar
e5b60cf119 net/enic: fix setting MAC address when a port is restarted
enic_disable() removed the MAC address when a port was shut down but
enic_enable() didn't add the MAC address back when the port was
started again. Move where we set the MAC address for the adapter from
enic_setup_finish() to a enic_enable() so that port restarting works
properly.

Fixes: fefed3d1e6 ("enic: new driver")

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2016-07-08 22:59:08 +02:00
Rasesh Mody
0392743c3f net/bnx2x: add xstats
This patch adds support for extended statistics for BNX2X PMD.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2016-07-08 22:56:38 +02:00
Rasesh Mody
d1216e2229 net/qede: add xstats
This patch adds support for extended statistics for QEDE PMD.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2016-07-08 22:55:19 +02:00
Nélio Laranjeiro
a1bdb71a32 net/mlx5: fix crash in Rx
Fixed issue could occur when Mbuf starvation happens in a middle of
reception of a segmented packet. In such a situation, the PMD has to
release all segments of that packet.  The end condition was wrong
causing it to free an Mbuf still handled by the NIC.

Fixes: 9964b965ad ("net/mlx5: re-add Rx scatter support")

Reported-by: Yongseok Koh <yskoh@mellanox.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2016-07-08 22:51:10 +02:00
Maxime Leroy
0ac6484625 net/mlx5: fix packet type and offload flags on Rx
In mlx5 rx function, the packet_type and ol_flags mbuf fields are not
properly initialized when no rx offload feature is enabled (checksum, l2
tun checksum, vlan_strip, crc). Thus, these fields can have a value
different of 0 depending on their value when the mbuf was freed.

This can result in an incorrect application behavior if invalid
ol_flags/ptype are set, or memory corruptions if IND_ATTACHED_MBUF is
set in ol_flags.

Fixes: 081f7eae24 ("mlx5: process offload flags only when requested")

Signed-off-by: Maxime Leroy <maxime.leroy@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2016-07-08 22:51:03 +02:00
Nelson Escobar
ce93d3c36d net/enic: fix resource check failures when bonding devices
The enic PMD was using the same variables in the enic structure to
track two different things.  Initially rq_count, wq_count, cq_count,
and intr_count were set to the values obtained from the VIC adapters
as the maximum resources allocated on the VIC, then in
enic_set_vnic_res(), they were set to the counts of resources actually
used, discarding the initial values. The checks in enic_set_vnic_res()
were technically incorrect if it is called more than once on a port,
which happens when using bonding, but were harmless in practice as the
checks couldn't fail on the second call.

The enic rx-scatter patch misunderstood the subtleties of
enic_set_vnic_res(), and naively added a multiply by two to the
rq_count check. This resulted in the rq_count check failing when
enic_set_vnic_res() was called a second time, ie when using bonding.

This patch adds new variables to the enic structure to track the
maximum resources the VIC is configured to provide so that the
information isn't later lost and calls to enic_set_vnic_res() do
the expected thing.

Fixes: 856d7ba7ed ("net/enic: support scattered Rx")

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
2016-07-08 22:51:03 +02:00
Beilei Xing
73f9509e0e net/i40e: fix out-of-bounds access
When calling i40e_flowtype_to_pctype in i40e_get_hash_filter_global_config
and i40e_set_hash_filter_global_config, function i40e_flowtype_to_pctype
will be possibly make an out-of-bounds access, because size of the array
is 15. So check the flow type is valid before calling
i40e_flowtype_to_pctype.
In the process fix other occurances of the same problem

Coverity issue: 37793, 37794
Fixes: 782c8c92f1 ("i40e: add hash configuration")
Fixes: f2b2e2354b ("i40e: split function for hash and flow director input")
Fixes: 98f0557076 ("i40e: configure input fields for RSS or flow director")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2016-07-08 22:50:59 +02:00
Beilei Xing
b282ea2ada net/i40e: fix dereference before null check
Null-checking vsi suggests that it may be null, but it
has been dereferenced before null-checking. So move the
check to before the assignment statement using the pointer.

Coverity issue: 119265, 119266
Fixes: d0a349409b ("i40e: support AQ based RSS config")
Fixes: 647d1eaf75 ("i40evf: support AQ based RSS config")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2016-07-08 22:50:53 +02:00
Beilei Xing
3a70ade568 net/i40e: fix log error
The condition, "(pf->flags | I40E_FLAG_VMDQ)" will always be true,
regardless of the value of the flags operand, because I40E_FLAG_VMDQ
is 4ULL - meaning at least one bit will always be set in the result.
That will cause log error when VMDq is disabled.
Since the original intent behind the condition is to check if VMDq
is enabled, fix the code by changing "|" to "&".

Coverity issue: 13219, 13221
Fixes: 4805ed59e9 ("i40e: enhance mac address operations")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2016-07-08 22:50:46 +02:00
Ajit Khaparde
0bd7e8d5dc net/bnxt: fix broadcast/multicast Rx
Currently we are wrongly setting HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_MCAST
flag in bnxt_hwrm_cfa_l2_set_rx_mask() which is preventing promiscuous
and multicast promiscuous settings from working correctly.
This patch fixes it.

Fixes: 244bc98b0d ("net/bnxt: set L2 Rx mask")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2016-07-08 22:50:41 +02:00
Jan Medala
0e72dbf2d3 net/ena: fix freeing memory using correct API
Memory zones should be freed using the proper memzone_free function not
rte_free which is for malloc calls.
After allocating memzone it's required to zeroize memory in it, so do so
before storing the handle for later freeing.

Fixes: 9ba7981ec9 ("ena: add communication layer for DPDK")

Signed-off-by: Alexander Matushevsky <matua@amazon.com>
Signed-off-by: Jakub Palider <jpa@semihalf.com>
Signed-off-by: Jan Medala <jan@semihalf.com>
2016-07-08 15:23:01 +02:00
Jan Medala
3d3edc265f net/ena: make coherent memory allocation NUMA-aware
While allocating (coherent) memory, get information about calling node Id
and pass that as parameter when reserving a memzone.

Signed-off-by: Alexander Matushevsky <matua@amazon.com>
Signed-off-by: Jakub Palider <jpa@semihalf.com>
Signed-off-by: Jan Medala <jan@semihalf.com>
2016-07-08 15:19:40 +02:00
Jan Medala
c414455701 net/ena: disable readless communication when no HW support
Depending on HW revision readless communcation between host and device
may be unavailable. In that case prevent PMD from setting up readless
communication mechanism.

"readless" refers to ability to read ENA registers without actually
issuing read request from host (x86). Instead, host programs 2 registers
on the device that triggers a DMA from device to host and reports a
register value. However, this functionality is not going to be available
in all types of devices. The decision if this mode is supported or not,
is taken from revision_id in pci configuration space.

Signed-off-by: Alexander Matushevsky <matua@amazon.com>
Signed-off-by: Jakub Palider <jpa@semihalf.com>
Signed-off-by: Jan Medala <jan@semihalf.com>
2016-07-08 15:19:40 +02:00
Jan Medala
372c1af5ed net/ena: add dedicated memory area for extra device info
Increase maintenance and debug potentiality with dedicated areas of memory
where additional information can be stored by the ENA device.

Signed-off-by: Alexander Matushevsky <matua@amazon.com>
Signed-off-by: Jakub Palider <jpa@semihalf.com>
Signed-off-by: Jan Medala <jan@semihalf.com>
2016-07-08 15:19:40 +02:00
Jan Medala
6dcee7cde8 net/ena: update ENA comms layer for latest FW
Synchronize ENA communication layer with latest ENA FW version.

Signed-off-by: Alexander Matushevsky <matua@amazon.com>
Signed-off-by: Jakub Palider <jpa@semihalf.com>
Signed-off-by: Jan Medala <jan@semihalf.com>
2016-07-08 15:19:25 +02:00
John Daley
04f976899f net/enic: fix Rx queue init after restarting a device
If you stop, then start a port that had already received some packets,
the NIC could fetch discriptors from the wrong location. This could
effectivly reduce the size of the Rx queue by a random amount and
cause packet drop or reduced performance.

Reset the NIC fetch index to 0 when allocating and posting mbuf
addresses to the NIC.

Fixes: 947d860c82 ("enic: improve Rx performance")

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Nelson Escobar <neescoba@cisco.com>
2016-07-05 15:39:08 +02:00
Nelson Escobar
a3d5f0c92a net/enic: fix Tx crash after restart
If you stop then start a port that had already sent some packets,
there was a segfault due to not resetting the number of completed
sends to zero.

Fixes: a3b1e9551c ("net/enic: streamline mbuf handling in Tx path")

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2016-07-05 15:36:23 +02:00
Fengtian Guo
b12a4c911a net/mlx4: add link up/down callback functions
Implement dev_set_link_up and dev_set_link_down device
operations. Code is inspired by mlx5 implementations.

Signed-off-by: Fengtian Guo <fengtian.guo@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2016-07-05 12:53:50 +02:00
Olivier Matz
3d04e05055 net/mlx5: fix API comment of link set function
Fixes: 62072098b5 ("mlx5: support setting link up or down")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2016-07-05 11:55:47 +02:00
Olivier Matz
33242e3e46 net/mlx: fix setting interface flags
According to the documentation, the function
priv_set_flags(priv, keep, flags) should not modify the flags
in "keep" mask.

So 'flags' argument should be masked with '~keep' before ORing
it with the previous flags value.

This avoids messing up the kernel interface flags when calling
priv_set_flags(priv, ~IFF_UP, ~IFF_UP) in priv_set_link():

  $ ip link
  26: eth0: BROADCAST,MULTICAST,NOARP,ALLMULTI,PROMISC,DEBUG,\
      DYNAMIC,AUTOMEDIA,PORTSEL,NOTRAILERS

Fixes: 7fae69eeff ("mlx4: new poll mode driver")
Fixes: 771fa900b7 ("mlx5: introduce new driver for Mellanox ConnectX-4 adapters")

Reported-by: Fengtian Guo <fengtian.guo@6wind.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2016-07-05 11:51:10 +02:00
Xiao Wang
af15ee640d net/fm10k: fix Rx descriptor read timing
We find that when traffic is light, a small number of packets will have
wrong metadata (e.g. packet type), however this issue will not happen
when traffic is heavy.

The root cause is some fields in fm10k_rx_desc are read at the wrong time,
since the descriptor (being 16-bytes big) is not read as a single atomic
operation. When the input speed is slower than software's capability,
fm10k scalar Rx function accesses descriptors at about the same time
as HW writes them, so the scenario can occur: some fields like pkt_info
in fm10k_rx_desc are read before HW writeback but some fields like DD bit
are read after HW writeback, this will lead to the later packet parsing
function using incorrect value.

This patch fixes this issue by reading and parsing Rx descriptor only after
first checking that the DD bit is set.

Fixes: 4b61d3bfa9 ("fm10k: add receive and tranmit")
Fixes: c82dd0a7bf ("fm10k: add scatter receive")

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2016-07-05 11:43:49 +02:00
Kamil Rytarowski
d1d861efef net/thunderx: fix memory alloc issue when changing ring size
Allocate maximum supported hardware ring hardware descriptors
memory on the first rte_eth_dma_zone_reserve call in order to
get sufficient hardware ring buffer space on subsequent queue
setup request with different queue size.

Fixes: aa0d976e50 ("net/thunderx: add Rx queue setup and release")
Fixes: 3f3c6f9724 ("net/thunderx: add Tx queue setup and release")
Fixes: 7413feee66 ("net/thunderx: add device start/stop and close")

Signed-off-by: Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>
Signed-off-by: Zyta Szpak <zyta.szpak@semihalf.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2016-07-05 11:20:52 +02:00
Olivier Matz
ba9eebbb60 net/ixgbe: fix build whith offload flags disabled
The ixgbe driver does not compile if CONFIG_RTE_IXGBE_RX_OLFLAGS_ENABLE=n
because the macro has not the proper number of parameters. To reproduce
the issue:

  make config T=x86_64-native-linuxapp-gcc
  sed -i 's,\(IXGBE_RX_OLFLAGS_ENABLE\)=y,\1=n,' build/.config
  make -j4
  [...]
   ixgbe_rxtx_vec_sse.c: In function ‘_recv_raw_pkts_vec’:
   ixgbe_rxtx_vec_sse.c:345:53: error:
     macro "desc_to_olflags_v" passed 3 arguments, but takes just 2
      desc_to_olflags_v(descs, vlan_flags, &rx_pkts[pos]);
                                                        ^
   ixgbe_rxtx_vec_sse.c:345:3: error:
     ‘desc_to_olflags_v’ undeclared (first use in this function)
      desc_to_olflags_v(descs, vlan_flags, &rx_pkts[pos]);
      ^
   ixgbe_rxtx_vec_sse.c:231:10: error:
     variable ‘vlan_flags’ set but not used
     uint8_t vlan_flags;
             ^

This patch fixes the number of arguments in the macro, and ensures that
vlan_flags is marked as used to avoid the third error.

Fixes: b37b528d95 ("mbuf: add new Rx flags for stripped VLAN")

Reported-by: Amin Tootoonchian <amint@icsi.berkeley.edu>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-07-05 10:59:28 +02:00
Jingjing Wu
4761f57d58 net/i40e: fix VLAN filtering in promiscuous mode
For VLAN filtering, the VLAN table should be enabled.
But the VLAN table is disabled by default until a rule is added.
In promiscuous mode no rule is added to enable the VLAN table.

This patch clears promiscuous VLAN flag on VSI, and adds a
rule to enable the VLAN table to fix VLAN filtering in promiscuous
mode.

Fixes: 4861cde461 ("i40e: new poll mode driver")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2016-07-04 15:44:17 +02:00
Charles (Chas) Williams
df3e6f7ac7 net/bnx2x: fix incorrect number of supported queues
We need sc->igu_sb_cnt determined before calculating the number of queues
we can support, so move the call to bnx2x_init_rte() to later in the code.

Fixes: 3754101cd7 ("net/bnx2x: fix MSIX vector and VF resource counts")

Signed-off-by: Charles (Chas) Williams <ciwillia@brocade.com>
Acked-by: Rasesh Mody <rasesh.mody@qlogic.com>
2016-07-04 15:30:23 +02:00
Charles (Chas) Williams
fe63783466 net/bnx2x: set random MAC address if none assigned
If the PF hasn't assigned an address, assign one randomly.  While here,
convert to use DPDK's ether address utility routines.

Fixes: 540a211084 ("bnx2x: driver core")

Signed-off-by: Charles (Chas) Williams <ciwillia@brocade.com>
Acked-by: Rasesh Mody <rasesh.mody@qlogic.com>
2016-07-04 15:19:55 +02:00
Thomas Monjalon
3553444a44 net/bnx2x: remove unneeded dependency on hash library
Fixes: 9fb557035d ("bnx2x: enable PMD build")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Rasesh Mody <rasesh.mody@qlogic.com>
2016-07-10 16:23:09 +02:00
Thomas Monjalon
83d83cb62b net/enic: remove useless assert macro
The macro ENIC_ASSERT does the same thing as RTE_ASSERT,
thus it can be removed.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: John Daley <johndale@cisco.com>
2016-07-10 16:19:56 +02:00
Zyta Szpak
001a1c0f98 ethdev: get registers width
The ethtool app was allocating too little space for 64-bit
registers which resulted in memory corruption.

Removes hard-coded assumption that device registers
are always 32 bits wide. The rte_eth_dev_get_reg_length
and rte_eth_dev_get_reg_info callbacks did not
provide register size to the app in any way while is
needed to allocate correct number of bytes before
retrieving registers using rte_eth_dev_get_reg.

This commit changes rte_eth_dev_get_reg_info so that
it can be used to retrieve both the number of registers
and their width, and removes the now-redundant
rte_eth_dev_get_reg_length.

Signed-off-by: Zyta Szpak <zyta.szpak@semihalf.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2016-07-10 14:55:42 +02:00
Deepak Kumar Jain
37e60917c0 crypto/qat: fix digest verification
This fixes the cases in which operation was Digest verify.

Fixes: e25200fbb4 ("qat: add cipher/auth only")

Signed-off-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
2016-07-10 14:51:09 +02:00
Pablo de Lara
ebee5594a3 crypto/kasumi: restrict cipher bit-level operations
KASUMI PMD only supports bit-level cipher operations
when destination buffer is different from the source
(out of place operations). This commit adds a check
in the code to prevent the user from trying to perform
in-place bit-level ciphering.

Fixes: 2773c86d06 ("crypto/kasumi: add driver for KASUMI library")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-07-10 14:51:09 +02:00
Pablo de Lara
372201e207 crypto/kasumi: fix AAD size of F9 function
Additional authenticated data (AAD) in KASUMI F9 (UIA1) is 8 bytes
and not 9 bytes, since direction bit is obtained just after the
end of the message, and it is separated from the AAD.

Fixes: 2773c86d06 ("crypto/kasumi: add driver for KASUMI library")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-07-10 14:51:09 +02:00
Pablo de Lara
419f2add3b net/bonding: fix range of mode parameter
The range of the supported bonding modes is 0-6, instead of 0-4.

Fixes: cb6696d220 ("drivers: update registration macro usage")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2016-07-10 14:51:09 +02:00
Pablo de Lara
44e32a671d drivers: add virtio and xenvirt parameters infos
Virtio and Xenvirt are two virtual device drivers that admit
arguments, so DRIVER_REGISTER_PARAM_STRING should be used
in them.

Fixes: cb6696d220 ("drivers: update registration macro usage")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2016-07-10 14:51:09 +02:00
Pablo de Lara
65eca099f4 drivers: split parameters infos in multiple lines
Driver arguments shown with DRIVER_REGISTER_PARAM_STRING
have been separated in multiple lines and indented to
ease their readability.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2016-07-10 14:51:09 +02:00
Pablo de Lara
bae696ebd4 drivers: remove static driver names
Since now the PMD_REGISTER_DRIVER macro sets the driver names,
there is no need to have the rte_driver structure setting it
statically, as it will get overridden.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2016-07-10 14:51:09 +02:00
Pablo de Lara
1586ff4cef drivers: revert vdev driver names to original
In order to avoid API breakage, the driver names of the virtual devices
have been renamed to their original name, before the modification
of the PMD_REGISTER_DRIVER macro, which sets now the driver names.

Fixes: cb6696d220 ("drivers: update registration macro usage")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2016-07-10 14:51:09 +02:00
Pablo de Lara
cdfb776ba2 crypto: normalize driver names with macros
Recently reported, the introduction of pmd information exports led to a
breakage of cryptodev unit tests because the test infrastructure relies on the
cryptodev names being available in macros.  This patch fixes the pmd naming to
use the macro names.  Note that the macro names were already pre-stringified,
which won't work as the PMD_REGISTER_DRIVER macro requires the name in both a
processing token and stringified form.  As such the names are defined now as
tokens, and converted where needed to stringified form on demand using RTE_STR.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-07-08 19:20:26 +02:00
Thomas Monjalon
a1ec4f91ab mk: fix build dependency of drivers on pmdinfogen
When compiling the drivers, some code is generated with pmdinfogen.
A fresh parallel build can fail if a driver is compiled before pmdinfogen:
	build/buildtools/dpdk-pmdinfogen: Permission denied

There was a dependency declared in drivers/Makefile but it cannot work
because this file is based on mk/rte.subdir.mk which do not handle
dependencies.

It is fixed by declaring the whole buildtools as (order only) prerequisite
of drivers.

Fixes: cb6696d220 ("drivers: update registration macro usage")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2016-07-08 12:04:02 +02:00