[External] : Re: [PATCH] net/tap: Modified TAP BPF program as per the Kernel-version upgrade requirements.

Madhuker Mythri madhuker.mythri at oracle.com
Sat Jan 13 18:50:19 CET 2024


With the original code BPF verifier throws error, due to undefined array access and thus could failed to load the BPF instructions onto the Kernel.
For safe execution on the Kernel, the array access with such undefined value throws error.

So, came up with this loop which has Max-queues as limit.

Thanks,
Madhuker,

-----Original Message-----
From: Stephen Hemminger <stephen at networkplumber.org> 
Sent: 12 January 2024 22:12
To: Madhuker Mythri <madhuker.mythri at oracle.com>
Cc: dev at dpdk.org; ferruh.yigit at amd.com
Subject: [External] : Re: [PATCH] net/tap: Modified TAP BPF program as per the Kernel-version upgrade requirements.

On Fri, 12 Jan 2024 19:18:21 +0530
madhuker.mythri at oracle.com wrote:

> -	queue = rsskey->queues[(hash % rsskey->nb_queues) &
> -				       (TAP_MAX_QUEUES - 1)];
> -	skb->cb[1] = QUEUE_OFFSET + queue;
> -	/* printt(">>>>> rss_l3_l4 hash=0x%x queue=%u\n", hash, queue); */
> +	hash = (hash % rsskey->nb_queues) & (TAP_MAX_QUEUES - 1); #pragma 
> +clang loop unroll(full)
> +	for (k = 0; k < TAP_MAX_QUEUES; k++) {
> +		if(k == hash)
> +			queue = rsskey->queues[k];
> +	}
>  

Why introduce another loop here. Original code was fine and bounded.


More information about the dev mailing list