numam-dpdk/drivers/net/enic
Hyong Youb Kim 4182ee7f02 net/enic: fix flow director SCTP matching
The firmware filter API does not have flags indicating "match SCTP
packet". Instead, the driver needs to explicitly add an IP match and
set the protocol number (132 for SCTP) in the IP header.

The existing code (copy_fltr_v2) has two bugs.

1. It sets the protocol number (132) in the match value, but not the
mask. The mask remains 0, so the match becomes a wildcard match. The
NIC ends up matching all protocol numbers (i.e. thinks non-SCTP
packets are SCTP).

2. It modifies the input argument (rte_eth_fdir_input). The driver
tracks filters using rte_hash_{add,del}_key(input). So, addding
(RTE_ETH_FILTER_ADD) and deleting (RTE_ETH_FILTER_DELETE) must use the
same input argument for the same filter. But, overwriting the protocol
number while adding the filter breaks this assumption, and causes
delete operation to fail.

So, set the mask as well as protocol value. Do not modify the input
argument, and use const in function signatures to make the intention
clear. Also move a couple function declarations to enic_clsf.c from
enic.h as they are strictly local.

Fixes: dfbd6a9cb5 ("net/enic: extend flow director support for 1300 series")
Cc: stable@dpdk.org

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2019-03-08 17:52:22 +01:00
..
base net/enic: remove unused functions 2019-03-08 17:52:22 +01:00
enic_clsf.c net/enic: fix flow director SCTP matching 2019-03-08 17:52:22 +01:00
enic_compat.h net/enic: add the simple version of Tx handler 2018-07-03 01:54:23 +02:00
enic_ethdev.c net/enic: remove redundant log level check 2019-01-14 17:44:30 +01:00
enic_flow.c net/enic: fix counter action 2018-10-18 10:24:39 +02:00
enic_main.c net/enic: remove useless include 2019-01-14 17:44:30 +01:00
enic_res.c net/enic: remove unused functions 2019-03-08 17:52:22 +01:00
enic_res.h net/enic: remove unused functions 2019-03-08 17:52:22 +01:00
enic_rxtx_common.h net/enic: move common Rx functions to a new header file 2018-10-11 18:53:49 +02:00
enic_rxtx_vec_avx2.c net/enic: add AVX2 based vectorized Rx handler 2018-10-11 18:53:49 +02:00
enic_rxtx.c net/enic: fix size check in Tx prepare handler 2018-11-14 00:35:53 +01:00
enic.h net/enic: fix flow director SCTP matching 2019-03-08 17:52:22 +01:00
Makefile net/enic: remove unused functions 2019-03-08 17:52:22 +01:00
meson.build net/enic: remove unused functions 2019-03-08 17:52:22 +01:00
rte_pmd_enic_version.map enic: move to drivers/net/ 2015-05-22 16:05:52 +02:00