Hello all,

I am using DPDK 25.11 with Mellanox MT2892 [ConnectX-6 Dx].

I am trying to use rte_flow_query() to query the COUNT action of the flows I 
created. It seems like I can query only from the worker lcores, not the main 
lcore, even though the flows are created in the main lcore. When the main lcore 
queries it, it always returns -ENOTSUP, but when the worker lcores query it, it 
returns -ENOTSUP only once, and then they can get the answer to the 
rte_flow_query() in further calls. I would appreciate your help in 
understanding the reasoning behind this and seeing if this can be circumvented.

I'd also like to add that rte_eth_rx_burst() is called only from the worker 
lcores, although I tried calling it from the main lcore a couple of times, 
which didn't resolve the issue.

This is how I create the flows:

static rte_flow* create_drop_flow(uint16_t port_id) {
    struct rte_flow_error flow_error;
    struct rte_flow_attr flow_attr;
    flow_attr.priority = 1;
    flow_attr.ingress = 1;

    struct rte_flow_item items[] = {
        {
            .type = RTE_FLOW_ITEM_TYPE_END,
            .spec = NULL,
            .last = NULL,
            .mask = NULL
        }
    };

    struct rte_flow_action actions[] = {
        {
            .type = RTE_FLOW_ACTION_TYPE_COUNT,
            .conf = NULL
        },
        {
            .type = RTE_FLOW_ACTION_TYPE_DROP,
            .conf = NULL
        },
        {
            .type = RTE_FLOW_ACTION_TYPE_END,
            .conf = NULL
        }
    };

    int ret = rte_flow_validate(port_id, &flow_attr, items, actions, 
&flow_error);

    if (ret != 0) {
        printf(
            "Drop Flow validation failed on port %d: %s\n%s\n",
            port_id,
            rte_strerror(-ret),
            flow_error.message ? flow_error.message : "No additional error 
message"
        );
    }

    struct rte_flow *flow = rte_flow_create(port_id, &flow_attr, items, 
actions, &flow_error);

    if (flow == nullptr) {
        printf(
            "Drop Flow creation failed on port %d: %s\n%s\n",
            port_id,
            rte_strerror(-flow_error.type),
            flow_error.message ? flow_error.message : "No additional error 
message"
        );
    }

    return flow;
}


I'd appreciate any help on this issue. If any further information is needed, I 
am happy to provide it. Thank you in advance for your time and effort!

Best Regards,
Burkay KINIK

Reply via email to