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 C144845463; Sat, 15 Jun 2024 18:02:47 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 54DE940649; Sat, 15 Jun 2024 18:02:31 +0200 (CEST) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mails.dpdk.org (Postfix) with ESMTP id 1A998402F1 for ; Sat, 15 Jun 2024 18:02:29 +0200 (CEST) Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1f6fd08e0f2so23082645ad.3 for ; Sat, 15 Jun 2024 09:02:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1718467348; x=1719072148; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=d5RmnEUhRMlYlz1gGnDAW/qqV0+kBaa7erGQo1mOqKM=; b=dGlPegH6PVCpdKV1z7yTtZ/yqaKpB6LhJd1lwfjiPd5R3tOhv3J/8/rIYpe9fpriJp yjKbANMVaGIM9l0m4OWAqv6p60ffidFZVaUQANYszz3q2HfylGOcqhF7YM2AY61miMwj wdVnk9CujJ0oOsUzA/8nEg5NQvYJ9WAAE6ajawZe52TCJ+AtEuHgfb04O0qMUuaAxXb8 xQG1QV8CYeEZDX7EMN7xgntpa/Z9k2Xpx5SQyrHFHkaDrmIPTW/EVhrSunMlg6bbwKiJ I479fkz/jPCV04ik6he9u0YbEvyKmEi6ja4IJlqiQc3Cbgug0h+81yhSyfNu5/64yqh1 iYvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718467348; x=1719072148; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d5RmnEUhRMlYlz1gGnDAW/qqV0+kBaa7erGQo1mOqKM=; b=FCqh+zYEA/VT0OVj/kARy/3pMXNbCKyWeBr/kg6noNRB8N1tDWT1MwrBP0+Pw5+Qj9 DWt6YP+dG97HbHEBIVyqdc28qDMl60cuyQjmWWS72mWgs8E3rGx6Ckl3FcBFT4GCMWw5 dRr94TS0Zj9NXH6FLIxwlrKw5QMjsiQ5gbpVDIc3cX66YWs7Gqz+kvfpu3x1zEL0GAS0 wgs4V6rpzkchRKf6yG4VVNp3919icG1u/wPpkd3LejSzIcgZGPOSnWHBSs8tHplO53+c GfPzlBOk5D2sfPVbZN2NWU1oCXxMRYAhA9Z3JYtn9HWZKJDU9RjE1QHXaePcoQHhozZS d04Q== X-Gm-Message-State: AOJu0YzqPth16Wd3BynhbaG1e8JxbdFiSzGAIBFJPVEj504yoY93SXoh HRM2jmNYx3pt9mqymPyNhsdxnMWuJx72tH91XJP2a2b0aRH9sQ1kzuplVM/qBh64ZQBBSw20iyJ z X-Google-Smtp-Source: AGHT+IGQutj7T8dCgEOYMkYE5cLaIzMP+JZnKsyyREL/Q/QQ0r+pn96FT1ApCsUvv5zyrz+KAerR6w== X-Received: by 2002:a17:903:1249:b0:1f4:9138:8178 with SMTP id d9443c01a7336-1f8629006bemr72139925ad.49.1718467348311; Sat, 15 Jun 2024 09:02:28 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f855f043f1sm50264675ad.204.2024.06.15.09.02.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jun 2024 09:02:27 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Harry van Haaren Subject: [PATCH v2 3/3] event/sw: avoid snprintf truncation Date: Sat, 15 Jun 2024 09:00:14 -0700 Message-ID: <20240615160215.117401-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240615160215.117401-1-stephen@networkplumber.org> References: <20240425182738.4771-1-stephen@networkplumber.org> <20240615160215.117401-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The string used for rte_malloc_socket gets truncated. With Gcc-14, this warning is generated: ../drivers/event/sw/sw_evdev.c:263:3: warning: 'snprintf' will always be truncated; specified size is 12, but format string expands to at least 13 [-Wformat-truncation] 263 | snprintf(buf, sizeof(buf), "sw%d_iq_%d_rob", dev_id, i); | ^ Replace IQ_ROB_NAMESIZE (12) with a bigger buffer and remove it since no longer used. Signed-off-by: Stephen Hemminger --- drivers/event/sw/iq_chunk.h | 2 -- drivers/event/sw/sw_evdev.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/event/sw/iq_chunk.h b/drivers/event/sw/iq_chunk.h index 7a7a8782e6..e638142dbc 100644 --- a/drivers/event/sw/iq_chunk.h +++ b/drivers/event/sw/iq_chunk.h @@ -9,8 +9,6 @@ #include #include -#define IQ_ROB_NAMESIZE 12 - struct __rte_cache_aligned sw_queue_chunk { struct rte_event events[SW_EVS_PER_Q_CHUNK]; struct sw_queue_chunk *next; diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c index 1c01b069fe..44698d8aff 100644 --- a/drivers/event/sw/sw_evdev.c +++ b/drivers/event/sw/sw_evdev.c @@ -230,7 +230,7 @@ qid_init(struct sw_evdev *sw, unsigned int idx, int type, unsigned int i; int dev_id = sw->data->dev_id; int socket_id = sw->data->socket_id; - char buf[IQ_ROB_NAMESIZE]; + char buf[64]; struct sw_qid *qid = &sw->qids[idx]; /* Initialize the FID structures to no pinning (-1), and zero packets */ -- 2.43.0