summaryrefslogtreecommitdiff
path: root/drivers/net/netvsc/hn_ethdev.c
AgeCommit message (Collapse)Author
2019-11-20drivers/net: fix RSS hash offload flag if no RSSAndrew Rybchenko
By default RSS hash delivery (offload) is bound to RSS mode and it is incorrect to advertise it as enabled if Rx multi-queue mode has no RSS. Fixes: 8b945a7f7dcb ("drivers/net: update Rx RSS hash offload capabilities") Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-11-11drivers/net: update Rx RSS hash offload capabilitiesPavan Nikhilesh
Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash delivery. Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com> Acked-by: Jerin Jacob <jerinj@marvell.com> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-10-07ethdev: change allmulticast callbacks to return statusIvan Ilchenko
Enabling/disabling of allmulticast mode is not always successful and it should be taken into account to be able to handle it properly. When correct return status is unclear from driver code, -EAGAIN is used. Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Acked-by: Hyong Youb Kim <hyonkim@cisco.com>
2019-10-07ethdev: change owner delete function to return intIgor Romanov
Change rte_eth_dev_owner_delete() return value from void to int and return negative errno values in case of error conditions. Right now there is only one error case for rte_eth_dev_owner_delete() - invalid owner, but it still makes sense to return error to catch bugs in the code which uses the function. Also update the usage of the function in drivers/netvsc according to the new return type. Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-10-07ethdev: make stats and xstats reset callbacks return intIgor Romanov
Change return value of the callbacks from void to int. Make implementations across all drivers return negative errno values in case of error conditions. Both callbacks are updated together because a large number of drivers assign the same function to both callbacks. Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-10-07ethdev: change promiscuous callbacks to return statusAndrew Rybchenko
Enabling/disabling of promiscuous mode is not always successful and it should be taken into account to be able to handle it properly. When correct return status is unclear from driver code, -EAGAIN is used. Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Acked-by: Matan Azrad <matan@mellanox.com> Acked-by: Hyong Youb Kim <hyonkim@cisco.com>
2019-10-07ethdev: change device info get callback to return intIvan Ilchenko
Change eth_dev_infos_get_t return value from void to int. Make eth_dev_infos_get_t implementations across all drivers to return negative errno values if case of error conditions. Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-28net/netvsc: fix xstats for VF deviceStephen Hemminger
The id values for VF stats were not being offset correctly. And getting xstats for VF device only worked if VF device supported it; it did not support the generic stats. Fixes: dc7680e8597c ("net/netvsc: support integrated VF") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2019-06-28net/netvsc: fix xstats idMohsin Mazhar Shaikh
The xstats_get was not setting id correctly for each entry. Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device") Cc: stable@dpdk.org Signed-off-by: Mohsin Mazhar Shaikh <mohsinmazhar_shaikh@trendmicro.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2019-06-28net/netvsc: support configuring RSS parametersStephen Hemminger
Add RSS hash key and reta update and query functions. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
2019-06-28net/netvsc: fix RSS offload settingsStephen Hemminger
Use the result from querying host to show the RSS info. Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
2019-06-20net/netvsc: initialize VF spinlockStephen Hemminger
The VF spinlock was never initialized. It works because it is in zmalloc'd memory and an unlocked lock on x86 is 0. But for good practice, all spinlock's should be initialized. Fixes: dc7680e8597c ("net/netvsc: support integrated VF") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
2019-05-24net: add rte prefix to ether definesOlivier Matz
Add 'RTE_' prefix to defines: - rename ETHER_ADDR_LEN as RTE_ETHER_ADDR_LEN. - rename ETHER_TYPE_LEN as RTE_ETHER_TYPE_LEN. - rename ETHER_CRC_LEN as RTE_ETHER_CRC_LEN. - rename ETHER_HDR_LEN as RTE_ETHER_HDR_LEN. - rename ETHER_MIN_LEN as RTE_ETHER_MIN_LEN. - rename ETHER_MAX_LEN as RTE_ETHER_MAX_LEN. - rename ETHER_MTU as RTE_ETHER_MTU. - rename ETHER_MAX_VLAN_FRAME_LEN as RTE_ETHER_MAX_VLAN_FRAME_LEN. - rename ETHER_MAX_VLAN_ID as RTE_ETHER_MAX_VLAN_ID. - rename ETHER_MAX_JUMBO_FRAME_LEN as RTE_ETHER_MAX_JUMBO_FRAME_LEN. - rename ETHER_MIN_MTU as RTE_ETHER_MIN_MTU. - rename ETHER_LOCAL_ADMIN_ADDR as RTE_ETHER_LOCAL_ADMIN_ADDR. - rename ETHER_GROUP_ADDR as RTE_ETHER_GROUP_ADDR. - rename ETHER_TYPE_IPv4 as RTE_ETHER_TYPE_IPv4. - rename ETHER_TYPE_IPv6 as RTE_ETHER_TYPE_IPv6. - rename ETHER_TYPE_ARP as RTE_ETHER_TYPE_ARP. - rename ETHER_TYPE_VLAN as RTE_ETHER_TYPE_VLAN. - rename ETHER_TYPE_RARP as RTE_ETHER_TYPE_RARP. - rename ETHER_TYPE_QINQ as RTE_ETHER_TYPE_QINQ. - rename ETHER_TYPE_ETAG as RTE_ETHER_TYPE_ETAG. - rename ETHER_TYPE_1588 as RTE_ETHER_TYPE_1588. - rename ETHER_TYPE_SLOW as RTE_ETHER_TYPE_SLOW. - rename ETHER_TYPE_TEB as RTE_ETHER_TYPE_TEB. - rename ETHER_TYPE_LLDP as RTE_ETHER_TYPE_LLDP. - rename ETHER_TYPE_MPLS as RTE_ETHER_TYPE_MPLS. - rename ETHER_TYPE_MPLSM as RTE_ETHER_TYPE_MPLSM. - rename ETHER_VXLAN_HLEN as RTE_ETHER_VXLAN_HLEN. - rename ETHER_ADDR_FMT_SIZE as RTE_ETHER_ADDR_FMT_SIZE. - rename VXLAN_GPE_TYPE_IPV4 as RTE_VXLAN_GPE_TYPE_IPV4. - rename VXLAN_GPE_TYPE_IPV6 as RTE_VXLAN_GPE_TYPE_IPV6. - rename VXLAN_GPE_TYPE_ETH as RTE_VXLAN_GPE_TYPE_ETH. - rename VXLAN_GPE_TYPE_NSH as RTE_VXLAN_GPE_TYPE_NSH. - rename VXLAN_GPE_TYPE_MPLS as RTE_VXLAN_GPE_TYPE_MPLS. - rename VXLAN_GPE_TYPE_GBP as RTE_VXLAN_GPE_TYPE_GBP. - rename VXLAN_GPE_TYPE_VBNG as RTE_VXLAN_GPE_TYPE_VBNG. - rename ETHER_VXLAN_GPE_HLEN as RTE_ETHER_VXLAN_GPE_HLEN. Do not update the command line library to avoid adding a dependency to librte_net. Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24net: add rte prefix to ether structuresOlivier Matz
Add 'rte_' prefix to structures: - rename struct ether_addr as struct rte_ether_addr. - rename struct ether_hdr as struct rte_ether_hdr. - rename struct vlan_hdr as struct rte_vlan_hdr. - rename struct vxlan_hdr as struct rte_vxlan_hdr. - rename struct vxlan_gpe_hdr as struct rte_vxlan_gpe_hdr. Do not update the command line library to avoid adding a dependency to librte_net. Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-03net/netvsc: free all queues on closeStephen Hemminger
When dev_close is called, the netvsc driver will clean up all queues including the primary ring buffer. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
2019-03-29net/netvsc: fix VF support with secondary processStephen Hemminger
The VF device management in netvsc was using a pointer to the rte_eth_devices. But the actual rte_eth_devices array is likely to be place in the secondary process; which causes a crash. The solution is to record the port of the VF (instead of a pointer) and find the device in the per process array as needed. Fixes: dc7680e8597c ("net/netvsc: support integrated VF") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
2018-12-21net/netvsc: fix probe when VF not foundStephen Hemminger
It is possible that the VF device exists but DPDK doesn't know about it. This could happen if device was blacklisted or more likely the necessary device (Mellanox) was not part of the DPDK configuration. In either case, the right thing to do is just keep working but only with the slower para-virtual device. Fixes: dc7680e8597c ("net/netvsc: support integrated VF") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
2018-12-21net/netvsc: fix transmit descriptor pool cleanupStephen Hemminger
On device close or startup errors, the transmit descriptor pool was being left behind. Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
2018-12-21net/netvsc: support receive without VLAN stripStephen Hemminger
In some cases, VLAN stripping is not desireable. If necessary re-insert stripped VLAN tag. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
2018-12-19net/netvsc: disable multi-queue on older serversStephen Hemminger
NDIS multi-queue support is only in WS2012 or later. Check the NDIS version to limit to single queue on older versions. Similar code exists in Linux driver. Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
2018-11-01drivers: remove useless constructor headersThomas Monjalon
A constructor is usually declared with RTE_INIT* macros. As it is a static function, no need to declare before its definition. The macro is used directly in the function definition. Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2018-10-26ethdev: free all common data when releasing portThomas Monjalon
This is a clean-up of common ethdev data freeing. All data freeing are moved to rte_eth_dev_release_port() and done only in case of primary process. It is probably fixing some memory leaks for PMDs which were not freeing all data. Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-11net/netvsc: check return from kvargs processStephen Hemminger
Should check return value from processing latency value. Coverity issue: 322104 Fixes: a25d39a3eb69 ("net/netvsc: allow tuning latency with devargs") Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
2018-10-11net/netvsc: support multicast/promiscuous settings on VFStephen Hemminger
Provide API's to enable allmulticast and promiscuous in Netvsc PMD with VF. This keeps the VF and PV path in sync. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
2018-09-14net/netvsc: support integrated VFStephen Hemminger
Integrate accelerated networking support into netvsc PMD. This allows netvsc to manage VF without using failsafe or vdev_netvsc. For the exception vswitch path some tests like transmit get a 22% increase in packets/sec. For the VF path, the code is slightly shorter but has no real change in performance. Pro: * using netvsc is more like other DPDK NIC's * the exception packet uses less CPU * much smaller code size * no locking required on VF transmit/receive path * no legacy Linux network device to get mangled by userspace * much simpler (1K vs 9K) LOC * unified extended statistics Con: * using netvsc has more complex startup model * no bifurcated driver support * no flow support (since host does not have flow API). * no tunnel offload support * no receive interrupt support Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
2018-09-14net/netvsc: implement link state change callbackStephen Hemminger
Implement callback functionality on link state changes. This is not really driven off of interrupt file descriptor like most other PMD's. Instead, it happens when a link state change message arrives in the common ring buffer. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
2018-09-14net/netvsc: exhausting Tx descriptors is not an errorStephen Hemminger
If application sends faster than vswitch can keep up, then the transmit descriptor pool will be exhausted. This is not a failure so change the name statistic and don't include it in oerrors. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
2018-09-14net/netvsc: allow tuning latency with devargsStephen Hemminger
Allow overriding default guest to host latency on per device basis with devargs. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
2018-09-14ethdev: make default behavior CRC strip on RxFerruh Yigit
Removed DEV_RX_OFFLOAD_CRC_STRIP offload flag. Without any specific Rx offload flag, default behavior by PMDs is to strip CRC. PMDs that support keeping CRC should advertise DEV_RX_OFFLOAD_KEEP_CRC Rx offload capability. Applications that require keeping CRC should check PMD capability first and if it is supported can enable this feature by setting DEV_RX_OFFLOAD_KEEP_CRC in Rx offload flag in rte_eth_dev_configure() Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> Acked-by: Tomasz Duszynski <tdu@semihalf.com> Acked-by: Shahaf Shuler <shahafs@mellanox.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Acked-by: Jan Remes <remes@netcope.com> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Acked-by: Hyong Youb Kim <hyonkim@cisco.com>
2018-08-28net/netvsc: implement free Tx mbuf on demandStephen Hemminger
Add tx_done_cleanup ethdev hook to allow application to control if/when it wants completions to be handled. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
2018-08-28net/netvsc: set lower host latencyStephen Hemminger
Tune the vmbus connection so the host scans faster. This improves transmit performance. The host default value is 100us but setting to 50us reduces packet loss significantly. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
2018-08-05net/netvsc: add queue infoStephen Hemminger
This helps when diagnosing ring issues in testpmd. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
2018-07-13net/netvsc: add Hyper-V network deviceStephen Hemminger
The driver supports Hyper-V networking directly like virtio for KVM or vmxnet3 for VMware. This code is based off of the FreeBSD driver. The file and variable names are kept the same to help with understanding (with most of the BSD style warts removed). This version supports the latest NetVSP 6.1 version and older versions. Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>