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.133.124]) by passt.top (Postfix) with ESMTP id E88265A0274 for ; Wed, 13 Mar 2024 15:42:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710340952; 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=mSD16846NaiPXQIjmzHFMgbiugvAQhFLn2rFjBElSFI=; b=PhiP8vaF2kB5so1ddY7wPxUa5KKJtsxDtlm+K6kz6QGaF+ihR/9Gz6KC90JeHKyl0lsKK2 E9ZDe2flb/8ekF9FQoJDZqdzQTe2rl7mq8mcUAmaOfvjYmoCNILU+hzvmO0uOpD8NNWjrA wVsE9xvjZJnxTiTf7gYGA3phlVxmtzQ= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-492--U8N51oXORKyjbddbyJAkw-1; Wed, 13 Mar 2024 10:42:30 -0400 X-MC-Unique: -U8N51oXORKyjbddbyJAkw-1 Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-430938ff8b8so5524801cf.3 for ; Wed, 13 Mar 2024 07:42:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710340950; x=1710945750; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mSD16846NaiPXQIjmzHFMgbiugvAQhFLn2rFjBElSFI=; b=NQVmfvCsMj420Oi4eyMu5BDQ2toTRDUvsXVBJDb7vmcf7bvBRynAgRfh+jtAc1/QqM CvP0sJ1ibUuFez7DcT/tmUKkexY2jmyAOt42GsxnS/SqMNac2aPfddQrrVIdLJmTh8ed pdM2jyWl4haWV5lcYcXjAvXWGWDb/hPPgKtaMU+4Poa1DL/1c+cBdIDRBEOzISEZyy9k PD+fw8VpAi/ucVzOVXVCSq3X15wYQlA2ScbSIO9WvDOAv4d8xI5WOWtWc0gS+YOAzVkJ 67vcyj2FT5IJx7aFnPmtfCjJ9Ri2CFl0RziWNv/bG3aES3t9EYgayEP5/BBqYr2kiCXT aE7Q== X-Gm-Message-State: AOJu0YwIU3f4mG43JCh4M3KspKEtMXj3kFozVh3Lm//26SzKnwolHWE8 JF/VWR7IAHATfMGsKc3bQ4PlB72nA4gTb3gkfbW4gLP1Lkq3zyf9iEyH/n9IaR0Wcl4WQfBuQk6 GDv9+RwWyNQ/yFsRYBmf3fOjnkdUCLHwkG6irdHVpiAm03UtAQJxDXc/ekg== X-Received: by 2002:a05:622a:244:b0:42f:20b6:4866 with SMTP id c4-20020a05622a024400b0042f20b64866mr15150022qtx.17.1710340950249; Wed, 13 Mar 2024 07:42:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFJBOVOnAuu7mS3wuq2EdlZG/44xfTGxCzkhx8uQCsKYah917EJNm5hIM5ommemHPSUr3Z+Cg== X-Received: by 2002:a05:622a:244:b0:42f:20b6:4866 with SMTP id c4-20020a05622a024400b0042f20b64866mr15150012qtx.17.1710340949999; Wed, 13 Mar 2024 07:42:29 -0700 (PDT) Received: from [192.168.100.30] ([82.142.8.70]) by smtp.gmail.com with ESMTPSA id h1-20020a05620a244100b0078843dc545fsm4803137qkn.73.2024.03.13.07.42.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 Mar 2024 07:42:29 -0700 (PDT) Message-ID: <8e56f30b-cdcc-4276-acbe-9fc87fa51a7e@redhat.com> Date: Wed, 13 Mar 2024 15:42:27 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC] tcp: Replace TCP buffer structure by an iovec array To: Stefano Brivio References: <20240311133356.1405001-1-lvivier@redhat.com> <20240313123725.7a37f311@elisabeth> From: Laurent Vivier In-Reply-To: <20240313123725.7a37f311@elisabeth> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID-Hash: IV42DGE55WSK3WBYHNVO2BLF4IIVACQP X-Message-ID-Hash: IV42DGE55WSK3WBYHNVO2BLF4IIVACQP X-MailFrom: lvivier@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 3/13/24 12:37, Stefano Brivio wrote: > On Mon, 11 Mar 2024 14:33:56 +0100 > Laurent Vivier wrote: > ... >> diff --git a/tcp.c b/tcp.c >> index d5eedf4d0138..5c8488108ef7 100644 >> --- a/tcp.c >> +++ b/tcp.c >> @@ -318,39 +318,7 @@ ... >> -#define MSS4 ROUND_DOWN(USHRT_MAX - sizeof(struct tcp4_l2_head), 4) >> -#define MSS6 ROUND_DOWN(USHRT_MAX - sizeof(struct tcp6_l2_head), 4) >> >> +#define MSS (USHRT_MAX - sizeof(struct tcphdr)) > > We can't exceed USHRT_MAX at Layer-2 level, though, so the MSS for IPv4 > should now be: > > #define MSS4 ROUND_DOWN(USHRT_MAX - sizeof(struct ethhdr) - > sizeof(struct iphdr) - > sizeof(struct tcphdr), > 4) > > ...and similar for IPv6. Is there a specification that limits the MSS? Or is it only a compatibility problem with the network stack implementation? At headers level the only limitation we have is the length field size in the IP header that is a 16bit (it's why I put "USHRT_MAX - sizeof(struct tcphdr)"). Thanks, Laurent