Bug 187149

Summary: [patch] [netmap] fix netmap's pkt-gen behavior with IP addresses or port range
Product: Base System Reporter: olivier
Component: kernAssignee: freebsd-net (Nobody) <net>
Status: Closed FIXED    
Severity: Affects Only Me CC: olivier
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff
none
patch for pkt-gen (freebsd -current)
none
patch for pkt-gen (freebsd 10.1) none

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.