Commit b8672475 authored by David S. Miller's avatar David S. Miller

Merge branch 'qed-error-codes'

Asbjørn Sloth Tønnesen says:

====================
net: qede: avoid overruling error codes

This series fixes the qede driver, so that
qede_parse_flow_attr() and it's subfunctions
doesn't get their error codes overruled
(ie. turning -EOPNOTSUPP into -EINVAL).

---
I have two more patches along the same lines,
but they are not yet causing any issues,
so I have them destined for net-next.
(those are for qede_flow_spec_validate_unused()
and qede_flow_parse_ports().)

After that I have a series for converting to
extack + the final one for validating control
flags.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 16f50301 f26f719a
...@@ -1868,8 +1868,8 @@ int qede_add_tc_flower_fltr(struct qede_dev *edev, __be16 proto, ...@@ -1868,8 +1868,8 @@ int qede_add_tc_flower_fltr(struct qede_dev *edev, __be16 proto,
struct flow_cls_offload *f) struct flow_cls_offload *f)
{ {
struct qede_arfs_fltr_node *n; struct qede_arfs_fltr_node *n;
int min_hlen, rc = -EINVAL;
struct qede_arfs_tuple t; struct qede_arfs_tuple t;
int min_hlen, rc;
__qede_lock(edev); __qede_lock(edev);
...@@ -1879,7 +1879,8 @@ int qede_add_tc_flower_fltr(struct qede_dev *edev, __be16 proto, ...@@ -1879,7 +1879,8 @@ int qede_add_tc_flower_fltr(struct qede_dev *edev, __be16 proto,
} }
/* parse flower attribute and prepare filter */ /* parse flower attribute and prepare filter */
if (qede_parse_flow_attr(edev, proto, f->rule, &t)) rc = qede_parse_flow_attr(edev, proto, f->rule, &t);
if (rc)
goto unlock; goto unlock;
/* Validate profile mode and number of filters */ /* Validate profile mode and number of filters */
...@@ -1888,11 +1889,13 @@ int qede_add_tc_flower_fltr(struct qede_dev *edev, __be16 proto, ...@@ -1888,11 +1889,13 @@ int qede_add_tc_flower_fltr(struct qede_dev *edev, __be16 proto,
DP_NOTICE(edev, DP_NOTICE(edev,
"Filter configuration invalidated, filter mode=0x%x, configured mode=0x%x, filter count=0x%x\n", "Filter configuration invalidated, filter mode=0x%x, configured mode=0x%x, filter count=0x%x\n",
t.mode, edev->arfs->mode, edev->arfs->filter_count); t.mode, edev->arfs->mode, edev->arfs->filter_count);
rc = -EINVAL;
goto unlock; goto unlock;
} }
/* parse tc actions and get the vf_id */ /* parse tc actions and get the vf_id */
if (qede_parse_actions(edev, &f->rule->action, f->common.extack)) rc = qede_parse_actions(edev, &f->rule->action, f->common.extack);
if (rc)
goto unlock; goto unlock;
if (qede_flow_find_fltr(edev, &t)) { if (qede_flow_find_fltr(edev, &t)) {
...@@ -1998,10 +2001,9 @@ static int qede_flow_spec_to_rule(struct qede_dev *edev, ...@@ -1998,10 +2001,9 @@ static int qede_flow_spec_to_rule(struct qede_dev *edev,
if (IS_ERR(flow)) if (IS_ERR(flow))
return PTR_ERR(flow); return PTR_ERR(flow);
if (qede_parse_flow_attr(edev, proto, flow->rule, t)) { err = qede_parse_flow_attr(edev, proto, flow->rule, t);
err = -EINVAL; if (err)
goto err_out; goto err_out;
}
/* Make sure location is valid and filter isn't already set */ /* Make sure location is valid and filter isn't already set */
err = qede_flow_spec_validate(edev, &flow->rule->action, t, err = qede_flow_spec_validate(edev, &flow->rule->action, t,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment