Commit Graph

38 Commits

Author SHA1 Message Date
David Harton
f9b3923b5b net/ixgbe: eliminate duplicate filterlist symbols
Some compilers generate warnings for duplicate symbols for the
set of filter lists current defined in ixgbe_ethdev.h.

This commits moves the definition and declaration to the source
file that actually uses them and provides a function to
initialize the values akin to its flush function.

Signed-off-by: David Harton <dharton@cisco.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Radu Nicolau <radu.nicolau@intel.com>
2017-10-06 02:49:48 +02:00
Stephen Hemminger
3720d3d7a0 net/ixgbe: remove unnecessary void casts
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
2017-10-06 02:49:48 +02:00
RongQiang Xie
c4e9863c4d net/ixgbe: check memory allocation result
In the function ixgbe_flow_create(), the value ntuple_filter_ptr,
ethertype_filter_ptr, syn_filter_ptr, fdir_rule_ptr and l2_tn_filter_ptr
use rte_zmalloc().

malloc may return NULL, so we should check if the return value is NULL
or success.

Signed-off-by: RongQiang Xie <xie.rongqiang@zte.com.cn>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-06 02:49:47 +02:00
Qi Zhang
d769655450 net/ixgbe: fix mask flag on flow rule creation
After fail to create a flow and if this is the first flow, the
mask_added flag should be reset, or it will prevent a new flow
which require different mask be created, since the mask config
remains impact.

Fixes: 72c135a89f ("net/ixgbe: create consistent filter")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-08-05 01:30:14 +02:00
Wei Zhao
e76c6e68a7 net/ixgbe: support IPv4-other type filter
Add support for ipv4-other type in ntuple filter.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
2017-07-31 19:58:41 +02:00
Wei Zhao
3d4b081471 net/ixgbe: fix 82599ES flow API port check
This NIC type port check should use port index
not mask for 82599ES.

Fixes: d9347d2540 ("net/ixgbe: support 82599ES SCTP packet drop action")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
2017-07-31 19:58:41 +02:00
Qi Zhang
86e19565f5 net/ixgbe: fix SCTP port support
Only x550 family support SCTP port in FDIR filter, so
add this limitation when parse consistent API.

Fixes: 11777435c7 ("net/ixgbe: parse flow director filter")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-07-31 19:58:40 +02:00
Wei Zhao
c6e381c768 net/ixgbe: add queue index check in filter
Add queue index check when create filter rule, or
filter with invalid queue id can be created successfully.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
2017-07-19 16:25:43 +03:00
Wei Zhao
d9347d2540 net/ixgbe: support 82599ES SCTP packet drop action
82599ES can support SCTP packet drop action, but the
configuration is different from TCP or UDP packet, so
it need to rework some FDIR related code to adapt
drop action rule of SCTP packet.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
2017-07-19 11:59:39 +03:00
Qi Zhang
627a32214f net/ixgbe: fix drop action for signature match
Drop action is not supported by signature match, should return
error when try to create a signature match flow with drop action.

Fixes: a948d33bc0 ("net/ixgbe: enable signature match for consistent API")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-07-19 11:09:13 +03:00
Stephen Hemminger
7d47868c26 drivers/net: remove duplicate includes
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2017-07-16 17:30:24 +02:00
Qi Zhang
7d629caced net/ixgbe: enable IPv6 for consistent API
Enable IPv6 support with rte_flow API.
Only supports signature Match.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-07-06 15:00:57 +02:00
Qi Zhang
a948d33bc0 net/ixgbe: enable signature match for consistent API
Enable signature match for rte_flow API.
RTE_FLOW_ITEM_TYPE_FUZZY specify a signature match.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-07-06 15:00:57 +02:00
Qi Zhang
0d722a19f3 net/ixgbe: replace macro with inline function
Code cleanup done for 2 purposes.
1. "index" variable is no more needed.
2. inline function makes it easier and safer to nest into a loop.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-07-06 15:00:57 +02:00
Adrien Mazarguil
323f811a4a ethdev: add isolated mode to flow API
Isolated mode can be requested by applications on individual ports to avoid
ingress traffic outside of the flow rules they define.

Besides making ingress more deterministic, it allows PMDs to safely reuse
resources otherwise assigned to handle the remaining traffic, such as
global RSS configuration settings, VLAN filters, MAC address entries,
legacy filter API rules and so on in order to expand the set of possible
flow rule types.

To minimize code complexity, PMDs implementing this mode may provide
partial (or even no) support for flow rules when not enabled (e.g. no
priorities, no RSS action). Applications written to use the flow API are
therefore encouraged to enable it.

Once effective, leaving isolated mode may not be possible depending on PMD
implementation.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-06-14 23:33:00 +02:00
Qi Zhang
f35fec63dd net/ixgbe: enable flex bytes for generic flow API
Add fdir flex byte support for rte_flow APIs.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-06-12 10:41:28 +01:00
Qi Zhang
8d702249d5 net/ixgbe: fix fdir mask not be reset
When the last fdir flow be destroyed, the flag "mask_added"
should be reset, so the remain mask info will not take effect
when a new flow be added.

Fixes: a14de8b498 ("net/ixgbe: destroy consistent filter")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-06-12 10:41:27 +01:00
Qi Zhang
0601d85d90 net/ixgbe: remove redundant code
Remove redundant code.
item->type != RTE_FLOW_ITEM_TYPE_END already cover
item->type == RTE_FLOW_ITEM_TYPE_VLAN.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-06-12 10:41:27 +01:00
Ferruh Yigit
dd2c630a5f drivers/net: remove unnecessary macro for unused variables
remove __rte_unused instances that are not required.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Allain Legacy <allain.legacy@windriver.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-06-12 10:41:25 +01:00
Wei Zhao
cec7ddd290 net/ixgbe: fix ntuple filter for SCTP
Add the support of RTE_FLOW_ITEM_TYPE_SCTP type packet for
ixgbe ntuple filter.

Fixes: 672be56d76 ("net/ixgbe: parse n-tuple filter")
Cc: stable@dpdk.org

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-04-28 14:46:19 +02:00
Wei Zhao
3d54a4d9ce net/ixgbe: remove useless item type check
Remove a useless item type check for fdir flow rule.

Fixes: 11777435c7 ("net/ixgbe: parse flow director filter")
Cc: stable@dpdk.org

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-04-28 14:46:18 +02:00
Wei Zhao
c29315b87d net/ixgbe: remove tpid check for flow director
DPDK community has several emails discussion on this topic,
these mails link is bellow:
http://dpdk.org/ml/archives/dev/2017-March/060379.html,
http://dpdk.org/ml/archives/dev/2017-March/060295.html,

items like VLAN can already have several valid "types"
(0x88a8, 0x8100, 0x9100), and who knows what will come up
in the future.

And ixgbe_flow just ignores the types when do filter configuration.
So it may be reasonable to delete the related tpid check process.

Also add some more comment log on stack explanation.

Fixes: 11777435c7 ("net/ixgbe: parse flow director filter")
Cc: stable@dpdk.org

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
2017-04-19 15:37:37 +02:00
Ferruh Yigit
97c5fbf6a4 net/ixgbe: fix duplicated check
Same check duplicated, updated check according what commend states.

Coverity issue: 1407507
Fixes: 11777435c7 ("net/ixgbe: parse flow director filter")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
2017-04-19 15:37:37 +02:00
Wei Zhao
c306ee121a net/ixgbe: fix generic filter return
Fix generic filter return info is not readable
when repeat to create a rule.

Fixes: 72c135a89f ("net/ixgbe: create consistent filter")
Cc: stable@dpdk.org

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
2017-04-19 15:37:37 +02:00
Wei Zhao
740e0ec32d net/ixgbe: fix filters adding MAC type check
All kinds of filter need to hardware mac type check
to make sure the hardware support that type of filter.
If not, it may cause serious issue.

Fixes: 11777435c7 ("net/ixgbe: parse flow director filter")
Fixes: 672be56d76 ("net/ixgbe: parse n-tuple filter")
Fixes: eb3539fc85 ("net/ixgbe: parse ethertype filter")
Fixes: 429f6ebb42 ("net/ixgbe: parse TCP SYN filter")
Cc: stable@dpdk.org

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-04-04 15:52:52 +02:00
Wei Zhao
8185bf3de5 net/ixgbe: delete useless function declaration
Delete useless function declarations in file ixgbe_flow.c and
adjust function definition position to avoid compile error.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
2017-04-04 15:52:52 +02:00
Wei Zhao
37192bf2b4 net/ixgbe: fix VLAN mask TCI in flow rule parser
Use vlan_mask->tci as big endian since this is how rte flow defines it.

Fixes: 11777435c7 ("net/ixgbe: parse flow director filter")
Fixes: 37ed39b4e6 ("net/ixgbe: add TCI mask check for flow director")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
2017-02-10 12:25:50 +01:00
Wei Zhao
a50c11629c net/ixgbe: fix VXLAN parsing for flow director
VNI of VXLAN is parsed wrongly. The root cause is that
VNI array in VXLAN item also uses network byte ordering.

Fixes: 11777435c7 ("net/ixgbe: parse flow director filter")
Cc: stable@dpdk.org

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
2017-02-10 12:25:49 +01:00
Wei Zhao
37ed39b4e6 net/ixgbe: add TCI mask check for flow director
Add more check on the tci mask of VLAN and VXLAN parser
in fdir filter rule pattern parser. If such check not added,
it maybe cause error in fdir configuration set check.

Fixes: 11777435c7 ("net/ixgbe: parse flow director filter")
Cc: stable@dpdk.org

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
2017-02-10 12:25:49 +01:00
Wei Zhao
6ff773e102 net/ixgbe: flush all the filter list
This patch adds a function to flush all the filter list
filter on a port.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Wei Dai <wei.dai@intel.com>
2017-01-17 19:41:43 +01:00
Wei Zhao
a14de8b498 net/ixgbe: destroy consistent filter
This patch adds a function to destroy the flow filter.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Wei Dai <wei.dai@intel.com>
2017-01-17 19:41:43 +01:00
Wei Zhao
72c135a89f net/ixgbe: create consistent filter
This patch adds a function to create the flow directory filter.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Wei Dai <wei.dai@intel.com>
2017-01-17 19:41:43 +01:00
Wei Zhao
11777435c7 net/ixgbe: parse flow director filter
check if the rule is a flow director rule, and get the flow director info.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Wei Dai <wei.dai@intel.com>
2017-01-17 19:41:43 +01:00
Wei Zhao
99e7003831 net/ixgbe: parse L2 tunnel filter
check if the rule is a L2 tunnel rule, and get the L2 tunnel info.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Wei Dai <wei.dai@intel.com>
2017-01-17 19:41:43 +01:00
Wei Zhao
429f6ebb42 net/ixgbe: parse TCP SYN filter
check if the rule is a TCP SYN rule, and get the SYN info.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Wei Dai <wei.dai@intel.com>
2017-01-17 19:41:43 +01:00
Wei Zhao
eb3539fc85 net/ixgbe: parse ethertype filter
check if the rule is a ethertype rule, and get the ethertype info.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Wei Dai <wei.dai@intel.com>
2017-01-17 19:41:43 +01:00
Wei Zhao
672be56d76 net/ixgbe: parse n-tuple filter
Add rule validate function and check if the rule is a n-tuple rule,
and get the n-tuple info.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Wei Dai <wei.dai@intel.com>
2017-01-17 19:41:43 +01:00
Wei Zhao
62a65c2ef6 net/ixgbe: flush all the filters
Add support for flush all the filters in SW.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Wei Dai <wei.dai@intel.com>
2017-01-17 19:41:43 +01:00