Commit Graph

2977 Commits

Author SHA1 Message Date
Harish Patil
49d8b54e86 net/qede: fix default MAC address handling
- In qede_mac_addr_set(), in order to configure default MAC address we
first delete the existing MAC address before trying to add new one. During
init time, there is no MAC filter to begin with, so trying to remove a
non-existing MAC address causes a firmware exception. This can be prevented
by internally calling qede_mac_addr_add() which has the checks in place to
delete a MAC address only if it was added before.

- Remove setting of the default MAC address from within
qede_dev_configure() since rte_eth_dev_start() calls mac_addr_set() anyway.

Fixes: 2ea6f76aff ("qede: add core driver")
Cc: stable@dpdk.org

Signed-off-by: Harish Patil <harish.patil@cavium.com>
2017-04-28 14:46:17 +02:00
Nélio Laranjeiro
870ba73a64 net/mlx5: fix IPv6 flow pattern item
Only masked bits must be set in Verbs specification for a rule to be valid.

Fixes: 2097d0d1e2 ("net/mlx5: support basic flow items and actions")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2017-04-28 14:46:17 +02:00
Jingjing Wu
fe2b27c634 net/i40e: fix array bounds
Fix array bounds when set default ptype mapping.

Fixes: 62e94f7f66 ("net/i40e: configure packet type mapping")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-04-28 14:46:17 +02:00
Beilei Xing
c00f307f85 net/i40e: fix setup when bulk is disabled
Testpmd failed to start when CONFIG_RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC
is disabled, the root cause is the length of sw_ring and queue are
incorrect with the above configuration.

Fixes: 0be2953129 ("net/i40e: fix compile error")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2017-04-28 14:46:17 +02:00
Andrew Rybchenko
edd69f7c21 net/sfc: fix LSC interrupt support for UIO cases
Recently link status change interrupt was enabled by default in testpmd,
it has opened the driver bug with not working LSC interrupt if either
igb_uio or uio_pci_generic kernel driver is used.

Fixes: 06bc197796 ("net/sfc: interrupts support sufficient for event queue init")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-04-28 14:46:17 +02:00
Andrew Rybchenko
b69862719e net/sfc: correct estimation of max DMA descriptors required
Previous too pessimistic estimation made completely impossible to send
packets with many segments (more than 100 with minimum Tx ring size).

Fixes: 8b00f426eb ("net/sfc: implement EF10 native Tx datapath")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
2017-04-28 14:46:17 +02:00
Wei Dai
b826efba6d net/ixgbe: align register setting when RSC is disabled
When Receive Side Coalescing (RSC) is not used, the RSC Disable
(RSC_DIS) filed of register Receive Filter Control Register (RFCTL)
should be set according to ixgbe datasheet.

Signed-off-by: Wei Dai <wei.dai@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-04-28 14:46:17 +02:00
Wei Dai
bfe977683a net/ixgbe/base: update version to 2017.03.29
* Acquire PHY semaphore before device reset
* Add support for 2.5G KX physical layer
* Add MAC X550em/X557 LED on|off support

Signed-off-by: Wei Dai <wei.dai@intel.com>
2017-04-28 14:46:17 +02:00
Wei Dai
999566af0a net/ixgbe/base: support MAC X550em/X557 LED on/off
This patch updates ixgbe_led_[on|off]_t_X550em for MAC or PHY connected
LEDs. To support both MAC or PHY connected LEDs, both MAC and PHY led
control registers are configured.

Signed-off-by: Wei Dai <wei.dai@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
2017-04-28 14:46:17 +02:00
Wei Dai
d53a80024a net/ixgbe/base: support 2.5G KX physical layer
Add another define for the 2.5G KX physical layer. This requires all
variables and support functions that deal with "physical_layer" to be
bumped to u64 as this is the 33rd define.

Signed-off-by: Wei Dai <wei.dai@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
2017-04-28 14:46:17 +02:00
Wei Dai
c70a162ad4 net/ixgbe/base: acquire PHY semaphore before device reset
A recent firmware change fixed an issue to acquire the PHY semaphore
before accessing PHY registers. This led to a case where SW can issue
a device reset clearing the MDIO registers. This patch makes SW acquire
the PHY semaphore before issuing a device reset.

Signed-off-by: Wei Dai <wei.dai@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
2017-04-28 14:46:16 +02:00
Adrien Mazarguil
f48a55f78e crypto/scheduler: fix missing includes
This commit addresses the following compilation errors:

 In file included from build/include/rte_cryptodev_scheduler.h:37:0,
                  from /tmp/check-includes.sh.5355.c:1:
 build/include/rte_cryptodev_scheduler_operations.h:43:30: error: unknown
    type name 'uint8_t' struct rte_cryptodev *dev, uint8_t slave_id);
 [...]

Fixes: 097ab0bac0 ("crypto/scheduler: add API")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2017-05-01 00:13:15 +02:00
Adrien Mazarguil
80fcb5cad4 net/avp: fix exported headers
This commit addresses several errors related to missing includes such as:

 In file included from /tmp/check-includes.sh.15315.c:1:0:
 build/include/rte_avp_fifo.h:77:22: error: 'struct rte_avp_fifo' declared
    inside parameter list [-Werror]
 [...]
 build/include/rte_avp_fifo.h: In function 'avp_fifo_init':
 build/include/rte_avp_fifo.h:81:3: error: implicit declaration of function
    'rte_panic' [-Werror=implicit-function-declaration]
 [...]
 build/include/rte_avp_fifo.h:83:6: error: dereferencing pointer to
    incomplete type
 [...]
 build/include/rte_avp_fifo.h:109:2: error: implicit declaration of
    function 'rte_wmb' [-Werror=implicit-function-declaration]
 [...]
 In file included from /tmp/check-includes.sh.15315.c:1:0:
 build/include/rte_avp_common.h:104:2: error: unknown type name 'uint64_t'
 [...]
 build/include/rte_avp_common.h:386:15: error: 'ETHER_ADDR_LEN' undeclared
    here (not in a function)
 [...]

It addresses errors with strict compilation flags:

 In file included from /tmp/check-includes.sh.15315.c:1:0:
 build/include/rte_avp_common.h:122:3: error: ISO C99 doesn't support
    unnamed structs/unions [-Werror=pedantic]
 [...]
 build/include/rte_avp_common.h:136:17: error: ISO C forbids zero-size
    array 'buffer' [-Werror=pedantic]
 [...]

And also adds C++ awareness to both header files.

Fixes: 8e680655e2 ("net/avp: add public header files")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Allain Legacy <allain.legacy@windriver.com>
2017-05-01 00:13:15 +02:00
Akhil Goyal
45fc6f429b crypto/dpaa2_sec: update license and copyright
license and copyright for hw and mc files are made consistent
as per the other dpaa2 dual licensed files.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
2017-04-25 09:06:54 +02:00
Bruce Richardson
7e015a4794 net/ark: fix build on FreeBSD
On FreeBSD it's not necessary to use -ldl to link apps which use
dlopen. This error only showed up with a shared library gcc build,
not standard build using static libs.

Fixes: 1131cbf0fb ("net/ark: stub PMD for Atomic Rules Arkville")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John Miller <john.miller@atomicrules.com>
2017-04-21 16:19:40 +02:00
Gaetan Rivet
6dd7b7056d net/mlx4: support device removal event
Extend the LSC event handling to support the device removal as well. The
Verbs library will send several related events, that can conflict
with the LSC event itself.

The event handling has thus been made capable of receiving and signaling
several event types at once.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Signed-off-by: Elad Persiko <eladpe@mellanox.com>
2017-04-21 01:01:47 +02:00
Jacek Piasecki
923419333f net/ixgbe: support xstats by ID
To achieve functionality of retrieving only specific statistics
given by application there are two new functions added:
ixgbe_dev_xstats_get_by_ids() which retrieve
values of statistics specified by ids array
and ixgbe_dev_xstats_get_names_by_ids() which retrieve
names of statistics specified by ids array.

Signed-off-by: Jacek Piasecki <jacekx.piasecki@intel.com>
Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-04-20 22:30:26 +02:00
Jacek Piasecki
25e38f09af net/e1000: support xstats by ID
To achieve functionality of retrieving only specific statistics
given by application there are two new functions added:
eth_igb_xstats_get_by_ids() which retrieve
values of statistics specified by ids array
and eth_igb_xstats_get_names_by_ids() which retrieve
names of statistics specified by ids array.

Signed-off-by: Jacek Piasecki <jacekx.piasecki@intel.com>
Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-04-20 22:30:26 +02:00
Akhil Goyal
02f35eee26 crypto/dpaa2_sec: support statistics
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
2017-04-20 11:32:45 +02:00
Akhil Goyal
8d1f3a5d75 crypto/dpaa2_sec: support crypto operation
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-04-20 11:32:45 +02:00
Akhil Goyal
ce8126838b bus/fslmc: add packet frame list entry definitions
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
2017-04-20 11:32:45 +02:00
Akhil Goyal
add2ca14f4 crypto/dpaa2_sec: add sample descriptors
algo.h provides APIs for constructing non-protocol offload SEC
	descriptors like hmac, blkciphers etc.
ipsec.h provides APIs for IPSEC offload descriptors.
common.h is a common helper file which for all descriptors

In future, additional algorithms' descriptors(PDCP etc.) will be
added in the desc/

Signed-off-by: Horia Geanta Neag <horia.geanta@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2017-04-20 11:32:45 +02:00
Akhil Goyal
04711d41a8 crypto/dpaa2_sec: add run-time assembler for descriptor
A set of header files(hw) which helps in making the descriptors
that are understood by NXP's SEC hardware.
This patch provides header files for command words which can be
used for descriptor formation.

Signed-off-by: Horia Geanta Neag <horia.geanta@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2017-04-20 11:32:45 +02:00
Akhil Goyal
e5cbdfc537 crypto/dpaa2_sec: add basic operations
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
2017-04-20 11:32:45 +02:00
Akhil Goyal
802048493f crypto/dpaa2_sec: support mc dpseci object
add support for dpseci object in MC driver.
DPSECI represent a crypto object in DPAA2.

Signed-off-by: Cristian Sovaiala <cristian.sovaiala@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
2017-04-20 11:32:45 +02:00
Akhil Goyal
623326dded crypto/dpaa2_sec: introduce poll mode driver
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
2017-04-20 11:32:45 +02:00
Pablo de Lara
c570f262e8 crypto/scheduler: fix uninitialized capabilities
Capability information is updated as slaves are attached,
but if this information is requested via rte_cryptodev_info_get()
when no slaves have been attached, the structure would not be
initialized, leading to a potential segmentation fault.

Therefore, the structure should be initialized with no
capabilities at device creation.

Fixes: 31439ee72b ("crypto/scheduler: add API implementations")
Cc: stable@dpdk.org

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2017-04-20 11:32:45 +02:00
Fan Zhang
21d0b0433c crypto/scheduler: fix ring dequeue return handling
Commit <ecaed092b677> ("ring: return remaining entry count when
dequeuing") changed the return of rte_ring_sc_dequeue_bulk.
This patch updates the scheduler to comply with this change.

Fixes: 8a48e03943 ("crypto/scheduler: optimize crypto op ordering")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
2017-04-20 11:32:45 +02:00
Pablo de Lara
168b9e76f9 drivers/crypto: do not create unique name internally
Crypto devices of the same type could be initialized
with the same name, since internally this name was suffixed
with an index.

Since commit <dda987315ca2> ("vdev: make virtual bus use its
device struct"), this is not allowed anymore.

Therefore, there is no need to create an unique name
at device initialization.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2017-04-20 11:32:45 +02:00
Pablo de Lara
7e21477118 drivers/crypto: check if name is null
Check if virtual device name is NULL,
to avoid possible segmentation faults.

Fixes: 5d2aa461cb ("vdev: use generic vdev struct for probe and remove")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2017-04-20 11:32:45 +02:00
Arek Kusztal
4ca12b236c crypto/qat: fix IV zero physical address
This commit fixes zero physical address when IV not set

Fixes: 1703e94ac5 ("qat: add driver for QuickAssist devices")
Cc: stable@dpdk.org

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
2017-04-20 11:32:45 +02:00
Arek Kusztal
46c96a9fc9 crypto/qat: fix AES-GCM authentication length
This commit fixes AES-GCM length of authentication input data,
cipher length is used instead

Fixes: 1703e94ac5 ("qat: add driver for QuickAssist devices")
Cc: stable@dpdk.org

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
2017-04-20 11:32:45 +02:00
Fan Zhang
50e14527b9 crypto/scheduler: improve parameters parsing
This patch improves the cryptodev scheduler PMD's commandline
parsing capability. Originally, the scheduler's slave option
requires the slave vdev(s) being declared prior to it. This
patch removes this limitation by storing the slave names
temporarily and attaching them later.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2017-04-20 11:32:45 +02:00
Fan Zhang
dc8bd2f633 crypto/scheduler: fix doxygen comments
This patch adds the missing doxygen comments and updated
inline comments to cryptodev scheduler

Fixes: d58a3f3125 ("crypto/scheduler: add documentation")
Cc: stable@dpdk.org

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2017-04-20 11:32:45 +02:00
Pablo de Lara
f86e63bc73 crypto/qat: fix incomplete capabilities
After the refactoring of the capabilities, AES DOCSIS BPI
algorithm was left out.

Fixes: 6a3c87bc6a ("crypto/qat: refactor capabilities infrastructure")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2017-04-20 11:32:45 +02:00
Fan Zhang
88405476dc crypto/scheduler: fix queue pair configuration
This patch fixes the queue pair configuration for the scheduler PMD.
The queue pairs of a scheduler may have different nb_descriptors sizes,
which was not the case. Also, the maximum available objects in a
queue pair is 1 object smaller than nb_descriptors. This patch fixes
these issues.

Fixes: a783aa6344 ("crypto/scheduler: add packet size based mode")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2017-04-20 11:32:45 +02:00
Fan Zhang
4e30ead5e7 crypto/scheduler: support mode specific option
Some scheduling modes may need extra options to be configured,
this patch adds the function prototype for setting/getting
options.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2017-04-20 11:32:45 +02:00
Fan Zhang
7b46f62b81 crypto/scheduler: fix capability update
Fixes: 31439ee72b ("crypto/scheduler: add API implementations")
Cc: stable@dpdk.org

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
2017-04-20 11:32:45 +02:00
Arek Kusztal
9d0748d2de crypto/qat: fix capabilities for D15xx device
This commit fixes capabilities for Intel(R) QuickAssist
Technology D15xx device

Fixes: 259310f3a9 ("crypto/qat: support device D15xx")

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
2017-04-20 11:32:45 +02:00
Gowrishankar Muthukrishnan
e4701c7a4e net/i40e: fix build on ppc64le
A typo introduced in i40e_rxtx_vec_altivec.c

Fixes: 67f0380766 ("net/i40e: enable per-device packet type mapping")

Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
2017-04-20 10:21:59 +02:00
Bruce Richardson
2e516d18dc event/sw: fix events mis-identified as needing reorder
When taking events from a port, we checked the history list to check if the
event needed to be put back in order i.e. originally came from a reordered
queue type. The check for reordering involved checking if the reorder
buffer entry pointer was null. However, after that pointer was used it was
never cleared to null again.

This caused problems when we had mixed reordered and atomic or parallel
events, as the events from the latter two queue types were misidentified as
needing reordering. This let in some cases to crashes, but mostly led to
dropping events, and then application lock-up.

Fixes: 617995dfc5 ("event/sw: add scheduling logic")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-04-20 00:30:04 +02:00
Harry van Haaren
95a896ab86 event/sw: fix credit return on invalid queue id
This patch returns a credit when an rte_event is
enqueued with an invalid queue_id. Previously a
credit was leaked from the system.

Note that the eventdev instance does not attempt
to free any resources that the rte_event owns. As
a result, resources owned by the rte_event are leaked.
Eg. if the rte_event represents an rte_mbuf, the mbuf
will not be freed, and causes a leak from the mempool.

Fixes: 656af91800 ("event/sw: add worker core functions")

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
2017-04-20 00:26:55 +02:00
Harry van Haaren
7904c82a78 event/sw: fix hashing of flow on ordered ingress
The flow id of packets was not being hashed on ingress
on an ordered queue. Fix by applying same hashing as is
applied in the atomic queue case. The hashing itself is
broken out into a macro to avoid duplication of code.

Fixes: 617995dfc5 ("event/sw: add scheduling logic")

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-04-20 00:24:50 +02:00
Zhiyong Yang
b7be4f461a net/virtio: support to turn on/off traffic flow
Current virtio_dev_stop only disables interrupt and marks link down,
When it is invoked, tx/rx traffic flows still work. This is a strange
behavior. The patch supports the switch of flow.

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
2017-04-19 10:49:06 +02:00
Jianfeng Tan
260aae9ad9 net/virtio-user: fix address on 32-bit system
virtio-user cannot work on 32-bit system as higher 32-bit of the
addr field (64-bit) in the desc is filled with non-zero value
which should not happen for a 32-bit system.

In case of virtio-user, we use buf_addr of mbuf to fill the
virtqueue desc addr. This is a regression bug. For 32-bit system,
the first 4 bytes of mbuf is buf_addr, with following 8 bytes for
buf_phyaddr. With below wrong definition, both buf_addr and lower
4 bytes buf_phyaddr are obtained to fill the virtqueue desc.
  #define VIRTIO_MBUF_ADDR(mb, vq) \
	(*(uint64_t *)((uintptr_t)(mb) + (vq)->offset))

Fixes: 25f80d1087 ("net/virtio: fix packet corruption")
Cc: stable@dpdk.org

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2017-04-19 10:49:06 +02:00
Jianfeng Tan
cc4690e980 net/virtio-user: fix link status
Previously, we miss to set intr_handle->fd which will be used as
target file for epoll to check LSC.

As a result, stdin (0) is used and intr thread keeps busy whenever
data comes from stdin.

To fix this, we use vhostfd as the target file for epoll to check
the link status change events. And we move intr_handle initialization
after vhost backend settup to make sure vhostfd is initialized.

Fixes: 35c4f85548 ("net/virtio-user: support to report net status")

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2017-04-19 10:49:06 +02:00
Yuanhan Liu
aa9f060617 net/virtio: fix link status always being up
The virtio port link status will always be UP, even the port is stopped:

    testpmd> port stop 0
    Stopping ports...
    Checking link statuses...
    Port 0 Link Up - speed 10000 Mbps - full-duplex
    Done

The link status is queried by link_update callback when LSC is disabled.
Which in turn queries the "status" field.  However, the "status" is
read-only. I couldn't think of some proper ways to change the status
without doing device reset.

Instead of doing (the heavy) reset at stop, this patch introduced a flag,
which is set to 1 and 0 on start and stop, respectively. When it's set to
0, the link status is set to DOWN unconditionally.

Fixes: a85786dc81 ("virtio: fix states handling during initialization")
Cc: stable@dpdk.org

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2017-04-19 10:49:06 +02:00
Jianfeng Tan
4bf9e26d29 net/virtio-user: fix net status report
We only enabled LSC when using vhost-user as the backend, but it is
reported even when using vhost-kernel as the backend.

Fix it by only reportting LSC support when using vhost-user as the
backend.

Fixes: 35c4f85548 ("net/virtio-user: support to report net status")

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
2017-04-19 10:49:06 +02:00
Jianfeng Tan
bed3b24c87 net/virtio-user: fix feature negotiation
The feature negotiation in virtio-user is proven to be broken,
which results in device initialization failure.

Originally, we get features from vhost backend, and remove those
that are not supported. But when new feature is added, for example,
VIRTIO_NET_F_MTU, we fail to remove this new feature. Then, this
new feature will be negotiated, as both frontend and backend claim
to support this feature.

To fix it, we add a macro to record supported features, as a filter
to remove newly added features.

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>
2017-04-19 10:49:06 +02:00
Sagar Abhang
912be9daf4 net/vhost: stop dev in close and address mem leak
Move the call to stop the device inside the close routine because close
needs to stop the device if it isn't stopped.

Free the allocated queue buffers in close instead of doing so in remove.
Original code had these clean ups in remove which was causing memory
leak.

Signed-off-by: Sagar Abhang <sabhang@brocade.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2017-04-19 10:49:06 +02:00