From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8505546F05 for ; Mon, 15 Sep 2025 20:05:17 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7D5734067E; Mon, 15 Sep 2025 20:05:17 +0200 (CEST) Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by mails.dpdk.org (Postfix) with ESMTP id 596034042F for ; Mon, 15 Sep 2025 20:05:15 +0200 (CEST) Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-b149efbed4eso78318366b.1 for ; Mon, 15 Sep 2025 11:05:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1757959515; x=1758564315; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=6IBSZDlLLwsCCbbJDt7wApay1EMKpFTAQLQ+2T0jVXE=; b=iDQ8Rzjv/bPcaaA0ZoxkeC5q6YzK6nQLyDfr0RB4xi6Ajxkar9vG++XnRpX8JH9bzZ hkiFvjqaqd51V8EGYOsWF9zKO2is0FhoNLa+rcM4y8jsHe1cmOqx0TTuF0/23IP0CxY8 ao/EvX5f1QD989M3Mgdn2XgYCJ6F+Z3/DPC+nMNzW27Rtdc5XDygq1fnNn40f1zmnDbu ja/PCHe8LtI2iVu4ZK76SBnBzFYpRDxZm8Yp1AlGIfzNPjKio4l+iTVcYO4jFtrIuZLT GVq149QKZ+9KhoxHAtqk2GgPa9kx4nMv9lx4WFdGp0chPmx/X3bqwvHKrQ5riQ1T0bZK iv6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757959515; x=1758564315; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6IBSZDlLLwsCCbbJDt7wApay1EMKpFTAQLQ+2T0jVXE=; b=Xnn/js8TcZJUQ3ACG6wuchilf4+LvvSiqp3AdzL/m8gKJ0xBq19eQKoNyplDcrKtMB YHkbGUr1SlVh9fEYsmS11pAVYIGlfmxA2jekfufeKvEwRur3P/P2krshOTRNGmjUEfro eeXSIwAH6oEmrvfKvFbLEF+Vanf/RI8VLx6IXjWb3LfcBy2C/n6I/Ub4WjgR1VASWoUE Q8kSIf9jxGtHZmLdCbYxphNLd5ITi/lnyg704S+/rZP2AnK6+Wpo5CWU94g0QhzmIIoj ai6KxqSqnGNToU/tH/YjPT6oEgEbwY2mgmwXdXLSXlDW7YCAFYjAwZcquRcQasByJzld dhLw== X-Forwarded-Encrypted: i=1; AJvYcCWf+jRWFplHCmmh5uGDGmqsnQIMGNWsxGdTC93/lmZb/R3ZZW0A9ypUaOW5MKbciCHxUSK+nzw=@dpdk.org X-Gm-Message-State: AOJu0YyxYMwxOVhiI8LcREb1hGvHRSLKLH+O5Kk9SecTQ+DzyKYDKiEX MYW0kzSYQY40akNIW6FCoVdL+RGFmWsx9oOgJg5cGCP28xvlMSONWxJyaDI33dj8bzY= X-Gm-Gg: ASbGncu43Bl/+77thvhmJwepE3F5wKRwNDyLRglo4zkKe8lcyXryyXM9zCb4KXfykdz 12DKhq4Pa4/qjxfMyHClcYAuGkqHIEIAiEwx+BJfGMeS+INnosi3F0ISnOrSFYjN3awBQ5+wbJj B2KRn6f1TB/4FCVSJs7c4FhaSQt+v1t5tEUnPI0tOQQEeay9+OkWE8/OC8WRZP2YBw6g+K4GmUM uPkwNwT7hVSzPQZi8pOxPVXh9djyM9vWjQedUtiZ5tc8nDjKOzWaW3t5AJoUjd/8CvgzhbneC5U Qzs7l1f+TD2Vs5XPBECGu6VXNZCixIo2g0UPnAI2r/W0g89ZoJm6ng8b/DcR8Fcd387lDBjgr6Z MkBq9h635YRFHpg4hRMBgl++vXoHJ/R1C7dh532WIzGTd9ZACiU2kdUSdAQT33rZLKxHnGs25dE 8= X-Google-Smtp-Source: AGHT+IF5DyjvaFdTRPcz+OacJnsZyDm7OQCGvebuuOMoyoHxbBrJKBPWoWpqRUguljlvuExMGz2AYw== X-Received: by 2002:a17:907:3fa1:b0:b07:88aa:255b with SMTP id a640c23a62f3a-b07c354ed12mr1287356466b.11.1757959514787; Mon, 15 Sep 2025 11:05:14 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-62f2648afb1sm4180467a12.29.2025.09.15.11.05.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Sep 2025 11:05:14 -0700 (PDT) Date: Mon, 15 Sep 2025 11:05:08 -0700 From: Stephen Hemminger To: Alexander Kozyrev Cc: , , , , Subject: Re: [PATCH] app/testpmd: use table ID for jump to matcher action Message-ID: <20250915110508.7a1413bd@hermes.local> In-Reply-To: <20250819144508.722653-1-akozyrev@nvidia.com> References: <20250819144508.722653-1-akozyrev@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Tue, 19 Aug 2025 17:45:05 +0300 Alexander Kozyrev wrote: > +/** Parse table id and convert to table pointer for jump_to_table_index action. */ > +static int > +parse_jump_table_id(struct context *ctx, const struct token *token, > + const char *str, unsigned int len, > + void *buf, unsigned int size) > +{ > + struct buffer *out = buf; > + struct rte_port *port; > + struct port_table *pt; > + uint32_t table_id; > + const struct arg *arg; > + void *entry_ptr; > + > + /* Get the arg before parse_int consumes it */ > + arg = pop_args(ctx); > + if (!arg) > + return -1; > + /* Push it back and do the standard integer parsing */ > + if (push_args(ctx, arg) < 0) > + return -1; > + if (parse_int(ctx, token, str, len, buf, size) < 0) > + return -1; > + /* Nothing else to do if there is no buffer */ > + if (!out || !ctx->object) > + return len; > + /* Get the parsed table ID from where parse_int stored it */ > + entry_ptr = (uint8_t *)ctx->object + arg->offset; > + table_id = *(uint32_t *)entry_ptr; This creates a possibly unaligned memory access. Is that OK? Other code in cmdline_flow.c like parse_action is using memcpy to avoid this.