diff mbox series

[v6,net-next,04/12] flow_offload: return EOPNOTSUPP for the unsupported mpls action type

Message ID 20211209092806.12336-5-simon.horman@corigine.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series allow user to offload tc action to net device | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 9 this patch: 9
netdev/cc_maintainers warning 2 maintainers not CCed: kuba@kernel.org davem@davemloft.net
netdev/build_clang success Errors and warnings before: 20 this patch: 20
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 11 this patch: 11
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Simon Horman Dec. 9, 2021, 9:27 a.m. UTC
From: Baowen Zheng <baowen.zheng@corigine.com>

We need to return EOPNOTSUPP for the unsupported mpls action type when
setup the flow action.

In the original implement, we will return 0 for the unsupported mpls
action type, actually we do not setup it and the following actions
to the flow action entry.

Signed-off-by: Baowen Zheng <baowen.zheng@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
---
 net/sched/cls_api.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jamal Hadi Salim Dec. 11, 2021, 7:10 p.m. UTC | #1
On 2021-12-09 04:27, Simon Horman wrote:
> From: Baowen Zheng <baowen.zheng@corigine.com>
> 
> We need to return EOPNOTSUPP for the unsupported mpls action type when
> setup the flow action.
> 
> In the original implement, we will return 0 for the unsupported mpls
> action type, actually we do not setup it and the following actions
> to the flow action entry.
> 
> Signed-off-by: Baowen Zheng <baowen.zheng@corigine.com>
> Signed-off-by: Simon Horman <simon.horman@corigine.com>


Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>

cheers,
jamal
Roi Dayan Dec. 12, 2021, 12:41 p.m. UTC | #2
On 2021-12-09 11:27 AM, Simon Horman wrote:
> From: Baowen Zheng <baowen.zheng@corigine.com>
> 
> We need to return EOPNOTSUPP for the unsupported mpls action type when
> setup the flow action.
> 
> In the original implement, we will return 0 for the unsupported mpls
> action type, actually we do not setup it and the following actions
> to the flow action entry.
> 
> Signed-off-by: Baowen Zheng <baowen.zheng@corigine.com>
> Signed-off-by: Simon Horman <simon.horman@corigine.com>
> ---
>   net/sched/cls_api.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
> index d9d6ff0bf361..7a680cae0bae 100644
> --- a/net/sched/cls_api.c
> +++ b/net/sched/cls_api.c
> @@ -3687,6 +3687,7 @@ int tc_setup_flow_action(struct flow_action *flow_action,
>   				entry->mpls_mangle.ttl = tcf_mpls_ttl(act);
>   				break;
>   			default:
> +				err = -EOPNOTSUPP;
>   				goto err_out_locked;
>   			}
>   		} else if (is_tcf_skbedit_ptype(act)) {

should we have this commit in net branch with a fixes line
so it will be taken also to stable kernels?

6749d5901698 net: sched: include mpls actions in hardware intermediate 
representation
Simon Horman Dec. 13, 2021, 2:49 p.m. UTC | #3
On Sun, Dec 12, 2021 at 02:41:53PM +0200, Roi Dayan wrote:
> 
> 
> On 2021-12-09 11:27 AM, Simon Horman wrote:
> > From: Baowen Zheng <baowen.zheng@corigine.com>
> > 
> > We need to return EOPNOTSUPP for the unsupported mpls action type when
> > setup the flow action.
> > 
> > In the original implement, we will return 0 for the unsupported mpls
> > action type, actually we do not setup it and the following actions
> > to the flow action entry.
> > 
> > Signed-off-by: Baowen Zheng <baowen.zheng@corigine.com>
> > Signed-off-by: Simon Horman <simon.horman@corigine.com>
> > ---
> >   net/sched/cls_api.c | 1 +
> >   1 file changed, 1 insertion(+)
> > 
> > diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
> > index d9d6ff0bf361..7a680cae0bae 100644
> > --- a/net/sched/cls_api.c
> > +++ b/net/sched/cls_api.c
> > @@ -3687,6 +3687,7 @@ int tc_setup_flow_action(struct flow_action *flow_action,
> >   				entry->mpls_mangle.ttl = tcf_mpls_ttl(act);
> >   				break;
> >   			default:
> > +				err = -EOPNOTSUPP;
> >   				goto err_out_locked;
> >   			}
> >   		} else if (is_tcf_skbedit_ptype(act)) {
> 
> should we have this commit in net branch with a fixes line
> so it will be taken also to stable kernels?
> 
> 6749d5901698 net: sched: include mpls actions in hardware intermediate
> representation

Thanks Roi,

I think that is a good idea and I have submitted the patch accordingly.

https://lore.kernel.org/netdev/20211213144604.23888-1-simon.horman@corigine.com/

FWIIW, I believe the problem was introduced by:

cba370a93684 ("flow_offload: return EOPNOTSUPP for the unsupported mpls action type")
diff mbox series

Patch

diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index d9d6ff0bf361..7a680cae0bae 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -3687,6 +3687,7 @@  int tc_setup_flow_action(struct flow_action *flow_action,
 				entry->mpls_mangle.ttl = tcf_mpls_ttl(act);
 				break;
 			default:
+				err = -EOPNOTSUPP;
 				goto err_out_locked;
 			}
 		} else if (is_tcf_skbedit_ptype(act)) {