Commit Graph

13 Commits

Author SHA1 Message Date
John Daley
aa07bf8fa7 net/enic: rename functions for queue index conversion
The function names for converting between RQ indexes known to
the RTE code and internal RQ indexes for primary Start of Packet
(SOP) queues and spill-over (Data) queues was unclear and
confusing.

Clarify with more explicit function names.

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Nelson Escobar <neescoba@cisco.com>
2016-10-26 19:38:18 +02:00
John Daley
dfbd6a9cb5 net/enic: extend flow director support for 1300 series
1300 series Cisco adapter firmware version 2.0(13) for UCS
C-series servers and 3.1(2) for blade servers supports more
filtering capabilities. The feature can be enabled via Cisco
CIMC or USCM with the 'advanced filters' radio button. When
enabled, the these additional flow director modes are available:
	RTE_ETH_FLOW_NONFRAG_IPV4_OTHER
	RTE_ETH_FLOW_NONFRAG_IPV4_SCTP
	RTE_ETH_FLOW_NONFRAG_IPV6_UDP
	RTE_ETH_FLOW_NONFRAG_IPV6_TCP
	RTE_ETH_FLOW_NONFRAG_IPV6_SCTP
	RTE_ETH_FLOW_NONFRAG_IPV6_OTHER

Changes:
- Detect and set an 'advanced filters' flag dependent on the adapter
  capability.
- Implement RTE_ETH_FILTER_INFO filter op to return the flow types
  available dependent on whether advanced filters are enabled.
- Use a function pointer to select how filters are added to the adapter:
  copy_fltr_v1() for older firmware/adapters or copy_fltr_v2() for
  adapters which support advanced filters.
- Apply fdir global masks to filters when in advanced filter mode.
- Update documentation.

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Nelson Escobar <neescoba@cisco.com>
2016-10-13 15:30:59 +02:00
John Daley
e9e29d3ee2 net/enic: fix crash with removed flow director filters
When flow director filters where removed when an enic device is
stopped, the filters were freed but the pointer was not set to
NULL so the next stop would try to free them again.

Fixes: fefed3d1e6 ("enic: new driver")

Signed-off-by: John Daley <johndale@cisco.com>
2016-10-13 15:30:59 +02:00
John Daley
84a6971409 net/enic: fix flow director
The wrong queue id was being used in the enic
flow director code after the scattered Rx feature
was added.

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

Signed-off-by: John Daley <johndale@cisco.com>
2016-10-13 15:30:59 +02:00
John Daley
0473ffe338 net/enic: increment filter failure counter
One instance of a filter add failure was not incrementing the
the fail counter.

Fixes: 4c2c7bf41f ("net/enic: fix negative array index write")

Signed-off-by: John Daley <johndale@cisco.com>
2016-07-15 23:37:13 +02:00
Nelson Escobar
9d802d1cb9 net/enic: fix name of classifiers hash table
The enic_clsf_init() function is called once per enic instance, but it
used a static name to create the hash table.  Consequently when using
more than one enic instance, there was a name collision which caused
errors:

EAL: memzone_reserve_aligned_thread_unsafe():
  memzone<RG_HT_enicpmd_clsf_hash> already exists
RING: Cannot reserve memory
HASH: memory allocation failed
PMD: rte_enic_pmd: Init of hash table for clsf failed.
  Flow director feature will not work

This patch changes the name to be unique per enic instance.

Fixes: fefed3d1e6 ("enic: new driver")

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2016-06-28 12:09:52 +02:00
John Daley
4c2c7bf41f net/enic: fix negative array index write
Negative array index write using variable pos as an index to array
enic->fdir.nodes. Fixed by add array index check.

Coverity issue: 13270

Fixes: fefed3d1e6 ("enic: new driver")

Signed-off-by: John Daley <johndale@cisco.com>
2016-06-24 18:28:09 +02:00
Huawei Xie
693f715da4 remove extra parentheses in return statement
fix the error reported by checkpatch:
  "ERROR: return is not a function, parentheses are not required"

remove parentheses in return like:
  "return (logical expressions)"

remove parentheses in return a function like:
  "return (rte_mempool_lookup(...))"

Fixes: 6307b909b8 ("lib: remove extra parenthesis after return")

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
2016-02-10 15:47:50 +01:00
David Marchand
922a5466c1 enic: fix hash creation when not using first numa node
If dpdk is run with memory only available on socket != 0, then hash
creation will fail and flow director feature won't be available.
Fix this by asking for allocation on caller socket.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked by: Sujith Sankar <ssujith@cisco.com>
2015-10-20 21:32:06 +02: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
Pablo de Lara
2b9c06e78b enic: use appropriate key length in hash table
RTE_HASH_KEY_LENGTH_MAX was deprecated, and the hash table
actually is hosting bigger keys than that size, so key length
has been increased to properly allocate all keys.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Sujith Sankar <ssujith@cisco.com>
2015-09-04 15:26:52 +02:00
Bruce Richardson
24b4bb8123 hash: rename unused field
The cuckoo hash has a fixed number of entries per bucket, so the
configuration parameter for this is unused. We change this field in the
parameters struct to "reserved" to indicate that there is now no such
parameter value, while at the same time keeping ABI consistency.

Fixes: 48a3991196 ("hash: replace with cuckoo hash implementation")

Suggested-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2015-07-13 19:27:31 +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