DPDK patches and discussions
 help / color / mirror / Atom feed
From: Madhuker Mythri <madhuker.mythri@oracle.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"ferruh.yigit@amd.com" <ferruh.yigit@amd.com>
Subject: RE: [External] : Re: [PATCH] net/tap: Modified TAP BPF program as per the Kernel-version upgrade requirements.
Date: Sat, 13 Jan 2024 17:50:19 +0000	[thread overview]
Message-ID: <SJ0PR10MB479870ACAC4DDFDD5050C774976E2@SJ0PR10MB4798.namprd10.prod.outlook.com> (raw)
In-Reply-To: <20240112084131.1786113c@hermes.local>

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@networkplumber.org> 
Sent: 12 January 2024 22:12
To: Madhuker Mythri <madhuker.mythri@oracle.com>
Cc: dev@dpdk.org; ferruh.yigit@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@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.

  reply	other threads:[~2024-01-13 17:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-12 13:48 madhuker.mythri
2024-01-12 16:40 ` Stephen Hemminger
2024-01-12 16:41 ` Stephen Hemminger
2024-01-13 17:50   ` Madhuker Mythri [this message]
2024-01-13 18:05     ` [External] : " Stephen Hemminger
2024-01-16 16:43     ` Stephen Hemminger
2024-01-12 16:42 ` Stephen Hemminger
2024-01-13 17:52   ` [External] : " Madhuker Mythri
2024-01-13 18:06     ` Stephen Hemminger
2024-01-16  5:43       ` Madhuker Mythri
2024-01-16 16:40         ` Stephen Hemminger
2024-01-17  3:25         ` Stephen Hemminger
2024-01-17 16:19           ` Madhuker Mythri
2024-01-12 16:43 ` Stephen Hemminger
2024-01-12 16:46 ` Stephen Hemminger
2024-01-13 17:55   ` [External] : " Madhuker Mythri
2024-01-12 17:53 ` [RFC v3] tap: rework the BPF header parsing Stephen Hemminger
2024-02-07 18:55 ` [PATCH] net/tap: Modified TAP BPF program as per the Kernel-version upgrade requirements Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SJ0PR10MB479870ACAC4DDFDD5050C774976E2@SJ0PR10MB4798.namprd10.prod.outlook.com \
    --to=madhuker.mythri@oracle.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).