Re: [Patch net-next] act_mirred: use tcfm_dev in tcf_mirred_get_dev()

2017-12-02 Thread Jiri Pirko
Sat, Dec 02, 2017 at 08:53:20PM CET, xiyou.wangc...@gmail.com wrote: >On Sat, Dec 2, 2017 at 11:47 AM, Cong Wang wrote: >> On Sat, Dec 2, 2017 at 12:57 AM, Jiri Pirko wrote: >>> Good. Please also use m->tcfm_dev->ifindex in tcf_mirred_dump and >>>

Re: [Patch net-next] act_mirred: use tcfm_dev in tcf_mirred_get_dev()

2017-12-02 Thread Cong Wang
On Sat, Dec 2, 2017 at 11:47 AM, Cong Wang wrote: > On Sat, Dec 2, 2017 at 12:57 AM, Jiri Pirko wrote: >> Good. Please also use m->tcfm_dev->ifindex in tcf_mirred_dump and >> tcf_mirred_ifindex. Then you can remove tcfm_ifindex completely. > > Sounds

Re: [Patch net-next] act_mirred: use tcfm_dev in tcf_mirred_get_dev()

2017-12-02 Thread Cong Wang
On Sat, Dec 2, 2017 at 12:57 AM, Jiri Pirko wrote: > Good. Please also use m->tcfm_dev->ifindex in tcf_mirred_dump and > tcf_mirred_ifindex. Then you can remove tcfm_ifindex completely. Sounds good. Will send v2.

Re: [Patch net-next] act_mirred: use tcfm_dev in tcf_mirred_get_dev()

2017-12-02 Thread Jiri Pirko
Thu, Nov 30, 2017 at 11:53:32PM CET, xiyou.wangc...@gmail.com wrote: >tcfm_dev always points to the correct netdev and we already >hold a refcnt, so no need to use ifindex to lookup again. > >If we would support moving target netdev across netns, using >pointer would be better than ifindex. > >Cc:

Re: [Patch net-next] act_mirred: use tcfm_dev in tcf_mirred_get_dev()

2017-12-01 Thread Jiri Pirko
Fri, Dec 01, 2017 at 10:46:42PM CET, xiyou.wangc...@gmail.com wrote: >On Fri, Dec 1, 2017 at 9:56 AM, Jiri Pirko wrote: >> >> Isn't this here so user may specify a ifindex of netdev which is not yet >> present on the system (not sure how much sense that would make though...) >

Re: [Patch net-next] act_mirred: use tcfm_dev in tcf_mirred_get_dev()

2017-12-01 Thread Cong Wang
On Fri, Dec 1, 2017 at 9:56 AM, Jiri Pirko wrote: > > Isn't this here so user may specify a ifindex of netdev which is not yet > present on the system (not sure how much sense that would make though...) How is this even possible? If an ifindex is not present, we return ENODEV:

Re: [Patch net-next] act_mirred: use tcfm_dev in tcf_mirred_get_dev()

2017-12-01 Thread Jiri Pirko
Thu, Nov 30, 2017 at 11:53:32PM CET, xiyou.wangc...@gmail.com wrote: >tcfm_dev always points to the correct netdev and we already >hold a refcnt, so no need to use ifindex to lookup again. > >If we would support moving target netdev across netns, using >pointer would be better than ifindex. > >Cc:

[Patch net-next] act_mirred: use tcfm_dev in tcf_mirred_get_dev()

2017-11-30 Thread Cong Wang
tcfm_dev always points to the correct netdev and we already hold a refcnt, so no need to use ifindex to lookup again. If we would support moving target netdev across netns, using pointer would be better than ifindex. Cc: Jiri Pirko Cc: Jamal Hadi Salim