Commit Graph

13 Commits

Author SHA1 Message Date
John Daley
35e2cb6a17 net/enic: add simple Rx handler
Add an optimized Rx handler for non-scattered Rx.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Signed-off-by: John Daley <johndale@cisco.com>
2018-07-03 01:54:26 +02:00
Hyong Youb Kim
c55614d102 net/enic: reduce Tx completion updates
Request one completion update per roughly 32 buffers. It saves DMA
resources on the NIC, PCIe utilization, and cache miss rates.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2018-07-03 01:54:22 +02:00
Hyong Youb Kim
9466a38d38 net/enic: report ring limits and preferred default values
Report min/max ring sizes, alignments, and so on, and rely on the
common checks implemented in the rte_ethdev layer.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2018-07-03 01:54:12 +02:00
Hyong Youb Kim
c2fec27b5c net/enic: allow to change RSS settings
Currently, when more than 1 receive queues are configured, the driver
always enables RSS with the driver's own default hash type, key, and
RETA. The user is unable to change any of the RSS settings. Address
this by implementing the ethdev RSS API as follows.

Correctly report the RETA size, key size, and supported hash types
through rte_eth_dev_info.

During dev_configure(), initialize RSS according to the device's
mq_mode and rss_conf. Start with the default RETA, and use the default
key unless a custom key is provided.

Add the RETA and rss_conf query/set handlers to let the user change
RSS settings after the initial configuration. The hardware is able to
change hash type, key, and RETA individually. So, the handlers change
only the affected settings.

Refactor/rename several functions in order to make their intentions
clear. For example, remove all traces of RSS from
enicpmd_vlan_offload_set() as it is confusing.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2018-03-30 14:08:43 +02:00
Hyong Youb Kim
2e99ea80f8 net/enic: use BSD-3-Clause
enic is currently using BSD-2-Clause, whereas the DPDK approved
license is BSD-3-Clause. So replace license text with BSD-3-Clause.

Remove LICENSE as it is redundant.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2018-01-16 18:47:49 +01:00
John Daley
ed6e564c21 net/enic: fix memory leak with oversized Tx packets
If a packet send is attempted with a packet larger than the NIC
is capable of processing (9208) it will be dropped with no
completion descriptor returned or completion index update, which
will lead to an mbuf leak and eventual hang.

Drop and count oversized Tx packets in the Tx burst function and
dereference/free the mbuf without sending it to the NIC.

Since the maximum Rx and Tx packet sizes are different on enic
and are now both being used, make the define ENIC_DEFAULT_MAX_PKT_SIZE
be 2 defines, one for Rx and one for Tx.

Fixes: fefed3d1e6 ("enic: new driver")
Cc: stable@dpdk.org

Signed-off-by: John Daley <johndale@cisco.com>
2017-02-10 12:25:49 +01:00
John Daley
bb34ffb848 net/enic: determine max egress packet size and max MTU
Pull in common VNIC code which enables querying for max egress
packet size with newer firmware via a device command. If the
field is non-zero, it is the max egress packet size. If it is
0, the default value (9022) can safely be assumed. The value
for 1300 series VICS using firmware versions >= 3.1.2 for blade
series and >= 2.0.13 for rack series servers is 9208.

Tx buffers can be emitted only if they are less than the max egress
packet size regardless of the MTU setting (the MTU is advisory).
The max egress packet size can used to determine the upper limit
of the MTU since the enic can also receive packets of size greater
than max egress packet size. A max_mtu variable is added with
a value of max egress packet size minus L2 header size.

The default MTU is set via the CIMC/UCSM management interface and
currently allows value up to 9000. If the value is changed, the
host must be reboot. To avoid the reboot and allow MTU values
up to the max capability of the NIC, MTU update capability will
be added with a max value capped by max_mtu.

Signed-off-by: John Daley <johndale@cisco.com>
2016-06-29 11:54:46 +02:00
John Daley
78f90329dd net/enic: optimize the Tx function
Reduce host CPU overhead of Tx packet processing:
* Use local variables inside per-packet loop instead of fields in structs.
* Factor book keeping and conditionals out of the per-packet loop where
  possible.
* Post buffers to the nic at a maximum of every 64 packets

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Signed-off-by: John Daley <johndale@cisco.com>
2016-06-15 17:13:56 +02:00
John Daley
d309bdc2c9 net/enic: remove unused functions in Tx path
Functions existed which were never called. Removed them. Also
rename the 'pmd' from the name of the Tx function to improve clarity.

Signed-off-by: John Daley <johndale@cisco.com>
2016-06-15 17:13:56 +02:00
John Daley
d944410a44 enic: fix Tx hang when number of packets > queue size
If the nb_pkts parameter to rte_eth_tx_burst() was greater than
the TX descriptor count, a completion was not being requested
from the NIC, so descriptors would not be released back to the
host causing a lock-up.

Introduce a limit of how many TX descriptors can be used in a single
call to the enic PMD burst TX function before requesting a completion.

Fixes: d739ba4c6a ("enic: improve Tx packet rate")

Signed-off-by: John Daley <johndale@cisco.com>
2016-03-30 19:39:07 +02:00
John Daley
947d860c82 enic: improve Rx performance
This is a wholesale replacement of the Enic PMD receive path in order
to improve performance and code clarity. The changes are:
- Simplify and reduce code path length of receive function.
- Put most of the fast-path receive functions in one file.
- Reduce the number of posted_index updates (pay attention to
  rx_free_thresh)
- Remove the unneeded container structure around the RQ mbuf ring
- Prefetch next Mbuf and descriptors while processing the current one
- Use a lookup table for converting CQ flags to mbuf flags.

Signed-off-by: John Daley <johndale@cisco.com>
2016-03-16 16:57:12 +01:00
Sujith Sankar
da44259fbf enic: remove #ident lines
This patch removes the #ident strings at the beginning of the source files.

Signed-off-by: Sujith Sankar <ssujith@cisco.com>
2015-09-30 01:19:19 +02:00
Bruce Richardson
72f3de308f enic: move to drivers/net/
move enic PMD to drivers/net directory

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
[Thomas: move vnic/ to base/]
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-05-22 16:05:52 +02:00