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/tap: add in meson build
[dpdk.git]
/
drivers
/
net
/
mvpp2
/
mrvl_flow.c
diff --git
a/drivers/net/mvpp2/mrvl_flow.c
b/drivers/net/mvpp2/mrvl_flow.c
index
437c987
..
13295e6
100644
(file)
--- a/
drivers/net/mvpp2/mrvl_flow.c
+++ b/
drivers/net/mvpp2/mrvl_flow.c
@@
-394,7
+394,8
@@
mrvl_parse_init(const struct rte_flow_item *item,
*
* @param spec Pointer to the specific flow item.
* @param mask Pointer to the specific flow item's mask.
*
* @param spec Pointer to the specific flow item.
* @param mask Pointer to the specific flow item's mask.
- * @param mask Pointer to the flow.
+ * @param parse_dst Parse either destination or source mac address.
+ * @param flow Pointer to the flow.
* @return 0 in case of success, negative error value otherwise.
*/
static int
* @return 0 in case of success, negative error value otherwise.
*/
static int
@@
-613,6
+614,7
@@
mrvl_parse_ip4_dscp(const struct rte_flow_item_ipv4 *spec,
*
* @param spec Pointer to the specific flow item.
* @param mask Pointer to the specific flow item's mask.
*
* @param spec Pointer to the specific flow item.
* @param mask Pointer to the specific flow item's mask.
+ * @param parse_dst Parse either destination or source ip address.
* @param flow Pointer to the flow.
* @return 0 in case of success, negative error value otherwise.
*/
* @param flow Pointer to the flow.
* @return 0 in case of success, negative error value otherwise.
*/
@@
-726,6
+728,7
@@
mrvl_parse_ip4_proto(const struct rte_flow_item_ipv4 *spec,
*
* @param spec Pointer to the specific flow item.
* @param mask Pointer to the specific flow item's mask.
*
* @param spec Pointer to the specific flow item.
* @param mask Pointer to the specific flow item's mask.
+ * @param parse_dst Parse either destination or source ipv6 address.
* @param flow Pointer to the flow.
* @return 0 in case of success, negative error value otherwise.
*/
* @param flow Pointer to the flow.
* @return 0 in case of success, negative error value otherwise.
*/
@@
-874,6
+877,7
@@
mrvl_parse_ip6_next_hdr(const struct rte_flow_item_ipv6 *spec,
*
* @param spec Pointer to the specific flow item.
* @param mask Pointer to the specific flow item's mask.
*
* @param spec Pointer to the specific flow item.
* @param mask Pointer to the specific flow item's mask.
+ * @param parse_dst Parse either destination or source port.
* @param flow Pointer to the flow.
* @return 0 in case of success, negative error value otherwise.
*/
* @param flow Pointer to the flow.
* @return 0 in case of success, negative error value otherwise.
*/
@@
-949,6
+953,7
@@
mrvl_parse_tcp_dport(const struct rte_flow_item_tcp *spec,
*
* @param spec Pointer to the specific flow item.
* @param mask Pointer to the specific flow item's mask.
*
* @param spec Pointer to the specific flow item.
* @param mask Pointer to the specific flow item's mask.
+ * @param parse_dst Parse either destination or source port.
* @param flow Pointer to the flow.
* @return 0 in case of success, negative error value otherwise.
*/
* @param flow Pointer to the flow.
* @return 0 in case of success, negative error value otherwise.
*/
@@
-1022,7
+1027,6
@@
mrvl_parse_udp_dport(const struct rte_flow_item_udp *spec,
* @param item Pointer to the flow item.
* @param flow Pointer to the flow.
* @param error Pointer to the flow error.
* @param item Pointer to the flow item.
* @param flow Pointer to the flow.
* @param error Pointer to the flow error.
- * @param fields Pointer to the parsed parsed fields enum.
* @returns 0 on success, negative value otherwise.
*/
static int
* @returns 0 on success, negative value otherwise.
*/
static int
@@
-1054,7
+1058,7
@@
mrvl_parse_eth(const struct rte_flow_item *item, struct rte_flow *flow,
}
if (mask->type) {
}
if (mask->type) {
-
RTE_LOG(WARNING, PMD, "eth type mask is ignored\n
");
+
MRVL_LOG(WARNING, "eth type mask is ignored
");
ret = mrvl_parse_type(spec, mask, flow);
if (ret)
goto out;
ret = mrvl_parse_type(spec, mask, flow);
if (ret)
goto out;
@@
-1073,7
+1077,6
@@
out:
* @param item Pointer to the flow item.
* @param flow Pointer to the flow.
* @param error Pointer to the flow error.
* @param item Pointer to the flow item.
* @param flow Pointer to the flow.
* @param error Pointer to the flow error.
- * @param fields Pointer to the parsed parsed fields enum.
* @returns 0 on success, negative value otherwise.
*/
static int
* @returns 0 on success, negative value otherwise.
*/
static int
@@
-1093,14
+1096,14
@@
mrvl_parse_vlan(const struct rte_flow_item *item,
m = rte_be_to_cpu_16(mask->tci);
if (m & MRVL_VLAN_ID_MASK) {
m = rte_be_to_cpu_16(mask->tci);
if (m & MRVL_VLAN_ID_MASK) {
-
RTE_LOG(WARNING, PMD, "vlan id mask is ignored\n
");
+
MRVL_LOG(WARNING, "vlan id mask is ignored
");
ret = mrvl_parse_vlan_id(spec, mask, flow);
if (ret)
goto out;
}
if (m & MRVL_VLAN_PRI_MASK) {
ret = mrvl_parse_vlan_id(spec, mask, flow);
if (ret)
goto out;
}
if (m & MRVL_VLAN_PRI_MASK) {
-
RTE_LOG(WARNING, PMD, "vlan pri mask is ignored\n
");
+
MRVL_LOG(WARNING, "vlan pri mask is ignored
");
ret = mrvl_parse_vlan_pri(spec, mask, flow);
if (ret)
goto out;
ret = mrvl_parse_vlan_pri(spec, mask, flow);
if (ret)
goto out;
@@
-1109,7
+1112,7
@@
mrvl_parse_vlan(const struct rte_flow_item *item,
if (flow->pattern & F_TYPE) {
rte_flow_error_set(error, ENOTSUP,
RTE_FLOW_ERROR_TYPE_ITEM, item,
if (flow->pattern & F_TYPE) {
rte_flow_error_set(error, ENOTSUP,
RTE_FLOW_ERROR_TYPE_ITEM, item,
- "VLAN TPID matching is not supported
\n
");
+ "VLAN TPID matching is not supported");
return -rte_errno;
}
if (mask->inner_type) {
return -rte_errno;
}
if (mask->inner_type) {
@@
-1120,7
+1123,7
@@
mrvl_parse_vlan(const struct rte_flow_item *item,
.type = mask->inner_type,
};
.type = mask->inner_type,
};
-
RTE_LOG(WARNING, PMD, "inner eth type mask is ignored\n
");
+
MRVL_LOG(WARNING, "inner eth type mask is ignored
");
ret = mrvl_parse_type(&spec_eth, &mask_eth, flow);
if (ret)
goto out;
ret = mrvl_parse_type(&spec_eth, &mask_eth, flow);
if (ret)
goto out;
@@
-1139,7
+1142,6
@@
out:
* @param item Pointer to the flow item.
* @param flow Pointer to the flow.
* @param error Pointer to the flow error.
* @param item Pointer to the flow item.
* @param flow Pointer to the flow.
* @param error Pointer to the flow error.
- * @param fields Pointer to the parsed parsed fields enum.
* @returns 0 on success, negative value otherwise.
*/
static int
* @returns 0 on success, negative value otherwise.
*/
static int
@@
-1186,7
+1188,7
@@
mrvl_parse_ip4(const struct rte_flow_item *item,
}
if (mask->hdr.next_proto_id) {
}
if (mask->hdr.next_proto_id) {
-
RTE_LOG(WARNING, PMD, "next proto id mask is ignored\n
");
+
MRVL_LOG(WARNING, "next proto id mask is ignored
");
ret = mrvl_parse_ip4_proto(spec, mask, flow);
if (ret)
goto out;
ret = mrvl_parse_ip4_proto(spec, mask, flow);
if (ret)
goto out;
@@
-1205,7
+1207,6
@@
out:
* @param item Pointer to the flow item.
* @param flow Pointer to the flow.
* @param error Pointer to the flow error.
* @param item Pointer to the flow item.
* @param flow Pointer to the flow.
* @param error Pointer to the flow error.
- * @param fields Pointer to the parsed parsed fields enum.
* @returns 0 on success, negative value otherwise.
*/
static int
* @returns 0 on success, negative value otherwise.
*/
static int
@@
-1257,7
+1258,7
@@
mrvl_parse_ip6(const struct rte_flow_item *item,
}
if (mask->hdr.proto) {
}
if (mask->hdr.proto) {
-
RTE_LOG(WARNING, PMD, "next header mask is ignored\n
");
+
MRVL_LOG(WARNING, "next header mask is ignored
");
ret = mrvl_parse_ip6_next_hdr(spec, mask, flow);
if (ret)
goto out;
ret = mrvl_parse_ip6_next_hdr(spec, mask, flow);
if (ret)
goto out;
@@
-1276,7
+1277,6
@@
out:
* @param item Pointer to the flow item.
* @param flow Pointer to the flow.
* @param error Pointer to the flow error.
* @param item Pointer to the flow item.
* @param flow Pointer to the flow.
* @param error Pointer to the flow error.
- * @param fields Pointer to the parsed parsed fields enum.
* @returns 0 on success, negative value otherwise.
*/
static int
* @returns 0 on success, negative value otherwise.
*/
static int
@@
-1306,14
+1306,14
@@
mrvl_parse_tcp(const struct rte_flow_item *item,
}
if (mask->hdr.src_port) {
}
if (mask->hdr.src_port) {
-
RTE_LOG(WARNING, PMD, "tcp sport mask is ignored\n
");
+
MRVL_LOG(WARNING, "tcp sport mask is ignored
");
ret = mrvl_parse_tcp_sport(spec, mask, flow);
if (ret)
goto out;
}
if (mask->hdr.dst_port) {
ret = mrvl_parse_tcp_sport(spec, mask, flow);
if (ret)
goto out;
}
if (mask->hdr.dst_port) {
-
RTE_LOG(WARNING, PMD, "tcp dport mask is ignored\n
");
+
MRVL_LOG(WARNING, "tcp dport mask is ignored
");
ret = mrvl_parse_tcp_dport(spec, mask, flow);
if (ret)
goto out;
ret = mrvl_parse_tcp_dport(spec, mask, flow);
if (ret)
goto out;
@@
-1332,7
+1332,6
@@
out:
* @param item Pointer to the flow item.
* @param flow Pointer to the flow.
* @param error Pointer to the flow error.
* @param item Pointer to the flow item.
* @param flow Pointer to the flow.
* @param error Pointer to the flow error.
- * @param fields Pointer to the parsed parsed fields enum.
* @returns 0 on success, negative value otherwise.
*/
static int
* @returns 0 on success, negative value otherwise.
*/
static int
@@
-1357,14
+1356,14
@@
mrvl_parse_udp(const struct rte_flow_item *item,
}
if (mask->hdr.src_port) {
}
if (mask->hdr.src_port) {
-
RTE_LOG(WARNING, PMD, "udp sport mask is ignored\n
");
+
MRVL_LOG(WARNING, "udp sport mask is ignored
");
ret = mrvl_parse_udp_sport(spec, mask, flow);
if (ret)
goto out;
}
if (mask->hdr.dst_port) {
ret = mrvl_parse_udp_sport(spec, mask, flow);
if (ret)
goto out;
}
if (mask->hdr.dst_port) {
-
RTE_LOG(WARNING, PMD, "udp dport mask is ignored\n
");
+
MRVL_LOG(WARNING, "udp dport mask is ignored
");
ret = mrvl_parse_udp_dport(spec, mask, flow);
if (ret)
goto out;
ret = mrvl_parse_udp_dport(spec, mask, flow);
if (ret)
goto out;
@@
-1981,6
+1980,7
@@
mrvl_parse_pattern_ip6_tcp(const struct rte_flow_item pattern[],
* @param pattern Pointer to the flow pattern table.
* @param flow Pointer to the flow.
* @param error Pointer to the flow error.
* @param pattern Pointer to the flow pattern table.
* @param flow Pointer to the flow.
* @param error Pointer to the flow error.
+ * @param ip6 1 to parse ip6 item, 0 to parse ip4 item.
* @returns 0 in case of success, negative value otherwise.
*/
static int
* @returns 0 in case of success, negative value otherwise.
*/
static int
@@
-2280,8
+2280,8
@@
mrvl_flow_parse_actions(struct mrvl_priv *priv,
* Unknown TC mapping, mapping will not have
* a correct queue.
*/
* Unknown TC mapping, mapping will not have
* a correct queue.
*/
-
RTE_LOG(ERR, PMD
,
- "Unknown TC mapping for queue %hu eth%hhu
\n
",
+
MRVL_LOG(ERR
,
+ "Unknown TC mapping for queue %hu eth%hhu",
q->index, priv->ppio_id);
rte_flow_error_set(error, EFAULT,
q->index, priv->ppio_id);
rte_flow_error_set(error, EFAULT,
@@
-2290,8
+2290,8
@@
mrvl_flow_parse_actions(struct mrvl_priv *priv,
return -rte_errno;
}
return -rte_errno;
}
-
RTE_LOG(DEBUG, PMD
,
- "Action: Assign packets to queue %d, tc:%d, q:%d
\n
",
+
MRVL_LOG(DEBUG
,
+ "Action: Assign packets to queue %d, tc:%d, q:%d",
q->index, priv->rxq_map[q->index].tc,
priv->rxq_map[q->index].inq);
q->index, priv->rxq_map[q->index].tc,
priv->rxq_map[q->index].inq);
@@
-2350,6
+2350,12
@@
mrvl_flow_parse(struct mrvl_priv *priv, const struct rte_flow_attr *attr,
return mrvl_flow_parse_actions(priv, actions, flow, error);
}
return mrvl_flow_parse_actions(priv, actions, flow, error);
}
+/**
+ * Get engine type for the given flow.
+ *
+ * @param field Pointer to the flow.
+ * @returns The type of the engine.
+ */
static inline enum pp2_cls_tbl_type
mrvl_engine_type(const struct rte_flow *flow)
{
static inline enum pp2_cls_tbl_type
mrvl_engine_type(const struct rte_flow *flow)
{
@@
-2369,6
+2375,13
@@
mrvl_engine_type(const struct rte_flow *flow)
return PP2_CLS_TBL_MASKABLE;
}
return PP2_CLS_TBL_MASKABLE;
}
+/**
+ * Create classifier table.
+ *
+ * @param dev Pointer to the device.
+ * @param flow Pointer to the very first flow.
+ * @returns 0 in case of success, negative value otherwise.
+ */
static int
mrvl_create_cls_table(struct rte_eth_dev *dev, struct rte_flow *first_flow)
{
static int
mrvl_create_cls_table(struct rte_eth_dev *dev, struct rte_flow *first_flow)
{
@@
-2384,7
+2397,7
@@
mrvl_create_cls_table(struct rte_eth_dev *dev, struct rte_flow *first_flow)
memset(&priv->cls_tbl_params, 0, sizeof(priv->cls_tbl_params));
priv->cls_tbl_params.type = mrvl_engine_type(first_flow);
memset(&priv->cls_tbl_params, 0, sizeof(priv->cls_tbl_params));
priv->cls_tbl_params.type = mrvl_engine_type(first_flow);
-
RTE_LOG(INFO, PMD, "Setting cls search engine type to %s\n
",
+
MRVL_LOG(INFO, "Setting cls search engine type to %s
",
priv->cls_tbl_params.type == PP2_CLS_TBL_EXACT_MATCH ?
"exact" : "maskable");
priv->cls_tbl_params.max_num_rules = MRVL_CLS_MAX_NUM_RULES;
priv->cls_tbl_params.type == PP2_CLS_TBL_EXACT_MATCH ?
"exact" : "maskable");
priv->cls_tbl_params.max_num_rules = MRVL_CLS_MAX_NUM_RULES;
@@
-2655,7
+2668,7
@@
mrvl_flow_remove(struct mrvl_priv *priv, struct rte_flow *flow,
/**
* DPDK flow destroy callback called when flow is to be removed.
*
/**
* DPDK flow destroy callback called when flow is to be removed.
*
- * @param
priv Pointer to the port's private data
.
+ * @param
dev Pointer to the device
.
* @param flow Pointer to the flow.
* @param error Pointer to the flow error.
* @returns 0 in case of success, negative value otherwise.
* @param flow Pointer to the flow.
* @param error Pointer to the flow error.
* @returns 0 in case of success, negative value otherwise.