Skip to content

net_core: Decide about l2-processing based on l2_processed-flag #93050

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ClaCodes
Copy link
Contributor

@ClaCodes ClaCodes commented Jul 12, 2025

Use the l2_processed-flag to decide whether a network packet needs to be processed by an L2-handler. This could be used in the future to requeue packets for later processing by a different traffic class queue.

Note: this would break all out-of-tree code, that assumed setting reassembled is enough for the packet to be not processed by l2 handlers. Not sure, if this is a valid concern?

Finally goal is to reach something like, so that processing of packets can be deferred easily:

void process_data(struct net_pkt *pkt) {
    // ...
    if (!net_pkt_is_l2_processed(pkt)) {
        process_l2(pkt);
        net_pkt_set_l2_processed(pkt, true);
        bool updated = update_priority(pkt);
        if (updated) {
            net_queue_rx(net_pkt_iface(pkt), pkt);
            return;
        }
    }
    // ...
    if (!net_pkt_is_l3_processed(pkt)) {
        process_l3(pkt);
        net_pkt_set_l3_processed(pkt, true);
        bool updated = update_priority(pkt);
        if (updated) {
            net_queue_rx(net_pkt_iface(pkt), pkt);
            return;
        }
    }
    // ...
    if (!net_pkt_is_l4_processed(pkt)) {
        process_l4(pkt);
        net_pkt_set_l4_processed(pkt, true);
        bool updated = update_priority(pkt);
        if (updated) {
            net_queue_rx(net_pkt_iface(pkt), pkt);
            return;
        }
    }
}

Maybe instead:

    process_ll(pkt);
    process_transport(pkt); // net_ipvX_input
    process_connection(pkt); // net_conn_input

Use the l2_processed-flag to decide whether a network packet needs to be
processed by an L2-handler. This could be used in the future to requeue
packets for later processing by a different traffic class queue.
Introduce a loopback-flag to aoivd passing the information around as
argument.

Signed-off-by: Cla Mattia Galliard <clamattia@gmail.com>
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants