Skip to content

Commit d6883bc

Browse files
Asbjørn Sloth Tønnesenkuba-moo
authored andcommitted
net: qede: use extack in qede_parse_flow_attr()
Convert qede_parse_flow_attr() to take extack, and drop the edev argument. Convert DP_NOTICE calls to use NL_SET_ERR_MSG_* instead. Pass extack in calls to qede_flow_parse_{tcp,udp}_v{4,6}(). In calls to qede_parse_flow_attr(), if extack is unavailable, then use NULL for now, until a subsequent patch makes extack available. Only compile tested. Signed-off-by: Asbjørn Sloth Tønnesen <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent f833a65 commit d6883bc

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

drivers/net/ethernet/qlogic/qede/qede_filter.c

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1826,8 +1826,9 @@ qede_flow_parse_udp_v4(struct flow_rule *rule, struct qede_arfs_tuple *tuple,
18261826
}
18271827

18281828
static int
1829-
qede_parse_flow_attr(struct qede_dev *edev, __be16 proto,
1830-
struct flow_rule *rule, struct qede_arfs_tuple *tuple)
1829+
qede_parse_flow_attr(__be16 proto, struct flow_rule *rule,
1830+
struct qede_arfs_tuple *tuple,
1831+
struct netlink_ext_ack *extack)
18311832
{
18321833
struct flow_dissector *dissector = rule->match.dissector;
18331834
int rc = -EINVAL;
@@ -1841,14 +1842,15 @@ qede_parse_flow_attr(struct qede_dev *edev, __be16 proto,
18411842
BIT_ULL(FLOW_DISSECTOR_KEY_BASIC) |
18421843
BIT_ULL(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
18431844
BIT_ULL(FLOW_DISSECTOR_KEY_PORTS))) {
1844-
DP_NOTICE(edev, "Unsupported key set:0x%llx\n",
1845-
dissector->used_keys);
1845+
NL_SET_ERR_MSG_FMT_MOD(extack, "Unsupported key used: 0x%llx",
1846+
dissector->used_keys);
18461847
return -EOPNOTSUPP;
18471848
}
18481849

18491850
if (proto != htons(ETH_P_IP) &&
18501851
proto != htons(ETH_P_IPV6)) {
1851-
DP_NOTICE(edev, "Unsupported proto=0x%x\n", proto);
1852+
NL_SET_ERR_MSG_FMT_MOD(extack, "Unsupported proto=0x%x",
1853+
proto);
18521854
return -EPROTONOSUPPORT;
18531855
}
18541856

@@ -1860,15 +1862,15 @@ qede_parse_flow_attr(struct qede_dev *edev, __be16 proto,
18601862
}
18611863

18621864
if (ip_proto == IPPROTO_TCP && proto == htons(ETH_P_IP))
1863-
rc = qede_flow_parse_tcp_v4(rule, tuple, NULL);
1865+
rc = qede_flow_parse_tcp_v4(rule, tuple, extack);
18641866
else if (ip_proto == IPPROTO_TCP && proto == htons(ETH_P_IPV6))
1865-
rc = qede_flow_parse_tcp_v6(rule, tuple, NULL);
1867+
rc = qede_flow_parse_tcp_v6(rule, tuple, extack);
18661868
else if (ip_proto == IPPROTO_UDP && proto == htons(ETH_P_IP))
1867-
rc = qede_flow_parse_udp_v4(rule, tuple, NULL);
1869+
rc = qede_flow_parse_udp_v4(rule, tuple, extack);
18681870
else if (ip_proto == IPPROTO_UDP && proto == htons(ETH_P_IPV6))
1869-
rc = qede_flow_parse_udp_v6(rule, tuple, NULL);
1871+
rc = qede_flow_parse_udp_v6(rule, tuple, extack);
18701872
else
1871-
DP_NOTICE(edev, "Invalid protocol request\n");
1873+
NL_SET_ERR_MSG_MOD(extack, "Invalid protocol request");
18721874

18731875
return rc;
18741876
}
@@ -1889,7 +1891,7 @@ int qede_add_tc_flower_fltr(struct qede_dev *edev, __be16 proto,
18891891
}
18901892

18911893
/* parse flower attribute and prepare filter */
1892-
rc = qede_parse_flow_attr(edev, proto, f->rule, &t);
1894+
rc = qede_parse_flow_attr(proto, f->rule, &t, extack);
18931895
if (rc)
18941896
goto unlock;
18951897

@@ -2015,7 +2017,7 @@ static int qede_flow_spec_to_rule(struct qede_dev *edev,
20152017
if (IS_ERR(flow))
20162018
return PTR_ERR(flow);
20172019

2018-
err = qede_parse_flow_attr(edev, proto, flow->rule, t);
2020+
err = qede_parse_flow_attr(proto, flow->rule, t, NULL);
20192021
if (err)
20202022
goto err_out;
20212023

0 commit comments

Comments
 (0)