From nobody Tue Sep 06 20:15:38 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 4MMc8B54hzz4bbHF; Tue, 6 Sep 2022 20:15:38 +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 4MMc8B4YLXz3q9L; Tue, 6 Sep 2022 20:15:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662495338; 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=I+2NpFM73F/Fh6Nni/i9SQQ0ccud+CrJ+vIe8KQCaOM=; b=YBTJuPF+JSujPIdBR65l5cWAI/UOtWkp+RcNEvtvCEVHBJ5KBZ5mKqcMdG93UKE/aER2iG COeFIehvDBGlXw/cquTxQIfS692F6jb815/b99M1R1dSLqfewPIwi4AKQPKee00kmi4uUp bEltxSNmHH1snI/+zevI3JT/NzhHJIaYfL382jcFS7W1eW0gg2ssGqIPiNp4+wd3B4J2V6 2zzWvVJqNzJhGyikbGL8WbCFmztmD3Nny8Us796JSus5lYaqCETbTfz4iGwSLo17OFJPXW vfwf9pWaKmJ2wYkbc0c7joUw6RBiC61Y7xGHkUnpu+KEOrmhyI5+hEvfR1OQ+w== 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 4MMc8B3LYQzHhL; Tue, 6 Sep 2022 20:15:38 +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 286KFcCC095772; Tue, 6 Sep 2022 20:15:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 286KFcTP095771; Tue, 6 Sep 2022 20:15:38 GMT (envelope-from git) Date: Tue, 6 Sep 2022 20:15:38 GMT Message-Id: <202209062015.286KFcTP095771@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: 21848f12be8b - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 21848f12be8b0375908ef577139922046f462d5d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662495338; 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=I+2NpFM73F/Fh6Nni/i9SQQ0ccud+CrJ+vIe8KQCaOM=; b=d8FGw+klRtr6jtiGNrT3LKKqc/uCUHXK3xRaSnV2CckFbRBPdl40Oc1N3NAD9rTfCZc4Yz LVYbITm+9tcSyEOrdmguwz8ENpN+YiEyQVv+CERmOBpfirn6NJ7P5UzjgCTcfcG0Z+fNgw 56YKIdv4auDDgspzbGp3PZ0o6AbjNRZJe3KqonlyaZ7e9xfE2ZTXCK8x6QcFPDWMExu/s6 zL3962x1fQZID3vo45b+A4hf1l8NgGtTclCy2SwIW6fslwzlPH0p+H0OEFbGJaNizr7PJ9 y9mC1guZM/DOy2BS1KjE3qakJStzKEqVmIZ98mthml+zRdHHzVHvEANncpquKQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662495338; a=rsa-sha256; cv=none; b=aqBEXvkGRSzh5d8rj0WllLuD0Lki41OWB+35SWUc6ynwR1aZ1vHt0uMtFmJqJ1+Ib3Z2+P I1p0Mp3Oh6QZSN2i4DGrd0hYj4fUbTEx4zDbkFk7pZM2YXtFytAVSHHS086ot0eG+/Klii 6FR+fpU5OowjZ7wViLAoTnHPVR9tJRqxA1/Cs8YuZNvhBKjGPW+S3IadKC+EcoN2YprnGk sPJLSXunWukVirmHnG5xPYb0f4d4eMTHNzTmxH4fs4O39A1EfFxYcB53QYMVy3iZHEvuMK margavZLbycW8KS/U9gvlM7qMf+LPEhUIYSAmUbeE+j2g2ITrpLeYAswY/V0Xg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=21848f12be8b0375908ef577139922046f462d5d commit 21848f12be8b0375908ef577139922046f462d5d Author: Vincenzo Maffione AuthorDate: 2022-08-24 08:20:57 +0000 Commit: Vincenzo Maffione CommitDate: 2022-09-06 20:13:50 +0000 pkt-gen: flip IPv4 address in ping-pong mode (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 ebc0ac977219..f62ed781061b 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++;