From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTP id 8CC255A0278 for ; Sun, 18 Feb 2024 22:02:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708290124; 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=wFmUewEEgT+CHjrqQStb3dgxSX7eEmI6c8yKnLrljgo=; b=MfSQ8KYlk15rlnO4EOU9oTO2b8AbvBYh4ZL7FYjO80RLlT7qCOO99QuA3oX7/w9xK/Oey0 h2SBA+fpp0ulbmfRuN1j7E+7lf1cIjsOKi7YloYths/VWmkFb2X8ViY0Na4HNM4RD3UcuJ 8cIwZR4+EM/CQP4K2fvIWlCx+q50PRQ= Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-255-ZcKv36_SO0KpcJAe47pMdw-1; Sun, 18 Feb 2024 16:02:02 -0500 X-MC-Unique: ZcKv36_SO0KpcJAe47pMdw-1 Received: by mail-lf1-f72.google.com with SMTP id 2adb3069b0e04-512b0765e6bso341639e87.0 for ; Sun, 18 Feb 2024 13:02:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708290120; x=1708894920; h=content-transfer-encoding:mime-version:organization: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=wFmUewEEgT+CHjrqQStb3dgxSX7eEmI6c8yKnLrljgo=; b=WdcAGSyqivU0Sd3ynYjaYu1RTb2EgmAgfiTVq4enftGwFGYAI7UDwhgwc90bJVCIRM kysRPZagUMdsaeKYO/CLkZ3OHWMwDfwpiizhTQB1eRpTUeGDuY+6q2JaBnfcL1oBGwyz XznAzUcZyjyBoVTdiPpE/KYph/mynVQT1QMqE1Mmjk1F7kAfISlLS+lLvdoKwTeJcCUR 5IchPuQfL2TFrXzn4nNXqG0ZtexY7MQwfVPfzxTPjvuVpTrXke8CP9+E3lMHBPxY7nSE /upGM9Axl1xecg9Th/qwwwN5GUHLVb7JdRgQTOOzWnFMRma2e6LwwO0mnHcjglGNT71A sTlQ== X-Gm-Message-State: AOJu0YyCbfHzTmC6roGzhCcympXKLAInnBFg9+j6iEIa/fwzbC2J5oS9 J5ayvGMpMMG6wD7KKDpigsshpucW9MXfn+/YyUq1MvBr66yUbbA3xDJTtJ7aJTsWtmnGyH0+TPH CI9CjAUW+mYIeOu8t0m3yhMdRYrhEdnXEVBjLLLxukf/xq57+2iHRz8y770b2 X-Received: by 2002:a05:6512:3e23:b0:512:8d1f:de39 with SMTP id i35-20020a0565123e2300b005128d1fde39mr9691197lfv.27.1708290119900; Sun, 18 Feb 2024 13:01:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IGwj72Zg4mGPgNTZQ6S1DKWwpBVriSL3e2LtnmbbgY5MoykgCbvEPDV6rQf+m0mWGZLTqtvAQ== X-Received: by 2002:a05:6512:3e23:b0:512:8d1f:de39 with SMTP id i35-20020a0565123e2300b005128d1fde39mr9691157lfv.27.1708290119220; Sun, 18 Feb 2024 13:01:59 -0800 (PST) Received: from maya.cloud.tilaa.com (maya.cloud.tilaa.com. [164.138.29.33]) by smtp.gmail.com with ESMTPSA id vx6-20020a170907a78600b00a3df24aebdbsm2239823ejc.126.2024.02.18.13.01.58 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Feb 2024 13:01:58 -0800 (PST) Date: Sun, 18 Feb 2024 22:01:24 +0100 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH v2 16/22] tcp_splice: Improve error reporting on connect path Message-ID: <20240218220124.1375ca39@elisabeth> In-Reply-To: <20240206011734.884138-17-david@gibson.dropbear.id.au> References: <20240206011734.884138-1-david@gibson.dropbear.id.au> <20240206011734.884138-17-david@gibson.dropbear.id.au> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.36; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 3KMVZDK475SAV6NMUDLLGD5YEJQTRJ67 X-Message-ID-Hash: 3KMVZDK475SAV6NMUDLLGD5YEJQTRJ67 X-MailFrom: sbrivio@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 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 Tue, 6 Feb 2024 12:17:28 +1100 David Gibson wrote: > This makes a number of changes to improve error reporting while connecting > a new spliced socket: > * We use flow_err() and similar functions so all messages include info > on which specific flow was affected > * We use strerror() to interpret raw error values > * We now report errors on connection (at "trace" level, since this would > allow spamming the logs) > * We also look up and report some details on EPOLLERR events, which can > include connection errors, since we use a non-blocking connect(). Again > we use "trace" level since this can spam the logs. > > Signed-off-by: David Gibson > --- > tcp_splice.c | 24 ++++++++++++++++++++---- > 1 file changed, 20 insertions(+), 4 deletions(-) > > diff --git a/tcp_splice.c b/tcp_splice.c > index 5ba9c8ea..49075e5c 100644 > --- a/tcp_splice.c > +++ b/tcp_splice.c > @@ -349,8 +349,9 @@ static int tcp_splice_connect(const struct ctx *c, struct tcp_splice_conn *conn, > ASSERT(0); > > if (conn->s[1] < 0) { > - warn("Couldn't open connectable socket for splice (%d)", > - conn->s[1]); > + flow_err(conn, > + "Couldn't open connectable socket for splice: %s", > + strerror(-conn->s[1])); It took me a bit to convince myself that we actually store negative error codes in pools, which sounds like a neat idea, except for two things: - in tcp_sock_refill_pool(), once we get an error from tcp_conn_new_sock(), should we really continue to call it and try to get more sockets? Presumably, that will have something to do with some kind of resource exhaustion, so perhaps we shouldn't risk making it worse and just stop refilling the pool. If we do, we might have up to one negative error code in the pool, I guess. - if we have an error code in the pool, that error might have occurred a while ago, but here, we're logging it at the moment we need that socket. Maybe it would be simpler and saner to just have -1 values in the pool (error or no socket available) and report errors in tcp_conn_new_sock() instead? I'm still reviewing patches 17/22 to 22/22, sorry for the delay. -- Stefano