summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2016-07-22net/i40e: fix unsafe tailq element removalPablo de Lara
i40e driver was removing elements when iterating tailq lists with TAILQ_FOREACH macro, which is not safe. It is especially visible since the memory is zeroed on free (commit ea0bddbd14e6). Instead, TAILQ_FOREACH_SAFE macro is used when removing/freeing these elements. Fixes: 4861cde46116 ("i40e: new poll mode driver") Fixes: 440499cf5376 ("net/i40e: support floating VEB") Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-07-22net/virtio-user: fix inconsistent nameJianfeng Tan
The commit cb6696d22023 ("drivers: update registration macro usage") changes the name from virtio-user to virtio_user, because hyphen cannot be used in a C symbol name. However, this commit does not update the strings in docs and source code, which could lead to failure to start this device as per the docs. This patch updates related strings in the docs and source code. Fixes: cb6696d22023 ("drivers: update registration macro usage") Reported-by: Tiwei Bie <tiwei.bie@intel.com> Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com> Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-07-22net/fm10k: fix RSS hash configXiao Wang
Sometimes app just wants to update the RSS hash function and no RSS key update is needed, but fm10k pmd will return EINVAL for this case. If the rss_key is NULL, we don't need to check the rss_key_len. Fixes: 57033cdf8fdc ("fm10k: add PF RSS") Reported-by: Xueqin Lin <xueqin.lin@intel.com> Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
2016-07-22net/i40e: fix out-of-bounds writes in vector RxSergey Dyasly
Rx loop inside _recv_raw_pkts_vec() ignores nb_pkts argument and always tries to receive RTE_I40E_VPMD_RX_BURST (32) packets. This is a violation of rte_eth_rx_burst() API and can lead to memory corruption (out-of-bounds writes to struct rte_mbuf **rx_pkts) if nb_pkts is less than 32. Fix this by actually using nb_pkts inside the loop. Fixes: 9ed94e5bb04e ("i40e: add vector Rx") Signed-off-by: Sergey Dyasly <s.dyasly@samsung.com> Acked-by: Ilya Maximets <i.maximets@samsung.com> Acked-by: Adam Bynes <adambynes@outlook.com>
2016-07-22net/i40e: fix speed capabilitiesIdo Barnea
Signed-off-by: Ido Barnea <ibarnea@cisco.com> Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2016-07-22net/ixgbe/base: fix C++ buildIdo Barnea
Signed-off-by: Ido Barnea <ibarnea@cisco.com>
2016-07-22net/enic: heed VLAN strip flagJohn Daley
The configure function enicpmd_dev_configure() was not paying attention to the rxmode VLAN strip bit. Set the VLAN strip mode according to the bit. Fixes: fefed3d1e62c ("enic: new driver") Signed-off-by: John Daley <johndale@cisco.com> Reviewed-by: David Harton <dharton@cisco.com> Tested-by: David Harton <dharton@cisco.com>
2016-07-22net/enic: fix possible Rx corruptionJohn Daley
Initialize the mbuf data offset to RTE_PKTMBUF_HEADROOM as the enic takes ownership of them. If allocated mbufs had some offset other than RTE_PKTMBUF_HEADROOM, the application would read mbuf data starting at the wrong place and misinterpret the packet. Fixes: 856d7ba7ed22 ("net/enic: support scattered Rx") Reviewed-by: Nelson Escobar <neescoba@cisco.com> Signed-off-by: John Daley <johndale@cisco.com>
2016-07-22net/ena: fix icc buildFerruh Yigit
drivers/net/ena/base/ena_com.c(346): error #3656: variable "dev_node" may be used before its value is set ENA_MEM_ALLOC_COHERENT_NODE(ena_dev->dmadev, ^ drivers/net/ena/base/ena_com.c(399): error #3656: variable "prev_node" may be used before its value is set ENA_MEM_ALLOC_COHERENT_NODE(ena_dev->dmadev, ^ Fixes: 3d3edc265fc8 ("net/ena: make coherent memory allocation NUMA-aware") Reported-by: Eoin Breen <eoin.breen@intel.com> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> Acked-by: Jan Medala <jan@semihalf.com>
2016-07-22net/bnx2x: fix mempool name lengthRasesh Mody
This patch fixes following error: EAL: Detected 36 lcore(s) EAL: Probing VFIO support... PMD: bnxt_rte_pmd_init() called for (null) EAL: PCI device 0000:08:00.0 on NUMA socket 0 EAL: probe driver: 14e4:16a1 rte_bnx2x_pmd EAL: PCI device 0000:08:00.1 on NUMA socket 0 EAL: probe driver: 14e4:16a1 rte_bnx2x_pmd Lcore 0: RX port 0 Lcore 1: RX port 1 Initializing port 0... EAL: Error - exiting with code: 1 Cause: Cannot configure device: err=-6, port=0 Fixes: 540a2110 ("bnx2x: driver core") Fixes: 85cf0079 ("mem: avoid memzone/mempool/ring name truncation") Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
2016-07-22net/bnx2x: disable fast path interruptsRasesh Mody
Disable fastpath interrupts and remove unneeded delay in bnx2x_interrupt_action(). This patch fixes and prevents performance degradation (upto 50% drop) for BNX2X PMD. Fixes: 540a2110 ("bnx2x: driver core") Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
2016-07-22net/virtio: fix crash on null dereferenceYuanhan Liu
The rxq/txq for the queue_release callback could be NULL, say when rte_eth_dev_configure() fails that the queue is not setup at all. Do a simple NULL check would fix the crash issue. Fixes: 01ad44fd374f ("net/virtio: split Rx/Tx queue") Reported-by: Olivier Matz <olivier.matz@6wind.com> Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-07-22net/virtio: fix packet corruptionOlivier Matz
The support of virtio-user changed the way the mbuf dma address is retrieved, using a physical address in case of virtio-pci and a virtual address in case of virtio-user. This change introduced some possible memory corruption in packets, replacing: m->buf_physaddr + RTE_PKTMBUF_HEADROOM by: m->buf_physaddr + m->data_off (through a macro) This patch fixes this issue, restoring the original behavior. By the way, it also rework the macros, adding a "VIRTIO_" prefix and API comments. Fixes: f24f8f9fee8a ("net/virtio: allow virtual address to fill vring descriptors") Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Acked-by: Jianfeng Tan <jianfeng.tan@intel.com> Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-07-15net/enic: fix crash on error interruptNelson Escobar
When enic's interrupt handler is called indicating an error, it scans through the receive queues (RQs) on the adapter looking for errors. But since the inclusion of rx scatter, some of the RQs may not be in use, and you shouldn't check them for errors. Fixes: 856d7ba7ed22 ("net/enic: support scattered Rx") Signed-off-by: Nelson Escobar <neescoba@cisco.com> Reviewed-by: John Daley <johndale@cisco.com>
2016-07-15net/enic: fix calculation of truncated packetsNelson Escobar
The calculation of truncated packets didn't take into account packet errors due to the adapter not having buffers, causing both the ipackets, and imissed counts to be wrong if such errors occurred. In order to properly calculate the number of packets truncated, we need to subtract the count of errors due to no buffers. Fixes: c44d9f01adf3 ("net/enic: count truncated packets") Signed-off-by: Nelson Escobar <neescoba@cisco.com>
2016-07-15net/enic: fix queue stop and startJohn Daley
The exported device start and stop functions where not setting the queue states to RTE_ETH_QUEUE_STATE_STARTED and RTE_ETH_QUEUE_STATE_STOPPED. After starting the device, the RTE queue stop function would not call the enic queue stop function since queue was already marked as stopped. Put queue state updates in the lower level queue start/stop functions which are called by both device and queue start/stop functions. Fixes: fefed3d1e62c ("enic: new driver") Reviewed-by: Nelson Escobar <neescoba@cisco.com> Signed-off-by: John Daley <johndale@cisco.com>
2016-07-15net/enic: fix crash when changing number of queuesJohn Daley
The check that all Tx and Rx queues were set up was not adequate when reconfiguring with a different number of queues. Only the number of completion queues (CQs) was being used to make the determination, but the CQ array is shared between the underlying Rx and Tx queues. Check that the internal Rx, Tx and CQs are all set up before completing port configuration. Fixes: fefed3d1e62c ("enic: new driver") Signed-off-by: John Daley <johndale@cisco.com> Reviewed-by: Nelson Escobar <neescoba@cisco.com>
2016-07-15net/enic: increment filter failure counterJohn Daley
One instance of a filter add failure was not incrementing the the fail counter. Fixes: 4c2c7bf41f5a ("net/enic: fix negative array index write") Signed-off-by: John Daley <johndale@cisco.com>
2016-07-15net/enic: decrement Tx mbuf reference count before recyclingJohn Daley
In the burst Tx cleanup function, the reference count in mbufs returned to the pool should to be decremented before they are returned. Decrementing is not done by rte_mempool_put_bulk() so it must be done separately using __rte_pktmbuf_prefree_seg(). Also when returning unsent buffers when the device is stopped use rte_mbuf_free_seg() instead of rte_mempool_put() so that reference counts are properly decremented. Fixes: 36935afbc53c ("net/enic: refactor Tx mbuf recycling") Reviewed-by: Nelson Escobar <neescoba@cisco.com> Signed-off-by: John Daley <johndale@cisco.com>
2016-07-15net/enic: remove internal driver versionJohn Daley
The enic PMD code has diverged from code that was once shared with the enic kernel mode driver for performance reasons. It is confusing and misleading to print the internal version number. Remove it. Fixes: fefed3d1e62c ("enic: new driver") Signed-off-by: John Daley <johndale@cisco.com>
2016-07-15net/mlx5: work around gcc errorOlga Shern
RHEL 7.1's GCC for POWER8 reports the following error in one rte_memcpy() macro call by mlx5: error: array subscript is above array bounds [-Werror=array-bounds] It appears to be a GCC bug which can be worked around by making parentheses more explicit. Signed-off-by: Olga Shern <olgas@mellanox.com> Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2016-07-15net/fm10k: fix FTAG mode with multiple queuesXiao Wang
In multi-queue + FTAG use case, we need to turn tx_ftag_en on for all the Tx queues. Fixes: 7958b1310d5e ("fm10k: enable FTAG based forwarding") Reported-by: Ricky Li <ricky.li@intel.com> Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
2016-07-15net/i40e: revert VLAN filtering fixJingjing Wu
This reverts commit 4761f57d58c6f52543738dbe299f846d62d75895. Introducing VLAN table by adding VLAN adminq command will cause NIC's throughput drop obviously. It's a hardware issue. With this revert, VLAN filtering can only work when promiscuous mode is disabled. Reverts: 4761f57d58c6 ("net/i40e: fix VLAN filtering in promiscuous mode") Reported-by: Jeff Shaw <jeffrey.b.shaw@intel.com> Signed-off-by: Jingjing Wu <jingjing.wu@intel.com> Acked-by : Jing Chen <jing.d.chen@intel.com>
2016-07-15net/virtio-user: fix build with gcc 6Maxime Coquelin
The error is reported using test build script: $ scripts/test-build.sh x86_64-native-linuxapp-gcc ... drivers/net/virtio/virtio_user_ethdev.c:345:2: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation] if (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_PATH) == 1) ^~ Fixes: 404bd6bfe360 ("net/virtio-user: fix return value not checked") Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-07-11net/ena: remove unneeded PCI macroDavid Marchand
I suppose this is a remnant of rte_pci_dev_ids.h, just remove this. Signed-off-by: David Marchand <david.marchand@6wind.com>
2016-07-11net/bnxt: move PCI device ids to the driverDavid Marchand
Moved defines since the driver had no such information. Used RTE_PCI_DEVICE in place of RTE_PCI_DEV_ID_DECL* stuff. Signed-off-by: David Marchand <david.marchand@6wind.com>
2016-07-11net/bnx2x: move PCI device ids to the driverDavid Marchand
Reused defines from the driver and moved broadcom vendor id macro. Used RTE_PCI_DEVICE in place of RTE_PCI_DEV_ID_DECL* stuff. Signed-off-by: David Marchand <david.marchand@6wind.com>
2016-07-11net/enic: move PCI device ids to the driverDavid Marchand
Moved cisco vendor id since the driver had no such information. Used RTE_PCI_DEVICE in place of RTE_PCI_DEV_ID_DECL* stuff. Signed-off-by: David Marchand <david.marchand@6wind.com>
2016-07-11net/vmxnet3: move PCI device ids to the driverDavid Marchand
Moved vmware device ids macro since the driver had no such information. Used RTE_PCI_DEVICE in place of RTE_PCI_DEV_ID_DECL* stuff. Signed-off-by: David Marchand <david.marchand@6wind.com>
2016-07-11net/virtio: move PCI device ids to the driverDavid Marchand
Reused defines from the driver. Used RTE_PCI_DEVICE in place of RTE_PCI_DEV_ID_DECL* stuff. Signed-off-by: David Marchand <david.marchand@6wind.com> Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-07-11net/fm10k: move PCI device ids to the driverDavid Marchand
Reused defines from the driver. Used RTE_PCI_DEVICE in place of RTE_PCI_DEV_ID_DECL* stuff. Signed-off-by: David Marchand <david.marchand@6wind.com>
2016-07-11net/i40e: move PCI device ids to the driverDavid Marchand
Reused defines from the driver. Used RTE_PCI_DEVICE in place of RTE_PCI_DEV_ID_DECL* stuff. Signed-off-by: David Marchand <david.marchand@6wind.com>
2016-07-11net/e1000: move em PCI device ids to the driverDavid Marchand
Reused defines from the driver and added a Intel vendor id macro for use by igb later. Used RTE_PCI_DEVICE in place of RTE_PCI_DEV_ID_DECL* stuff. igb/igbvf is left as is, waiting for kni/ethtool cleanup. Signed-off-by: David Marchand <david.marchand@6wind.com>
2016-07-11net/bonding: fix exported symbol versioningChristian Ehrhardt
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-11net/virtio: fix 32-bit build with gcc 6Ferruh Yigit
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: 863bfb474493 ("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-11net/vhost: fix queue state not reset on destroyRich Lane
Fixes a bug where rte_eth_vhost_get_queue_event would not return enabled queues after a guest application restart. Fixes: ee584e9710b9 ("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-05net/virtio: fix null pointer dereferenceJianfeng Tan
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: 01ad44fd374f ("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-05net/virtio-user: fix string unterminatedJianfeng Tan
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: ce2eabdd43ec ("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-05net/virtio-user: fix resource leaksJianfeng Tan
The return value by rte_kvargs_parse is not free(d), which leads to memory leak. Coverity issue: 127482 Fixes: ce2eabdd43ec ("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-05net/virtio-user: fix string overflowJianfeng Tan
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: 6a84c37e3975 ("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-05net/virtio-user: fix return value not checkedJianfeng Tan
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: ce2eabdd43ec ("net/virtio-user: add virtual device") Fixes: 6a84c37e3975 ("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-04net/virtio-user: fix build on Suse 11Jianfeng Tan
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: 37a7eb2ae816 ("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-08net/ena: fix unneeded doorbell submissionJan Medala
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: 1173fca25af9 ("ena: add polling-mode driver") Signed-off-by: Alexander Matushevsky <matua@amazon.com> Signed-off-by: Jan Medala <jan@semihalf.com>
2016-07-08net/enic: fix removing old MAC address when setting new oneNelson Escobar
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: fefed3d1e62c ("enic: new driver") Signed-off-by: Nelson Escobar <neescoba@cisco.com> Reviewed-by: John Daley <johndale@cisco.com>
2016-07-08net/enic: fix setting MAC address when a port is restartedNelson Escobar
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: fefed3d1e62c ("enic: new driver") Signed-off-by: Nelson Escobar <neescoba@cisco.com> Reviewed-by: John Daley <johndale@cisco.com>
2016-07-08net/bnx2x: add xstatsRasesh Mody
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-08net/qede: add xstatsRasesh Mody
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-08net/mlx5: fix crash in RxNélio Laranjeiro
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: 9964b965ad69 ("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-08net/mlx5: fix packet type and offload flags on RxMaxime Leroy
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: 081f7eae242e ("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-08net/enic: fix resource check failures when bonding devicesNelson Escobar
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: 856d7ba7ed22 ("net/enic: support scattered Rx") Signed-off-by: Nelson Escobar <neescoba@cisco.com>