On 11/04/2017 10:55 AM, Jiri Pirko wrote:
Fri, Nov 03, 2017 at 09:15:54PM CET, dan...@iogearbox.net wrote:
On 11/03/2017 06:19 PM, Jiri Pirko wrote:
From: Jiri Pirko <j...@mellanox.com>

Couple of classifiers call netif_keep_dst directly on q->dev. That is
not possible to do directly for shared blocke where multiple qdiscs are
owning the block. So introduce a infrastructure to keep track of the
block owners in list and use this list to implement block variant of
netif_keep_dst.

Signed-off-by: Jiri Pirko <j...@mellanox.com>
[...]
+struct tcf_block_owner_item {
+       struct list_head list;
+       struct Qdisc *q;
+       enum tcf_block_binder_type binder_type;
+};
+
+static void
+tcf_block_owner_netif_keep_dst(struct tcf_block *block,
+                              struct Qdisc *q,
+                              enum tcf_block_binder_type binder_type)
+{
+       if (block->keep_dst &&
+           binder_type != TCF_BLOCK_BINDER_TYPE_CLSACT_INGRESS)

Why we need to keep dst on TCF_BLOCK_BINDER_TYPE_CLSACT_EGRESS ?
I presume this enum means sch_handle_egress() ? dst is dropped
later ...

This is because of the bpf check:
        if (fp->dst_needed && !(tp->q->flags & TCQ_F_INGRESS))
                netif_keep_dst(qdisc_dev(tp->q));

I just maintain the same logic here.

No, that's a wrong claim, really ...

clsact in general hooks into the same logic as ingress, so TC_H_CLSACT
as major needs to reuse TC_H_INGRESS, and qdiscs set up as such set
TCQ_F_INGRESS as flags. For clsact that means both your block binder
types for clsact here (ingress/egress).

Please make sure that your other changes don't have similar assumption.

Reply via email to