Global static volatile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Helo

I tried to use a secondary variable fib_params_test as a global
variable at the beginning of my XDP program like this:

static volatile struct bpf_fib_lookup fib_params_test;
.
.
static __always_inline int function_process_packet(struct xdp_md *ctx,
u32 flags)
{
    const __u32 ifingress = ctx->ingress_ifindex;
    void *data_end = (void *)(long)ctx->data_end;
    void *data = (void *)(long)ctx->data;
    void *l3hdr = NULL;
    struct bpf_fib_lookup fib_params;

    bpf_printk("Ingress interface %d", fib_params_test.ifindex); /*
the value displayed is always right */
.
.
}


Once "fib_params_test" was initialized with the first packet received,
upon subsequent packets coming from different incoming vlan
interfaces, "fib_params_test.ifindex" always returned the interface I
expected.
Obviously I have always done tests with little traffic so I have the
doubt that in a real situation there may be unexpected values for the
fib_params_test.ifindex variable. This is possible?

Thank you.

Marco




[Index of Archives]     [Linux Networking Development]     [Fedora Linux Users]     [Linux SCTP]     [DCCP]     [Gimp]     [Yosemite Campsites]

  Powered by Linux