* Re: [PATCH net 2/2] nfp: reject binding to shared blocks
2018-06-25 20:22 ` [PATCH net 2/2] nfp: reject binding to shared blocks Jakub Kicinski
@ 2018-06-25 20:40 ` Jiri Pirko
2018-06-25 20:50 ` Jakub Kicinski
2018-06-25 23:37 ` kbuild test robot
2018-06-26 2:04 ` kbuild test robot
2 siblings, 1 reply; 8+ messages in thread
From: Jiri Pirko @ 2018-06-25 20:40 UTC (permalink / raw)
To: Jakub Kicinski; +Cc: davem, oss-drivers, netdev, John Hurley
Mon, Jun 25, 2018 at 10:22:46PM CEST, jakub.kicinski@netronome.com wrote:
>From: John Hurley <john.hurley@netronome.com>
>
>TC shared blocks allow multiple qdiscs to be grouped together and filters
>shared between them. Currently the chains of filters attached to a block
>are only flushed when the block is removed. If a qdisc is removed from a
>block but the block still exists, flow del messages are not passed to the
>callback registered for that qdisc. For the NFP, this presents the
>possibility of rules still existing in hw when they should be removed.
>
>Prevent binding to shared blocks until the kernel can send per qdisc del
>messages when block unbinds occur.
This is not nfp-specific problem. Should be handled differently. The
driver has information about offloaded filters. On unbind, it have
enough info to do the flush, doesn't it?
>
>Fixes: 4861738775d7 ("net: sched: introduce shared filter blocks infrastructure")
>Signed-off-by: John Hurley <john.hurley@netronome.com>
>Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
>Reviewed-by: Simon Horman <simon.horman@netronome.com>
>---
> drivers/net/ethernet/netronome/nfp/bpf/main.c | 3 +++
> drivers/net/ethernet/netronome/nfp/flower/offload.c | 3 +++
> 2 files changed, 6 insertions(+)
>
>diff --git a/drivers/net/ethernet/netronome/nfp/bpf/main.c b/drivers/net/ethernet/netronome/nfp/bpf/main.c
>index fcdfb8e7fdea..6b15e3b11956 100644
>--- a/drivers/net/ethernet/netronome/nfp/bpf/main.c
>+++ b/drivers/net/ethernet/netronome/nfp/bpf/main.c
>@@ -202,6 +202,9 @@ static int nfp_bpf_setup_tc_block(struct net_device *netdev,
> if (f->binder_type != TCF_BLOCK_BINDER_TYPE_CLSACT_INGRESS)
> return -EOPNOTSUPP;
>
>+ if (tcf_block_shared(f->block))
>+ return -EOPNOTSUPP;
>+
> switch (f->command) {
> case TC_BLOCK_BIND:
> return tcf_block_cb_register(f->block,
>diff --git a/drivers/net/ethernet/netronome/nfp/flower/offload.c b/drivers/net/ethernet/netronome/nfp/flower/offload.c
>index 477f584f6d28..525057bee0ed 100644
>--- a/drivers/net/ethernet/netronome/nfp/flower/offload.c
>+++ b/drivers/net/ethernet/netronome/nfp/flower/offload.c
>@@ -631,6 +631,9 @@ static int nfp_flower_setup_tc_block(struct net_device *netdev,
> if (f->binder_type != TCF_BLOCK_BINDER_TYPE_CLSACT_INGRESS)
> return -EOPNOTSUPP;
>
>+ if (tcf_block_shared(f->block))
>+ return -EOPNOTSUPP;
>+
> switch (f->command) {
> case TC_BLOCK_BIND:
> return tcf_block_cb_register(f->block,
>--
>2.17.1
>
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH net 2/2] nfp: reject binding to shared blocks
2018-06-25 20:40 ` Jiri Pirko
@ 2018-06-25 20:50 ` Jakub Kicinski
2018-06-25 20:51 ` Jiri Pirko
0 siblings, 1 reply; 8+ messages in thread
From: Jakub Kicinski @ 2018-06-25 20:50 UTC (permalink / raw)
To: Jiri Pirko; +Cc: davem, oss-drivers, netdev, John Hurley
On Mon, 25 Jun 2018 22:40:21 +0200, Jiri Pirko wrote:
> Mon, Jun 25, 2018 at 10:22:46PM CEST, jakub.kicinski@netronome.com wrote:
> >From: John Hurley <john.hurley@netronome.com>
> >
> >TC shared blocks allow multiple qdiscs to be grouped together and filters
> >shared between them. Currently the chains of filters attached to a block
> >are only flushed when the block is removed. If a qdisc is removed from a
> >block but the block still exists, flow del messages are not passed to the
> >callback registered for that qdisc. For the NFP, this presents the
> >possibility of rules still existing in hw when they should be removed.
> >
> >Prevent binding to shared blocks until the kernel can send per qdisc del
> >messages when block unbinds occur.
>
> This is not nfp-specific problem. Should be handled differently. The
> driver has information about offloaded filters. On unbind, it have
> enough info to do the flush, doesn't it?
Certainly. But this fix is simpler and sufficient. We need to
backport it back to 4.16. If we have to go through driver tables
and flush filters we may as well merge the reoffload series to net.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net 2/2] nfp: reject binding to shared blocks
2018-06-25 20:50 ` Jakub Kicinski
@ 2018-06-25 20:51 ` Jiri Pirko
0 siblings, 0 replies; 8+ messages in thread
From: Jiri Pirko @ 2018-06-25 20:51 UTC (permalink / raw)
To: Jakub Kicinski; +Cc: davem, oss-drivers, netdev, John Hurley
Mon, Jun 25, 2018 at 10:50:14PM CEST, jakub.kicinski@netronome.com wrote:
>On Mon, 25 Jun 2018 22:40:21 +0200, Jiri Pirko wrote:
>> Mon, Jun 25, 2018 at 10:22:46PM CEST, jakub.kicinski@netronome.com wrote:
>> >From: John Hurley <john.hurley@netronome.com>
>> >
>> >TC shared blocks allow multiple qdiscs to be grouped together and filters
>> >shared between them. Currently the chains of filters attached to a block
>> >are only flushed when the block is removed. If a qdisc is removed from a
>> >block but the block still exists, flow del messages are not passed to the
>> >callback registered for that qdisc. For the NFP, this presents the
>> >possibility of rules still existing in hw when they should be removed.
>> >
>> >Prevent binding to shared blocks until the kernel can send per qdisc del
>> >messages when block unbinds occur.
>>
>> This is not nfp-specific problem. Should be handled differently. The
>> driver has information about offloaded filters. On unbind, it have
>> enough info to do the flush, doesn't it?
>
>Certainly. But this fix is simpler and sufficient. We need to
>backport it back to 4.16. If we have to go through driver tables
>and flush filters we may as well merge the reoffload series to net.
Oh, I missed this is for net. Sorry.
Acked-by: Jiri Pirko <jiri@mellanox.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net 2/2] nfp: reject binding to shared blocks
2018-06-25 20:22 ` [PATCH net 2/2] nfp: reject binding to shared blocks Jakub Kicinski
2018-06-25 20:40 ` Jiri Pirko
@ 2018-06-25 23:37 ` kbuild test robot
2018-06-26 2:04 ` kbuild test robot
2 siblings, 0 replies; 8+ messages in thread
From: kbuild test robot @ 2018-06-25 23:37 UTC (permalink / raw)
To: Jakub Kicinski
Cc: kbuild-all, davem, oss-drivers, netdev, John Hurley,
Jakub Kicinski
[-- Attachment #1: Type: text/plain, Size: 1883 bytes --]
Hi John,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on net/master]
url: https://github.com/0day-ci/linux/commits/Jakub-Kicinski/nfp-MPLS-and-shared-blocks-TC-offload-fixes/20180626-042358
config: i386-randconfig-x001-201825 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All errors (new ones prefixed by >>):
drivers/net/ethernet/netronome/nfp/flower/offload.c: In function 'nfp_flower_setup_tc_block':
>> drivers/net/ethernet/netronome/nfp/flower/offload.c:634:6: error: implicit declaration of function 'tcf_block_shared'; did you mean 'tcf_block_dev'? [-Werror=implicit-function-declaration]
if (tcf_block_shared(f->block))
^~~~~~~~~~~~~~~~
tcf_block_dev
cc1: some warnings being treated as errors
vim +634 drivers/net/ethernet/netronome/nfp/flower/offload.c
625
626 static int nfp_flower_setup_tc_block(struct net_device *netdev,
627 struct tc_block_offload *f)
628 {
629 struct nfp_repr *repr = netdev_priv(netdev);
630
631 if (f->binder_type != TCF_BLOCK_BINDER_TYPE_CLSACT_INGRESS)
632 return -EOPNOTSUPP;
633
> 634 if (tcf_block_shared(f->block))
635 return -EOPNOTSUPP;
636
637 switch (f->command) {
638 case TC_BLOCK_BIND:
639 return tcf_block_cb_register(f->block,
640 nfp_flower_setup_tc_block_cb,
641 repr, repr);
642 case TC_BLOCK_UNBIND:
643 tcf_block_cb_unregister(f->block,
644 nfp_flower_setup_tc_block_cb,
645 repr);
646 return 0;
647 default:
648 return -EOPNOTSUPP;
649 }
650 }
651
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 33423 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH net 2/2] nfp: reject binding to shared blocks
2018-06-25 20:22 ` [PATCH net 2/2] nfp: reject binding to shared blocks Jakub Kicinski
2018-06-25 20:40 ` Jiri Pirko
2018-06-25 23:37 ` kbuild test robot
@ 2018-06-26 2:04 ` kbuild test robot
2 siblings, 0 replies; 8+ messages in thread
From: kbuild test robot @ 2018-06-26 2:04 UTC (permalink / raw)
To: Jakub Kicinski
Cc: kbuild-all, davem, oss-drivers, netdev, John Hurley,
Jakub Kicinski
[-- Attachment #1: Type: text/plain, Size: 1803 bytes --]
Hi John,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on net/master]
url: https://github.com/0day-ci/linux/commits/Jakub-Kicinski/nfp-MPLS-and-shared-blocks-TC-offload-fixes/20180626-042358
config: x86_64-randconfig-u0-06260533 (attached as .config)
compiler: gcc-5 (Debian 5.5.0-3) 5.4.1 20171010
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All errors (new ones prefixed by >>):
drivers/net/ethernet/netronome/nfp/bpf/main.c: In function 'nfp_bpf_setup_tc_block':
>> drivers/net/ethernet/netronome/nfp/bpf/main.c:205:6: error: implicit declaration of function 'tcf_block_shared' [-Werror=implicit-function-declaration]
if (tcf_block_shared(f->block))
^
cc1: some warnings being treated as errors
vim +/tcf_block_shared +205 drivers/net/ethernet/netronome/nfp/bpf/main.c
196
197 static int nfp_bpf_setup_tc_block(struct net_device *netdev,
198 struct tc_block_offload *f)
199 {
200 struct nfp_net *nn = netdev_priv(netdev);
201
202 if (f->binder_type != TCF_BLOCK_BINDER_TYPE_CLSACT_INGRESS)
203 return -EOPNOTSUPP;
204
> 205 if (tcf_block_shared(f->block))
206 return -EOPNOTSUPP;
207
208 switch (f->command) {
209 case TC_BLOCK_BIND:
210 return tcf_block_cb_register(f->block,
211 nfp_bpf_setup_tc_block_cb,
212 nn, nn);
213 case TC_BLOCK_UNBIND:
214 tcf_block_cb_unregister(f->block,
215 nfp_bpf_setup_tc_block_cb,
216 nn);
217 return 0;
218 default:
219 return -EOPNOTSUPP;
220 }
221 }
222
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 33599 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread