From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=DNdDLKe3; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id DF8A85A0279 for ; Mon, 28 Jul 2025 18:44:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1753721070; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BzfD8Mg5/nlxPiV7uuKCmm/YP5Uf+oTmtx12FJ7fkmM=; b=DNdDLKe3BZ7+y7qQaGSHrqeOUj+fLBfmnLvneXIMgwUZrmaVE0oa2tKIsGO70Fd4peZ/KC eMAbXlKZQo61dAvs+Nahoqmela3SI+10Yo7IU4lec4bk7ZjOO3M+vkgqdq+/5XPylXwKT1 4P11CikbyjCddTZ6UaHkY3mjUoGYP18= Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-615-qkUWmP-5PPW8Ezf8-J-QlQ-1; Mon, 28 Jul 2025 12:44:28 -0400 X-MC-Unique: qkUWmP-5PPW8Ezf8-J-QlQ-1 X-Mimecast-MFC-AGG-ID: qkUWmP-5PPW8Ezf8-J-QlQ_1753721067 Received: by mail-pf1-f200.google.com with SMTP id d2e1a72fcca58-74913a4f606so4009558b3a.1 for ; Mon, 28 Jul 2025 09:44:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753721067; x=1754325867; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BzfD8Mg5/nlxPiV7uuKCmm/YP5Uf+oTmtx12FJ7fkmM=; b=mCZdAccNQxpxx2WvbQ42zA3qT236zdXyY7KzsedLxMRziWJUjZlsdzoVefKFy2Yh/v 70FgB+f9RRAYca1XO1CZKVILjBKuUcIh+eXc68Awr1g6zuuhDsNp7HuFyDpdbTuk/Iqb 3o5KjexdZyZMWLq7/Sy+iKS1zjLyvOHIp/48Jbf7tdCxJ4sMYUIG4zZq/NGT1UfO0N36 AUOL2XLxwHIuwae/u6Y8kiQprY7N2JhONLA0LmxMCkOmJkeSHhULz5gR/X0NuLiFwVut 2nsEvAtwv2J2nTAn9HzXBG7p1vmRfRUlTMzFeb1MC5SGdAD5mBf1/m64j21WZl5DOcq+ qnrA== X-Gm-Message-State: AOJu0YwOiQO2IFLtn2A69Tp7Q7CiBHjYy46wGyNU0Ep8dF/nnT9sglwB 8YM20pqUzk9BDGV4eSsCd/uOaAMF1pVi0j7FYEWiJTYLZcFGdl/Q7pMlGCp6GMNVRD9f5UjddhN 2eQtxx/LkGagwT6z+YlApVWKud55ZFacyOCMgRwOZBFNLauDujV6RsMIIehcf67rxXg9h6HunYZ CTzKLksxDIbxo9h9yp5iRRtvWkkW9n X-Gm-Gg: ASbGncsO0GOdRKi3V9hWziI2vl5QNxP3LWiKmc7n2NLP4jkkYImVpbYRG3t7J9RAc+P Tntbm6nmj+3ywbOnoSeCCrclZgLUeJPKdRvamK0A3L5fFmgF3BT9txidLKZ85dV3s7n+VSELl9V AgyDnt0KX7fbaVavLYW1v+ X-Received: by 2002:a05:6a20:244a:b0:233:bbcf:749e with SMTP id adf61e73a8af0-23d6ffcfa1emr21184065637.8.1753721067039; Mon, 28 Jul 2025 09:44:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEmXyEaGZ+mZgGaThS2GTnGAYRsahhEag75HSL4OPkrVmTL6WOsFn45mUoIXrGZFXgWMXysx7fXRsdX6X7EgGI= X-Received: by 2002:a05:6a20:244a:b0:233:bbcf:749e with SMTP id adf61e73a8af0-23d6ffcfa1emr21184031637.8.1753721066671; Mon, 28 Jul 2025 09:44:26 -0700 (PDT) MIME-Version: 1.0 References: <20250709174748.3514693-1-eperezma@redhat.com> <20250709174748.3514693-7-eperezma@redhat.com> In-Reply-To: From: Eugenio Perez Martin Date: Mon, 28 Jul 2025 18:43:50 +0200 X-Gm-Features: Ac12FXzUNNna5IRM7ckm4ejLjYg_yLb7D-soNCkxIaSsKYjBPAleHX4U7-gcChk Message-ID: Subject: Re: [RFC v2 06/11] tap: move static iov_sock to tcp_buf_data_from_sock To: David Gibson X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: bNlgn080dCeLN8aaMYbmlX9IPaEruMB7KhrK61o85Xs_1753721067 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: X5FJCILE4G7ANZ346KT75Z7GSQFWUWOV X-Message-ID-Hash: X5FJCILE4G7ANZ346KT75Z7GSQFWUWOV X-MailFrom: eperezma@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top, jasowang@redhat.com X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Wed, Jul 23, 2025 at 9:22=E2=80=AFAM David Gibson wrote: > > On Wed, Jul 09, 2025 at 07:47:43PM +0200, Eugenio P=C3=A9rez wrote: > > As it is the only function using it. I'm always confusing it with > > tcp_l2_iov, moving it here avoids it. > > > > Signed-off-by: Eugenio P=C3=A9rez > > I like making it local, I'd question whether it even needs to remain 'sta= tic'. > Probably not, I was just worried about a stack overflow. But I didn't measure its size to be honest. > > --- > > tcp_buf.c | 5 ++--- > > 1 file changed, 2 insertions(+), 3 deletions(-) > > > > diff --git a/tcp_buf.c b/tcp_buf.c > > index c999d2e..6d79d67 100644 > > --- a/tcp_buf.c > > +++ b/tcp_buf.c > > @@ -55,9 +55,6 @@ static_assert(MSS6 <=3D sizeof(tcp_payload[0].data), = "MSS6 is greater than 65516") > > static struct tcp_tap_conn *tcp_frame_conns[TCP_FRAMES_MEM]; > > static unsigned int tcp_payload_used; > > > > -/* recvmsg()/sendmsg() data for tap */ > > -static struct iovec iov_sock [TCP_FRAMES_MEM + 1]; > > - > > static struct iovec tcp_l2_iov[TCP_FRAMES_MEM][TCP_NUM_IOVS]; > > > > /** > > @@ -292,6 +289,8 @@ static void tcp_data_to_tap(const struct ctx *c, st= ruct tcp_tap_conn *conn, > > */ > > int tcp_buf_data_from_sock(const struct ctx *c, struct tcp_tap_conn *c= onn) > > { > > + static struct iovec iov_sock[TCP_FRAMES_MEM + 1]; > > + > > uint32_t wnd_scaled =3D conn->wnd_from_tap << conn->ws_from_tap; > > int fill_bufs, send_bufs =3D 0, last_len, iov_rem =3D 0; > > int len, dlen, i, s =3D conn->sock; > > -- > David Gibson (he or they) | I'll have my music baroque, and my code > david AT gibson.dropbear.id.au | minimalist, thank you, not the other wa= y > | around. > http://www.ozlabs.org/~dgibson