Bug 187149 - [patch] [netmap] fix netmap's pkt-gen behavior with IP addresses or port range
Summary: [patch] [netmap] fix netmap's pkt-gen behavior with IP addresses or port range
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-net mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-28 21:10 UTC by olivier
Modified: 2018-05-28 22:05 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (1.19 KB, patch)
2014-02-28 21:10 UTC, olivier
no flags Details | Diff
patch for pkt-gen (freebsd -current) (1.95 KB, patch)
2015-05-31 17:41 UTC, olivier
no flags Details | Diff
patch for pkt-gen (freebsd 10.1) (1.86 KB, patch)
2015-05-31 17:41 UTC, olivier
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description olivier 2014-02-28 21:10:00 UTC
Using range option of netmap's pkt-gen generate packets with bad IP and UDP checksum.

Fix: Applying the attached patch.

Patch attached with submission follows:
How-To-Repeat: If you pkt-gen this this kind of range option:
-f tx -l 60 -d 2.1.3.1-2.1.3.10 -s 1.1.3.1-1.1.3.10

A tcpdump on the receiving host will display that it's recveing lot's of packets with bad checksums:

19:31:28.029702 IP (tos 0x10, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 46, bad cksum 31ac (->31a1)!)
    1.1.3.9.0 > 2.1.3.4.0: [bad udp cksum 0x2a23 -> 0x2a18!] UDP, length 18
19:31:28.029704 IP (tos 0x10, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 46, bad cksum 31ac (->31a3)!)
    1.1.3.10.0 > 2.1.3.1.0: [bad udp cksum 0x2a23 -> 0x2a1a!] UDP, length 18
19:31:28.029705 IP (tos 0x10, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 46, bad cksum 31ac (->31a6)!)
    1.1.3.4.0 > 2.1.3.4.0: [bad udp cksum 0x2a23 -> 0x2a1d!] UDP, length 18
19:31:28.029706 IP (tos 0x10, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 46, bad cksum 31ac (->31a4)!)
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2014-04-16 02:42:19 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-net

Over to maintainer(s).
Comment 2 olivier 2015-05-31 17:41:11 UTC
Created attachment 157306 [details]
patch for pkt-gen (freebsd -current)

Here is an improved patch that allow to optionally use the "software UDP checksum" because some NIC like Chelsio allow hardwarde checksuming in netmap mode.
Comment 3 olivier 2015-05-31 17:41:38 UTC
Created attachment 157307 [details]
patch for pkt-gen (freebsd 10.1)
Comment 4 Eitan Adler freebsd_committer freebsd_triage 2018-05-28 19:48:22 UTC
batch change:

For bugs that match the following
-  Status Is In progress 
AND
- Untouched since 2018-01-01.
AND
- Affects Base System OR Documentation

DO:

Reset to open status.


Note:
I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.
Comment 5 Olivier Cochard freebsd_committer 2018-05-28 22:05:59 UTC
Equivalent patches were pushed upstream.