From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by passt.top (Postfix) with ESMTPS id DEF405A027B for ; Thu, 15 Feb 2024 10:15:23 +0100 (CET) Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-563aa20313dso4927a12.1 for ; Thu, 15 Feb 2024 01:15:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1707988523; x=1708593323; darn=passt.top; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=qUn7iktxnSCs9/aTk5cnSbTp1Sitzo+giYpoSXQVzdE=; b=PQST0CYOeBXZ8IL7UKMax4BOmh8PxdVrgIsqPoqRFwG0OCjeVE+/fEFjwGm1ycb8JN VjYFlIokjlpCJPLXnWxYTvKvACtasmtp4LQtCz6dxdmJR52HvsgOgboGbi7aO0V4sDJW KvNnWvbCtPLuq2RX0b07GBIqBrXb6WvdWPcg+fVo/vbXeqNNSJ78z+xnqMrcSYQtTnyf BqazrM9ANaRR+Iwhlbb58Vh/yjBzB9iaFcrNwablykblaw84wC3xB0dxKmmjCEJjXIGi /baBCegilY+0nSBByj8UsRe0OBS52wTu6F+wbiFJ0tnlRLQDsm7wVow81ioA+OoVzLeo uIRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707988523; x=1708593323; 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=qUn7iktxnSCs9/aTk5cnSbTp1Sitzo+giYpoSXQVzdE=; b=EeQoHLFhv7UnJA1//KEq11zR3okvQtHgSwA+d8dab+YvIAP5dLCVdUmsVSxTBmxgo4 rz+kVRAdBp8QGoPX8jX+aIan3wB+LjXbOtsj9Gl//ISU9fK14Zp9F19Y2zch008no+Yn aR/xAJkXHNVZ5VmrJ2ICSVcKxhhvUwuLQlQbded9YjVB41KkGpFovBAWQTlBPAjJlzF6 U5JYfTcXMsZRG7M6D8lGz5SYzf2xSSt50DEnKbD4E+w1a9fGYNals29lWemqYQfYvhtT P+jcxb8dLcHlamo8x580lNvmjou6WFnmgL2mhSgsxuUdnbsmXMh3hDHPHUlORj+TpXla ghSg== X-Forwarded-Encrypted: i=1; AJvYcCXZBB9n7eXbWxpD65sYsyOo8TeWY30lgO7UTcKilJ2HvO23ykGSk1WVl4Gu3t2/H/sS0JTFpSI0cI0/Gxq3l3MhoAYA X-Gm-Message-State: AOJu0YyIfsvddYv+g9OEEwjeVU0mzRJomuE7xbn1SMpgFC4cKPolQDYg cR/K7KMdQIrdJCBNAvNrxkTyVTY78a/UYXl+qLM0r22CK85ua71we8sVm3ERTVQNFrCilyRELv4 qxwN4nwIZKGgwHN3ccLLzsGeROsbVG9d1+V0T X-Google-Smtp-Source: AGHT+IGF7WCK5ODqdqCdP1dePcGD18OQNMYgqjn0nvc78bZt5z2jfPx5i1+1lZXluHxeZv3S0xZVf/VhQOgXlBl3e1g= X-Received: by 2002:a50:a417:0:b0:560:f37e:2d5d with SMTP id u23-20020a50a417000000b00560f37e2d5dmr365698edb.5.1707988523206; Thu, 15 Feb 2024 01:15:23 -0800 (PST) MIME-Version: 1.0 References: <20240209221233.3150253-1-jmaloy@redhat.com> <8d77d8a4e6a37e80aa46cd8df98de84714c384a5.camel@redhat.com> <20072ba530b34729589a3d527c420a766b49e205.camel@redhat.com> In-Reply-To: From: Eric Dumazet Date: Thu, 15 Feb 2024 10:15:08 +0100 Message-ID: Subject: Re: [PATCH v3] tcp: add support for SO_PEEK_OFF To: David Gibson Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-MailFrom: edumazet@google.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation Message-ID-Hash: I67IJLNFVBRNGKDH5U4NOM2TPKSP72SN X-Message-ID-Hash: I67IJLNFVBRNGKDH5U4NOM2TPKSP72SN X-Mailman-Approved-At: Thu, 15 Feb 2024 19:32:10 +0100 CC: Paolo Abeni , kuba@kernel.org, passt-dev@passt.top, sbrivio@redhat.com, lvivier@redhat.com, dgibson@redhat.com, jmaloy@redhat.com, netdev@vger.kernel.org, davem@davemloft.net 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 Thu, Feb 15, 2024 at 4:21=E2=80=AFAM David Gibson wrote: > Btw, Eric, > > If you're concerned about the extra access added to the "regular" TCP > path, would you be happier with the original approach Jon proposed: > that allowed a user to essentially supply an offset to an individial > MSG_PEEK recvmsg() by inserting a dummy entry as msg_iov[0] with a > NULL pointer and length to skip. > > It did the job for us, although I admit it's a little ugly, which I > presume is why Paolo suggested we investigate SO_PEEK_OFF instead. I > think the SO_PEEK_OFF approach is more elegant, but maybe the > performance impact outweighs that. > Sorry, this was too ugly. SO_PEEK_OFF is way better/standard, we have to polish the implementation so that it is zero-cost for 99.9999 % of the users not using MSG_PEEK..