From owner-freebsd-net@FreeBSD.ORG Fri Mar 20 19:04:45 2015 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 69F88A40 for ; Fri, 20 Mar 2015 19:04:45 +0000 (UTC) Received: from mail-ie0-x229.google.com (mail-ie0-x229.google.com [IPv6:2607:f8b0:4001:c03::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C1ADAC0 for ; Fri, 20 Mar 2015 19:04:45 +0000 (UTC) Received: by iedm5 with SMTP id m5so36131978ied.3 for ; Fri, 20 Mar 2015 12:04:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=AavXpiOmSzlsyI18zMJdwrg5ttPOj8ExNEAOUKbXFvQ=; b=T/AIJeNbLm0sYC/zBwjyXLYk+axyadrAeYjWkiO7O323eRGwkbdWsOTbnTa1U3Iyuo inYl//aZKQRqpIHb79tkEjRNTsyzwqSpCwR4xwx5R+B8hI8B151IpdMjjU0p4QF+foF2 LB+7papQAM4EbajHXhKVtvqm/p5pqAQ3F4tZgdtH1G22l2nvIzrYlOn3Wu3Zps0XC0i/ hvXWyFTA0RuGBFE7H103Bv08kA9OXldHHvC+H/Ui+BzNnP2POSdPwGwlU4djjGiNNGhK SB30CRU8dmhYfuNMJpvxggs8pzXbEAeiTqssd9utcBk2bQ2GtorZJ76OELaH+rePZkkk 6gDw== MIME-Version: 1.0 X-Received: by 10.42.41.200 with SMTP id q8mr2858993ice.61.1426878284557; Fri, 20 Mar 2015 12:04:44 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.17.194 with HTTP; Fri, 20 Mar 2015 12:04:44 -0700 (PDT) In-Reply-To: <550C6D65.6070409@selasky.org> References: <522774578.25519037.1426765109046.JavaMail.zimbra@stormshield.eu> <550AC709.1050404@selasky.org> <2047974073.25663527.1426858267777.JavaMail.zimbra@stormshield.eu> <550C5FC6.6020401@selasky.org> <550C6D65.6070409@selasky.org> Date: Fri, 20 Mar 2015 12:04:44 -0700 X-Google-Sender-Auth: No50U30fYbexct0B-fkY5zDXscQ Message-ID: Subject: Re: Fragment questions From: Adrian Chadd To: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8 Cc: Emeric POUPON , freebsd-net X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Mar 2015 19:04:45 -0000 On 20 March 2015 at 11:56, Hans Petter Selasky wrote: > On 03/20/15 19:02, Adrian Chadd wrote: >> >> On 20 March 2015 at 10:58, Hans Petter Selasky wrote: >>> >>> On 03/20/15 14:31, Emeric POUPON wrote: >>>> >>>> >>>> - in the ip_newid macro, we do "htons(V_ip_id++))" if we do not use >>>> randomized id. >>> >>> >>>> In multi core systems, we may emit successive packets with the same id. >>> >>> >>> Will using a mutex or an atomic macro fix this issue when incrementing >>> the >>> V_ip_id ? >> >> >> It will, but it'll ping-pong between multiple cores and slow things >> down at high pps. >> > > Hi, > > Maybe we can have the V_ip_id per CPU and use the lower 8-bits as random CPU > core number? Hm, someone with more cycles to spend on analysing the repercussions from this should investigate it. I think in the short term using an atomic is fine, as it's no worse than what is currently there. But as we get more PPS unlocked and happening we may need to fix it. -adrian