From nobody Wed Aug 24 08:22:35 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MCJxR6Jxfz4ZcDY; Wed, 24 Aug 2022 08:22:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MCJxR5fCFz3VXn; Wed, 24 Aug 2022 08:22:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661329355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0M+LgcWPomshgB9L2d9rsNoHm4a3Q4qk4I0+7UCxRCg=; b=ZKEQwoED0ZT/RWkYnY8F7Stx7xRXwJhA4gcdR3Str8afRG3V8weuzB4eJaTFp8Nrztv6K9 TSe9wssN3HEj6JSZdbe/rqIef+r2biJyxvkerkztMnQuY4Ab1H2mdhsQL35/VG9wE12FJ5 Pyy/JHfT7XcPdaN4MUqusxjWfd3JXx4rlLm3GVHc91Pa6umhzmQFJRtifb68H6+nF8X9V+ NrNpdfJvK7A35SOOKJsx6HyoEHjtTqizg/6y3it4um1sGobChJG9p4Xi6X1xenbRZckatb 3t1/zXpAlWFrTmMzAIvrlTQQsL7la+vkwWPtoFu84DK11m3cCV90W+2wlIVqCw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MCJxR4jnPz12PM; Wed, 24 Aug 2022 08:22:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 27O8MZwi036027; Wed, 24 Aug 2022 08:22:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27O8MZMQ036026; Wed, 24 Aug 2022 08:22:35 GMT (envelope-from git) Date: Wed, 24 Aug 2022 08:22:35 GMT Message-Id: <202208240822.27O8MZMQ036026@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vincenzo Maffione Subject: git: 9a7abd932727 - main - pkt-gen: flip IPv4 address in ping-pong mode List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vmaffione X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9a7abd932727dbf593cda85b18de87855b2e7e06 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661329355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0M+LgcWPomshgB9L2d9rsNoHm4a3Q4qk4I0+7UCxRCg=; b=o9iFQ8pQ7j4aSzX2eHGAsk5iggzxP4Gkswa55M2qZmQslUYxnYJU8pTBmzpuF1cnzvZnWR rSZOX5cFPD7ff9i26umk+E4C+/OAdhgF56tpt7OOG8ronEjyDFBMv+MRyKH1H1M/5fF1HT oitd78xNMdxb5nb8v6LY2jrFYQb1FsRaqo2bkt/oNu+OLZ6EFVqeDG8OtOyuiqenlj4PwY wDmqyC5JTADQFSJdc6Qp/2L9aAhNpoAx+44lIKJGRQHaxQ0WdrYYzHMVR8LGfp5pfUq3VP 27llFgA4iXL/2uG9eJT4MWVHr52lW7wAREje/aYHsZkE642FEpjkByMyK4awwA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1661329355; a=rsa-sha256; cv=none; b=YMXEX3IMP4u5NUt6bDAJzlABHn9lEHZlo+EXDOhCkXaBl4CWiNnt1H258G23IB1NPgekcr EDlg7SSLomwjv1HJnXzFw7bkNDJC03wV/DoZXIPK8Wo5z9KXeYizjOdgPXkzDsQXfm+jX2 4yBbL+6KZ7mjnwMPElj2H5lfgF6hmE2y5/DHIiMtNT/eFxqqybOa6D4VI15RidpdmCvLPP R0hfkFAYi/XrbeD6vyDtJIYijnYW1ilUKvS7WdV3rT+EInjSBjQ1hgyMbShV1NRJsBAi8E IUCIYjYk5/Fh9x+c0epOS68R6VQzGTsXnTVkx8JLVbdjnHsiQvG6kOgKncr6mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=9a7abd932727dbf593cda85b18de87855b2e7e06 commit 9a7abd932727dbf593cda85b18de87855b2e7e06 Author: Vincenzo Maffione AuthorDate: 2022-08-24 08:20:57 +0000 Commit: Vincenzo Maffione CommitDate: 2022-08-24 08:20:57 +0000 pkt-gen: flip IPv4 address in ping-pong mode MFC after: 7 days --- tools/tools/netmap/pkt-gen.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tools/tools/netmap/pkt-gen.c b/tools/tools/netmap/pkt-gen.c index f43469cf7ad6..7ae4d60f8813 100644 --- a/tools/tools/netmap/pkt-gen.c +++ b/tools/tools/netmap/pkt-gen.c @@ -1322,6 +1322,10 @@ ping_body(void *data) return NULL; } + if (targ->g->af == AF_INET6) { + D("Warning: ping-pong with IPv6 not supported"); + } + bzero(&buckets, sizeof(buckets)); clock_gettime(CLOCK_REALTIME_PRECISE, &last_print); now = last_print; @@ -1504,6 +1508,11 @@ pong_body(void *data) if (n > 0) D("understood ponger %llu but don't know how to do it", (unsigned long long)n); + + if (targ->g->af == AF_INET6) { + D("Warning: ping-pong with IPv6 not supported"); + } + while (!targ->cancel && (n == 0 || sent < n)) { uint32_t txhead, txavail; //#define BUSYWAIT @@ -1547,7 +1556,15 @@ pong_body(void *data) dpkt[3] = spkt[0]; dpkt[4] = spkt[1]; dpkt[5] = spkt[2]; + /* swap source and destination IPv4 */ + if (spkt[6] == htons(ETHERTYPE_IP)) { + dpkt[13] = spkt[15]; + dpkt[14] = spkt[16]; + dpkt[15] = spkt[13]; + dpkt[16] = spkt[14]; + } txring->slot[txhead].len = slot->len; + //dump_payload(dst, slot->len, txring, txhead); txhead = nm_ring_next(txring, txhead); txavail--; sent++;