git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/ixgbe: add option for link up check on pin SDP3
[dpdk.git]
/
drivers
/
net
/
enic
/
enic_flow.c
diff --git
a/drivers/net/enic/enic_flow.c
b/drivers/net/enic/enic_flow.c
index
f389677
..
cf51793
100644
(file)
--- a/
drivers/net/enic/enic_flow.c
+++ b/
drivers/net/enic/enic_flow.c
@@
-5,7
+5,7
@@
#include <errno.h>
#include <stdint.h>
#include <rte_log.h>
#include <errno.h>
#include <stdint.h>
#include <rte_log.h>
-#include <
rte_
ethdev_driver.h>
+#include <ethdev_driver.h>
#include <rte_flow_driver.h>
#include <rte_ether.h>
#include <rte_ip.h>
#include <rte_flow_driver.h>
#include <rte_ether.h>
#include <rte_ip.h>
@@
-16,13
+16,6
@@
#include "vnic_dev.h"
#include "vnic_nic.h"
#include "vnic_dev.h"
#include "vnic_nic.h"
-#define FLOW_TRACE() \
- rte_log(RTE_LOG_DEBUG, enicpmd_logtype_flow, \
- "%s()\n", __func__)
-#define FLOW_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, enicpmd_logtype_flow, \
- fmt "\n", ##args)
-
/*
* Common arguments passed to copy_item functions. Use this structure
* so we can easily add new arguments.
/*
* Common arguments passed to copy_item functions. Use this structure
* so we can easily add new arguments.
@@
-54,7
+47,7
@@
struct enic_items {
/** True if it's OK for this item to be the first item. For some NIC
* versions, it's invalid to start the stack above layer 3.
*/
/** True if it's OK for this item to be the first item. For some NIC
* versions, it's invalid to start the stack above layer 3.
*/
- const u
8
valid_start_item;
+ const u
int8_t
valid_start_item;
/* Inner packet version of copy_item. */
enic_copy_item_fn *inner_copy_item;
};
/* Inner packet version of copy_item. */
enic_copy_item_fn *inner_copy_item;
};
@@
-377,7
+370,7
@@
static const struct enic_action_cap enic_action_cap[] = {
};
static int
};
static int
-mask_exact_match(const u
8 *supported, const u8
*supplied,
+mask_exact_match(const u
int8_t *supported, const uint8_t
*supplied,
unsigned int size)
{
unsigned int i;
unsigned int size)
{
unsigned int i;
@@
-401,21
+394,21
@@
enic_copy_item_ipv4_v1(struct copy_item_args *arg)
.dst_addr = 0xffffffff,
};
.dst_addr = 0xffffffff,
};
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
if (!mask)
mask = &rte_flow_item_ipv4_mask;
/* This is an exact match filter, both fields must be set */
if (!spec || !spec->hdr.src_addr || !spec->hdr.dst_addr) {
if (!mask)
mask = &rte_flow_item_ipv4_mask;
/* This is an exact match filter, both fields must be set */
if (!spec || !spec->hdr.src_addr || !spec->hdr.dst_addr) {
-
FLOW
_LOG(ERR, "IPv4 exact match src/dst addr");
+
ENICPMD
_LOG(ERR, "IPv4 exact match src/dst addr");
return ENOTSUP;
}
return ENOTSUP;
}
- /* check that the supp
ied mask exactly matches capabil
ty */
- if (!mask_exact_match((const u
8
*)&supported_mask,
- (const u
8
*)item->mask, sizeof(*mask))) {
-
FLOW
_LOG(ERR, "IPv4 exact match mask");
+ /* check that the supp
lied mask exactly matches capabili
ty */
+ if (!mask_exact_match((const u
int8_t
*)&supported_mask,
+ (const u
int8_t
*)item->mask, sizeof(*mask))) {
+
ENICPMD
_LOG(ERR, "IPv4 exact match mask");
return ENOTSUP;
}
return ENOTSUP;
}
@@
-439,21
+432,21
@@
enic_copy_item_udp_v1(struct copy_item_args *arg)
.dst_port = 0xffff,
};
.dst_port = 0xffff,
};
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
if (!mask)
mask = &rte_flow_item_udp_mask;
/* This is an exact match filter, both ports must be set */
if (!spec || !spec->hdr.src_port || !spec->hdr.dst_port) {
if (!mask)
mask = &rte_flow_item_udp_mask;
/* This is an exact match filter, both ports must be set */
if (!spec || !spec->hdr.src_port || !spec->hdr.dst_port) {
-
FLOW
_LOG(ERR, "UDP exact match src/dst addr");
+
ENICPMD
_LOG(ERR, "UDP exact match src/dst addr");
return ENOTSUP;
}
return ENOTSUP;
}
- /* check that the supp
ied mask exactly matches capabil
ty */
- if (!mask_exact_match((const u
8
*)&supported_mask,
- (const u
8
*)item->mask, sizeof(*mask))) {
-
FLOW
_LOG(ERR, "UDP exact match mask");
+ /* check that the supp
lied mask exactly matches capabili
ty */
+ if (!mask_exact_match((const u
int8_t
*)&supported_mask,
+ (const u
int8_t
*)item->mask, sizeof(*mask))) {
+
ENICPMD
_LOG(ERR, "UDP exact match mask");
return ENOTSUP;
}
return ENOTSUP;
}
@@
-478,21
+471,21
@@
enic_copy_item_tcp_v1(struct copy_item_args *arg)
.dst_port = 0xffff,
};
.dst_port = 0xffff,
};
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
if (!mask)
mask = &rte_flow_item_tcp_mask;
/* This is an exact match filter, both ports must be set */
if (!spec || !spec->hdr.src_port || !spec->hdr.dst_port) {
if (!mask)
mask = &rte_flow_item_tcp_mask;
/* This is an exact match filter, both ports must be set */
if (!spec || !spec->hdr.src_port || !spec->hdr.dst_port) {
-
FLOW
_LOG(ERR, "TCPIPv4 exact match src/dst addr");
+
ENICPMD
_LOG(ERR, "TCPIPv4 exact match src/dst addr");
return ENOTSUP;
}
return ENOTSUP;
}
- /* check that the supp
ied mask exactly matches capabil
ty */
- if (!mask_exact_match((const u
8
*)&supported_mask,
- (const u
8
*)item->mask, sizeof(*mask))) {
-
FLOW
_LOG(ERR, "TCP exact match mask");
+ /* check that the supp
lied mask exactly matches capabili
ty */
+ if (!mask_exact_match((const u
int8_t
*)&supported_mask,
+ (const u
int8_t
*)item->mask, sizeof(*mask))) {
+
ENICPMD
_LOG(ERR, "TCP exact match mask");
return ENOTSUP;
}
return ENOTSUP;
}
@@
-554,7
+547,7
@@
enic_copy_item_inner_eth_v2(struct copy_item_args *arg)
const void *mask = arg->item->mask;
uint8_t *off = arg->inner_ofst;
const void *mask = arg->item->mask;
uint8_t *off = arg->inner_ofst;
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
if (!mask)
mask = &rte_flow_item_eth_mask;
arg->l2_proto_off = *off + offsetof(struct rte_ether_hdr, ether_type);
if (!mask)
mask = &rte_flow_item_eth_mask;
arg->l2_proto_off = *off + offsetof(struct rte_ether_hdr, ether_type);
@@
-570,7
+563,7
@@
enic_copy_item_inner_vlan_v2(struct copy_item_args *arg)
uint8_t *off = arg->inner_ofst;
uint8_t eth_type_off;
uint8_t *off = arg->inner_ofst;
uint8_t eth_type_off;
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
if (!mask)
mask = &rte_flow_item_vlan_mask;
/* Append vlan header to L5 and set ether type = TPID */
if (!mask)
mask = &rte_flow_item_vlan_mask;
/* Append vlan header to L5 and set ether type = TPID */
@@
-587,7
+580,7
@@
enic_copy_item_inner_ipv4_v2(struct copy_item_args *arg)
const void *mask = arg->item->mask;
uint8_t *off = arg->inner_ofst;
const void *mask = arg->item->mask;
uint8_t *off = arg->inner_ofst;
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
if (!mask)
mask = &rte_flow_item_ipv4_mask;
/* Append ipv4 header to L5 and set ether type = ipv4 */
if (!mask)
mask = &rte_flow_item_ipv4_mask;
/* Append ipv4 header to L5 and set ether type = ipv4 */
@@
-603,7
+596,7
@@
enic_copy_item_inner_ipv6_v2(struct copy_item_args *arg)
const void *mask = arg->item->mask;
uint8_t *off = arg->inner_ofst;
const void *mask = arg->item->mask;
uint8_t *off = arg->inner_ofst;
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
if (!mask)
mask = &rte_flow_item_ipv6_mask;
/* Append ipv6 header to L5 and set ether type = ipv6 */
if (!mask)
mask = &rte_flow_item_ipv6_mask;
/* Append ipv6 header to L5 and set ether type = ipv6 */
@@
-619,7
+612,7
@@
enic_copy_item_inner_udp_v2(struct copy_item_args *arg)
const void *mask = arg->item->mask;
uint8_t *off = arg->inner_ofst;
const void *mask = arg->item->mask;
uint8_t *off = arg->inner_ofst;
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
if (!mask)
mask = &rte_flow_item_udp_mask;
/* Append udp header to L5 and set ip proto = udp */
if (!mask)
mask = &rte_flow_item_udp_mask;
/* Append udp header to L5 and set ip proto = udp */
@@
-634,7
+627,7
@@
enic_copy_item_inner_tcp_v2(struct copy_item_args *arg)
const void *mask = arg->item->mask;
uint8_t *off = arg->inner_ofst;
const void *mask = arg->item->mask;
uint8_t *off = arg->inner_ofst;
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
if (!mask)
mask = &rte_flow_item_tcp_mask;
/* Append tcp header to L5 and set ip proto = tcp */
if (!mask)
mask = &rte_flow_item_tcp_mask;
/* Append tcp header to L5 and set ip proto = tcp */
@@
-654,7
+647,7
@@
enic_copy_item_eth_v2(struct copy_item_args *arg)
const struct rte_flow_item_eth *mask = item->mask;
struct filter_generic_1 *gp = &enic_filter->u.generic_1;
const struct rte_flow_item_eth *mask = item->mask;
struct filter_generic_1 *gp = &enic_filter->u.generic_1;
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
/* Match all if no spec */
if (!spec)
/* Match all if no spec */
if (!spec)
@@
-663,14
+656,14
@@
enic_copy_item_eth_v2(struct copy_item_args *arg)
if (!mask)
mask = &rte_flow_item_eth_mask;
if (!mask)
mask = &rte_flow_item_eth_mask;
- memcpy(enic_spec.d_addr.addr_bytes, spec->dst.addr_bytes,
+ memcpy(enic_spec.d
st
_addr.addr_bytes, spec->dst.addr_bytes,
RTE_ETHER_ADDR_LEN);
RTE_ETHER_ADDR_LEN);
- memcpy(enic_spec.s_addr.addr_bytes, spec->src.addr_bytes,
+ memcpy(enic_spec.s
rc
_addr.addr_bytes, spec->src.addr_bytes,
RTE_ETHER_ADDR_LEN);
RTE_ETHER_ADDR_LEN);
- memcpy(enic_mask.d_addr.addr_bytes, mask->dst.addr_bytes,
+ memcpy(enic_mask.d
st
_addr.addr_bytes, mask->dst.addr_bytes,
RTE_ETHER_ADDR_LEN);
RTE_ETHER_ADDR_LEN);
- memcpy(enic_mask.s_addr.addr_bytes, mask->src.addr_bytes,
+ memcpy(enic_mask.s
rc
_addr.addr_bytes, mask->src.addr_bytes,
RTE_ETHER_ADDR_LEN);
enic_spec.ether_type = spec->type;
enic_mask.ether_type = mask->type;
RTE_ETHER_ADDR_LEN);
enic_spec.ether_type = spec->type;
enic_mask.ether_type = mask->type;
@@
-694,7
+687,7
@@
enic_copy_item_vlan_v2(struct copy_item_args *arg)
struct rte_ether_hdr *eth_mask;
struct rte_ether_hdr *eth_val;
struct rte_ether_hdr *eth_mask;
struct rte_ether_hdr *eth_val;
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
/* Match all if no spec */
if (!spec)
/* Match all if no spec */
if (!spec)
@@
-744,7
+737,7
@@
enic_copy_item_ipv4_v2(struct copy_item_args *arg)
const struct rte_flow_item_ipv4 *mask = item->mask;
struct filter_generic_1 *gp = &enic_filter->u.generic_1;
const struct rte_flow_item_ipv4 *mask = item->mask;
struct filter_generic_1 *gp = &enic_filter->u.generic_1;
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
/* Match IPv4 */
gp->mask_flags |= FILTER_GENERIC_1_IPV4;
/* Match IPv4 */
gp->mask_flags |= FILTER_GENERIC_1_IPV4;
@@
-773,7
+766,7
@@
enic_copy_item_ipv6_v2(struct copy_item_args *arg)
const struct rte_flow_item_ipv6 *mask = item->mask;
struct filter_generic_1 *gp = &enic_filter->u.generic_1;
const struct rte_flow_item_ipv6 *mask = item->mask;
struct filter_generic_1 *gp = &enic_filter->u.generic_1;
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
/* Match IPv6 */
gp->mask_flags |= FILTER_GENERIC_1_IPV6;
/* Match IPv6 */
gp->mask_flags |= FILTER_GENERIC_1_IPV6;
@@
-802,7
+795,7
@@
enic_copy_item_udp_v2(struct copy_item_args *arg)
const struct rte_flow_item_udp *mask = item->mask;
struct filter_generic_1 *gp = &enic_filter->u.generic_1;
const struct rte_flow_item_udp *mask = item->mask;
struct filter_generic_1 *gp = &enic_filter->u.generic_1;
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
/* Match UDP */
gp->mask_flags |= FILTER_GENERIC_1_UDP;
/* Match UDP */
gp->mask_flags |= FILTER_GENERIC_1_UDP;
@@
-831,7
+824,7
@@
enic_copy_item_tcp_v2(struct copy_item_args *arg)
const struct rte_flow_item_tcp *mask = item->mask;
struct filter_generic_1 *gp = &enic_filter->u.generic_1;
const struct rte_flow_item_tcp *mask = item->mask;
struct filter_generic_1 *gp = &enic_filter->u.generic_1;
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
/* Match TCP */
gp->mask_flags |= FILTER_GENERIC_1_TCP;
/* Match TCP */
gp->mask_flags |= FILTER_GENERIC_1_TCP;
@@
-862,7
+855,7
@@
enic_copy_item_sctp_v2(struct copy_item_args *arg)
uint8_t *ip_proto_mask = NULL;
uint8_t *ip_proto = NULL;
uint8_t *ip_proto_mask = NULL;
uint8_t *ip_proto = NULL;
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
/*
* The NIC filter API has no flags for "match sctp", so explicitly set
/*
* The NIC filter API has no flags for "match sctp", so explicitly set
@@
-912,7
+905,7
@@
enic_copy_item_vxlan_v2(struct copy_item_args *arg)
struct filter_generic_1 *gp = &enic_filter->u.generic_1;
struct rte_udp_hdr *udp;
struct filter_generic_1 *gp = &enic_filter->u.generic_1;
struct rte_udp_hdr *udp;
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
/*
* The NIC filter API has no flags for "match vxlan". Set UDP port to
/*
* The NIC filter API has no flags for "match vxlan". Set UDP port to
@@
-955,7
+948,7
@@
enic_copy_item_raw_v2(struct copy_item_args *arg)
const struct rte_flow_item_raw *mask = item->mask;
struct filter_generic_1 *gp = &enic_filter->u.generic_1;
const struct rte_flow_item_raw *mask = item->mask;
struct filter_generic_1 *gp = &enic_filter->u.generic_1;
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
/* Cannot be used for inner packet */
if (*inner_ofst)
/* Cannot be used for inner packet */
if (*inner_ofst)
@@
-1002,11
+995,11
@@
enic_copy_item_raw_v2(struct copy_item_args *arg)
*/
static int
item_stacking_valid(enum rte_flow_item_type prev_item,
*/
static int
item_stacking_valid(enum rte_flow_item_type prev_item,
- const struct enic_items *item_info, u
8
is_first_item)
+ const struct enic_items *item_info, u
int8_t
is_first_item)
{
enum rte_flow_item_type const *allowed_items = item_info->prev_items;
{
enum rte_flow_item_type const *allowed_items = item_info->prev_items;
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
for (; *allowed_items != RTE_FLOW_ITEM_TYPE_END; allowed_items++) {
if (prev_item == *allowed_items)
for (; *allowed_items != RTE_FLOW_ITEM_TYPE_END; allowed_items++) {
if (prev_item == *allowed_items)
@@
-1035,7
+1028,7
@@
fixup_l5_layer(struct enic *enic, struct filter_generic_1 *gp,
if (!(inner_ofst > 0 && enic->vxlan))
return;
if (!(inner_ofst > 0 && enic->vxlan))
return;
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
vxlan = sizeof(struct rte_vxlan_hdr);
memcpy(gp->layer[FILTER_GENERIC_1_L4].mask + sizeof(struct rte_udp_hdr),
gp->layer[FILTER_GENERIC_1_L5].mask, vxlan);
vxlan = sizeof(struct rte_vxlan_hdr);
memcpy(gp->layer[FILTER_GENERIC_1_L4].mask + sizeof(struct rte_udp_hdr),
gp->layer[FILTER_GENERIC_1_L5].mask, vxlan);
@@
-1051,14
+1044,14
@@
fixup_l5_layer(struct enic *enic, struct filter_generic_1 *gp,
}
/**
}
/**
- * Build the intenal enic filter structure from the provided pattern. The
+ * Build the inte
r
nal enic filter structure from the provided pattern. The
* pattern is validated as the items are copied.
*
* @param pattern[in]
* @param items_info[in]
* Info about this NICs item support, like valid previous items.
* @param enic_filter[out]
* pattern is validated as the items are copied.
*
* @param pattern[in]
* @param items_info[in]
* Info about this NICs item support, like valid previous items.
* @param enic_filter[out]
- * NIC spec
fil
c filters derived from the pattern.
+ * NIC spec
ifi
c filters derived from the pattern.
* @param error[out]
*/
static int
* @param error[out]
*/
static int
@@
-1070,14
+1063,14
@@
enic_copy_filter(const struct rte_flow_item pattern[],
{
int ret;
const struct rte_flow_item *item = pattern;
{
int ret;
const struct rte_flow_item *item = pattern;
- u
8
inner_ofst = 0; /* If encapsulated, ofst into L5 */
+ u
int8_t
inner_ofst = 0; /* If encapsulated, ofst into L5 */
enum rte_flow_item_type prev_item;
const struct enic_items *item_info;
struct copy_item_args args;
enic_copy_item_fn *copy_fn;
enum rte_flow_item_type prev_item;
const struct enic_items *item_info;
struct copy_item_args args;
enic_copy_item_fn *copy_fn;
- u
8
is_first_item = 1;
+ u
int8_t
is_first_item = 1;
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
prev_item = 0;
prev_item = 0;
@@
-1130,12
+1123,12
@@
stacking_error:
}
/**
}
/**
- * Build the intenal version 1 NIC action structure from the provided pattern.
+ * Build the inte
r
nal version 1 NIC action structure from the provided pattern.
* The pattern is validated as the items are copied.
*
* @param actions[in]
* @param enic_action[out]
* The pattern is validated as the items are copied.
*
* @param actions[in]
* @param enic_action[out]
- * NIC spec
fil
c actions derived from the actions.
+ * NIC spec
ifi
c actions derived from the actions.
* @param error[out]
*/
static int
* @param error[out]
*/
static int
@@
-1146,7
+1139,7
@@
enic_copy_action_v1(__rte_unused struct enic *enic,
enum { FATE = 1, };
uint32_t overlap = 0;
enum { FATE = 1, };
uint32_t overlap = 0;
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {
if (actions->type == RTE_FLOW_ACTION_TYPE_VOID)
for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {
if (actions->type == RTE_FLOW_ACTION_TYPE_VOID)
@@
-1177,12
+1170,12
@@
enic_copy_action_v1(__rte_unused struct enic *enic,
}
/**
}
/**
- * Build the intenal version 2 NIC action structure from the provided pattern.
+ * Build the inte
r
nal version 2 NIC action structure from the provided pattern.
* The pattern is validated as the items are copied.
*
* @param actions[in]
* @param enic_action[out]
* The pattern is validated as the items are copied.
*
* @param actions[in]
* @param enic_action[out]
- * NIC spec
fil
c actions derived from the actions.
+ * NIC spec
ifi
c actions derived from the actions.
* @param error[out]
*/
static int
* @param error[out]
*/
static int
@@
-1194,7
+1187,7
@@
enic_copy_action_v2(struct enic *enic,
uint32_t overlap = 0;
bool passthru = false;
uint32_t overlap = 0;
bool passthru = false;
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {
switch (actions->type) {
for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {
switch (actions->type) {
@@
-1215,7
+1208,8
@@
enic_copy_action_v2(struct enic *enic,
const struct rte_flow_action_mark *mark =
(const struct rte_flow_action_mark *)
actions->conf;
const struct rte_flow_action_mark *mark =
(const struct rte_flow_action_mark *)
actions->conf;
-
+ if (enic->use_noscatter_vec_rx_handler)
+ return ENOTSUP;
if (overlap & MARK)
return ENOTSUP;
overlap |= MARK;
if (overlap & MARK)
return ENOTSUP;
overlap |= MARK;
@@
-1235,6
+1229,8
@@
enic_copy_action_v2(struct enic *enic,
break;
}
case RTE_FLOW_ACTION_TYPE_FLAG: {
break;
}
case RTE_FLOW_ACTION_TYPE_FLAG: {
+ if (enic->use_noscatter_vec_rx_handler)
+ return ENOTSUP;
if (overlap & MARK)
return ENOTSUP;
overlap |= MARK;
if (overlap & MARK)
return ENOTSUP;
overlap |= MARK;
@@
-1355,14
+1351,14
@@
static void
enic_dump_actions(const struct filter_action_v2 *ea)
{
if (ea->type == FILTER_ACTION_RQ_STEERING) {
enic_dump_actions(const struct filter_action_v2 *ea)
{
if (ea->type == FILTER_ACTION_RQ_STEERING) {
-
FLOW
_LOG(INFO, "Action(V1), queue: %u\n", ea->rq_idx);
+
ENICPMD
_LOG(INFO, "Action(V1), queue: %u\n", ea->rq_idx);
} else if (ea->type == FILTER_ACTION_V2) {
} else if (ea->type == FILTER_ACTION_V2) {
-
FLOW
_LOG(INFO, "Actions(V2)\n");
+
ENICPMD
_LOG(INFO, "Actions(V2)\n");
if (ea->flags & FILTER_ACTION_RQ_STEERING_FLAG)
if (ea->flags & FILTER_ACTION_RQ_STEERING_FLAG)
-
FLOW
_LOG(INFO, "\tqueue: %u\n",
+
ENICPMD
_LOG(INFO, "\tqueue: %u\n",
enic_sop_rq_idx_to_rte_idx(ea->rq_idx));
if (ea->flags & FILTER_ACTION_FILTER_ID_FLAG)
enic_sop_rq_idx_to_rte_idx(ea->rq_idx));
if (ea->flags & FILTER_ACTION_FILTER_ID_FLAG)
-
FLOW
_LOG(INFO, "\tfilter_id: %u\n", ea->filter_id);
+
ENICPMD
_LOG(INFO, "\tfilter_id: %u\n", ea->filter_id);
}
}
}
}
@@
-1378,13
+1374,13
@@
enic_dump_filter(const struct filter_v2 *filt)
switch (filt->type) {
case FILTER_IPV4_5TUPLE:
switch (filt->type) {
case FILTER_IPV4_5TUPLE:
-
FLOW
_LOG(INFO, "FILTER_IPV4_5TUPLE\n");
+
ENICPMD
_LOG(INFO, "FILTER_IPV4_5TUPLE\n");
break;
case FILTER_USNIC_IP:
case FILTER_DPDK_1:
/* FIXME: this should be a loop */
gp = &filt->u.generic_1;
break;
case FILTER_USNIC_IP:
case FILTER_DPDK_1:
/* FIXME: this should be a loop */
gp = &filt->u.generic_1;
-
FLOW
_LOG(INFO, "Filter: vlan: 0x%04x, mask: 0x%04x\n",
+
ENICPMD
_LOG(INFO, "Filter: vlan: 0x%04x, mask: 0x%04x\n",
gp->val_vlan, gp->mask_vlan);
if (gp->mask_flags & FILTER_GENERIC_1_IPV4)
gp->val_vlan, gp->mask_vlan);
if (gp->mask_flags & FILTER_GENERIC_1_IPV4)
@@
-1396,7
+1392,7
@@
enic_dump_filter(const struct filter_v2 *filt)
if (gp->mask_flags & FILTER_GENERIC_1_IPV6)
sprintf(ip6, "%s ",
if (gp->mask_flags & FILTER_GENERIC_1_IPV6)
sprintf(ip6, "%s ",
- (gp->val_flags & FILTER_GENERIC_1_IPV
4
)
+ (gp->val_flags & FILTER_GENERIC_1_IPV
6
)
? "ip6(y)" : "ip6(n)");
else
sprintf(ip6, "%s ", "ip6(x)");
? "ip6(y)" : "ip6(n)");
else
sprintf(ip6, "%s ", "ip6(x)");
@@
-1442,7
+1438,7
@@
enic_dump_filter(const struct filter_v2 *filt)
? "ipfrag(y)" : "ipfrag(n)");
else
sprintf(ipfrag, "%s ", "ipfrag(x)");
? "ipfrag(y)" : "ipfrag(n)");
else
sprintf(ipfrag, "%s ", "ipfrag(x)");
-
FLOW
_LOG(INFO, "\tFlags: %s%s%s%s%s%s%s%s\n", ip4, ip6, udp,
+
ENICPMD
_LOG(INFO, "\tFlags: %s%s%s%s%s%s%s%s\n", ip4, ip6, udp,
tcp, tcpudp, ip4csum, l4csum, ipfrag);
for (i = 0; i < FILTER_GENERIC_1_NUM_LAYERS; i++) {
tcp, tcpudp, ip4csum, l4csum, ipfrag);
for (i = 0; i < FILTER_GENERIC_1_NUM_LAYERS; i++) {
@@
-1459,7
+1455,7
@@
enic_dump_filter(const struct filter_v2 *filt)
bp += 2;
}
*bp = '\0';
bp += 2;
}
*bp = '\0';
-
FLOW
_LOG(INFO, "\tL%u mask: %s\n", i + 2, buf);
+
ENICPMD
_LOG(INFO, "\tL%u mask: %s\n", i + 2, buf);
bp = buf;
for (j = 0; j <= mbyte; j++) {
sprintf(bp, "%02x",
bp = buf;
for (j = 0; j <= mbyte; j++) {
sprintf(bp, "%02x",
@@
-1467,11
+1463,11
@@
enic_dump_filter(const struct filter_v2 *filt)
bp += 2;
}
*bp = '\0';
bp += 2;
}
*bp = '\0';
-
FLOW
_LOG(INFO, "\tL%u val: %s\n", i + 2, buf);
+
ENICPMD
_LOG(INFO, "\tL%u val: %s\n", i + 2, buf);
}
break;
default:
}
break;
default:
-
FLOW
_LOG(INFO, "FILTER UNKNOWN\n");
+
ENICPMD
_LOG(INFO, "FILTER UNKNOWN\n");
break;
}
}
break;
}
}
@@
-1513,7
+1509,7
@@
enic_flow_parse(struct rte_eth_dev *dev,
const struct enic_action_cap *enic_action_cap;
const struct rte_flow_action *action;
const struct enic_action_cap *enic_action_cap;
const struct rte_flow_action *action;
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
memset(enic_filter, 0, sizeof(*enic_filter));
memset(enic_action, 0, sizeof(*enic_action));
memset(enic_filter, 0, sizeof(*enic_filter));
memset(enic_action, 0, sizeof(*enic_action));
@@
-1602,6
+1598,8
@@
enic_flow_parse(struct rte_eth_dev *dev,
return -rte_errno;
}
enic_filter->type = enic->flow_filter_mode;
return -rte_errno;
}
enic_filter->type = enic->flow_filter_mode;
+ if (enic->adv_filters)
+ enic_filter->type = FILTER_DPDK_1;
ret = enic_copy_filter(pattern, enic_filter_cap, enic,
enic_filter, error);
return ret;
ret = enic_copy_filter(pattern, enic_filter_cap, enic,
enic_filter, error);
return ret;
@@
-1625,9
+1623,9
@@
enic_flow_add_filter(struct enic *enic, struct filter_v2 *enic_filter,
{
struct rte_flow *flow;
int err;
{
struct rte_flow *flow;
int err;
- u
16
entry;
+ u
int16_t
entry;
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
flow = rte_calloc(__func__, 1, sizeof(*flow), 0);
if (!flow) {
flow = rte_calloc(__func__, 1, sizeof(*flow), 0);
if (!flow) {
@@
-1667,10
+1665,10
@@
static int
enic_flow_del_filter(struct enic *enic, struct rte_flow *flow,
struct rte_flow_error *error)
{
enic_flow_del_filter(struct enic *enic, struct rte_flow *flow,
struct rte_flow_error *error)
{
- u
16
filter_id;
+ u
int16_t
filter_id;
int err;
int err;
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
filter_id = flow->enic_filter_id;
err = vnic_dev_classifier(enic->vdev, CLSF_DEL, &filter_id, NULL, NULL);
filter_id = flow->enic_filter_id;
err = vnic_dev_classifier(enic->vdev, CLSF_DEL, &filter_id, NULL, NULL);
@@
-1702,7
+1700,7
@@
enic_flow_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attrs,
struct filter_action_v2 enic_action;
int ret;
struct filter_action_v2 enic_action;
int ret;
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
ret = enic_flow_parse(dev, attrs, pattern, actions, error,
&enic_filter, &enic_action);
ret = enic_flow_parse(dev, attrs, pattern, actions, error,
&enic_filter, &enic_action);
@@
-1730,19
+1728,17
@@
enic_flow_create(struct rte_eth_dev *dev,
struct rte_flow *flow;
struct enic *enic = pmd_priv(dev);
struct rte_flow *flow;
struct enic *enic = pmd_priv(dev);
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
ret = enic_flow_parse(dev, attrs, pattern, actions, error, &enic_filter,
&enic_action);
if (ret < 0)
return NULL;
ret = enic_flow_parse(dev, attrs, pattern, actions, error, &enic_filter,
&enic_action);
if (ret < 0)
return NULL;
- rte_spinlock_lock(&enic->flows_lock);
flow = enic_flow_add_filter(enic, &enic_filter, &enic_action,
error);
if (flow)
LIST_INSERT_HEAD(&enic->flows, flow, next);
flow = enic_flow_add_filter(enic, &enic_filter, &enic_action,
error);
if (flow)
LIST_INSERT_HEAD(&enic->flows, flow, next);
- rte_spinlock_unlock(&enic->flows_lock);
return flow;
}
return flow;
}
@@
-1759,12
+1755,10
@@
enic_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow,
{
struct enic *enic = pmd_priv(dev);
{
struct enic *enic = pmd_priv(dev);
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
- rte_spinlock_lock(&enic->flows_lock);
enic_flow_del_filter(enic, flow, error);
LIST_REMOVE(flow, next);
enic_flow_del_filter(enic, flow, error);
LIST_REMOVE(flow, next);
- rte_spinlock_unlock(&enic->flows_lock);
rte_free(flow);
return 0;
}
rte_free(flow);
return 0;
}
@@
-1781,9
+1775,8
@@
enic_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error)
struct rte_flow *flow;
struct enic *enic = pmd_priv(dev);
struct rte_flow *flow;
struct enic *enic = pmd_priv(dev);
-
FLOW
_TRACE();
+
ENICPMD_FUNC
_TRACE();
- rte_spinlock_lock(&enic->flows_lock);
while (!LIST_EMPTY(&enic->flows)) {
flow = LIST_FIRST(&enic->flows);
while (!LIST_EMPTY(&enic->flows)) {
flow = LIST_FIRST(&enic->flows);
@@
-1791,7
+1784,6
@@
enic_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error)
LIST_REMOVE(flow, next);
rte_free(flow);
}
LIST_REMOVE(flow, next);
rte_free(flow);
}
- rte_spinlock_unlock(&enic->flows_lock);
return 0;
}
return 0;
}