From nobody Sat Dec 31 12:29:13 2022 X-Original-To: dev-commits-src-all@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 4NkhJV1HHrz2nM9H; Sat, 31 Dec 2022 12:29:14 +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 4NkhJV0Xqmz4K7h; Sat, 31 Dec 2022 12:29:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672489754; 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=+j+iD1aJIvX8XFrHSSPESXXdAOPEL6QtL7jZbdOnNXo=; b=DZLeGfoJkFABeejbHslAcAA1hkU/Kcciwwm0I9L2d2nZ9huw1th0nPBz0Djvs7U+lpmkJw /amkRTwEEHTX0DJtfLS9BJWJWUW2Y/koeRhYJ3cn15xvMewPpmuj4TLURzxMkMuFT7nhJt 0wSh1XZamcrPtJTFdPXkj9sLie92T6EXJuZ/uhc73qMt6YKS+JS0MyddwSwcHHUqL8pwgf dfKubI4R1Us73pySaTjs6VPMlKA/iJncjfu8pV1AEgIqE4ETtN0bdLxtvwPFwWxqmzrknp hG1hXQRLjZVA2BNFnBg4PniDkdnZCxjm5VDqO/24vRFQMPFCgU55QB6OnF3Vzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672489754; 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=+j+iD1aJIvX8XFrHSSPESXXdAOPEL6QtL7jZbdOnNXo=; b=D/Q8Yx3YCtD7RfKr6jbOckVZqs7CrNWs15xggVHMKBU/SzqP6ysUqGCZv9XS6srncWhFC/ TZ7L2OP97NRHA4oQtc3ZsPZIDNhb6HkkMG/WZ6PVjyTYs7Z8d6B1h9l6uxda8BSmV9Ziqx CGN+VsHUdWB1LrRcOk+q6WBish4RvyJJdJWhGkaflyNeresWTE7n+CSv9rZe6nVVswSH1+ HC65jt7PaCURRGwcgnr3cslgxol4mvg8X9s3+2Vgb2t+7tgXg0lHs3XKHK6Bph2Y6GfpD6 DFBuEL2ySByVSUKM2dzGmfCVuc8gDca0Pju6HefQcBeDNOk4P9Mo2P7XOJ0Ryw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1672489754; a=rsa-sha256; cv=none; b=aAXddlJymES3/ofsZE6RC9Mp+zE1nZeoFD+U+r5PVpTO2MdCUIfoLUC4h2Ez/U8JLTSgRC 3O3exs71f0tUuQAKqaelIrF6z91sbzXihNP4g4ajVL9hqxOxWe7jHlJLyuyu6rPBnuDZCz hoemEPvP4wQgzqcW9XbWwfOhHZKclK36v+3BsiZxEmkiiu6iypqxHkZIxyX07as/78AaLl bnCnGsw3GVwizOPSJnsnnKspPsX7EHLTuAMVnzF2frJwVKklKfpo8K4s/pvVsRT2w6Rjd+ XUJyZIQk54kGGw4ffaFTPqmQK8x6xR8l+jwsO2Pzv6NvRWhKtDeHvI5blL56dw== 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 4NkhJT6byhznSg; Sat, 31 Dec 2022 12:29:13 +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 2BVCTDGT069947; Sat, 31 Dec 2022 12:29:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2BVCTDlM069946; Sat, 31 Dec 2022 12:29:13 GMT (envelope-from git) Date: Sat, 31 Dec 2022 12:29:13 GMT Message-Id: <202212311229.2BVCTDlM069946@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vincenzo Maffione Subject: git: 77cef5fee734 - stable/12 - pkt-gen: flip IPv4 address in ping-pong mode List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/12 X-Git-Reftype: branch X-Git-Commit: 77cef5fee73445f6938eaab61f927c483d10eccd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=77cef5fee73445f6938eaab61f927c483d10eccd commit 77cef5fee73445f6938eaab61f927c483d10eccd Author: Vincenzo Maffione AuthorDate: 2022-08-24 08:20:57 +0000 Commit: Vincenzo Maffione CommitDate: 2022-12-31 12:13:55 +0000 pkt-gen: flip IPv4 address in ping-pong mode MFC after: 7 days (cherry picked from commit 9a7abd932727dbf593cda85b18de87855b2e7e06) --- 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 81e690235ff1..4518c2fd4219 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++;