From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52]) by dpdk.org (Postfix) with ESMTP id CCA9C5934 for ; Thu, 22 Jan 2015 11:00:25 +0100 (CET) Received: by mail-wg0-f52.google.com with SMTP id y19so698488wgg.11 for ; Thu, 22 Jan 2015 02:00:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version:content-type :content-transfer-encoding; bh=usQM/wJU2+jzTihBVrUNEVe9iUWWsvBNgVw+QdBA42o=; b=VCdLMxyPeBUppDzkjwklW75u9KM0pmcJUJT1hvGj0HfIE9RUY6H7i7G7RgpsukcB2d 5fZJGWy7UtrAgdryT+u0w/DLVcaKhRNWD5/yV7M5Jk3P5R8A/t5aPAMxL8EM56Kwuxg8 IgYtMr76M380nRDRJ7bOAeiFmmNmJUxUWxIPu86WklrVUOcIvYyRKs2j0W2rclNI0bjy JjqtQ1hVYxSeRRQPp2+3tsI5lbGeH5mfdIhEWni0zO2XnGVGpuMd+BYg6ut52zdfHeum yxeiCCtSiGcKX6hE04Kuk3l8U07GGpRFOPvcER6Fb4PZj5Hd31kPJWo4oOtUA2YG4fxT EQ9A== X-Gm-Message-State: ALoCoQk0Yp9AtVVkP2IguyFs7x3xINhoh8qddI9MzTMEvFtQqi2tC6NhbSU+tGB+W0rYnBmA1azh X-Received: by 10.180.75.237 with SMTP id f13mr3327173wiw.69.1421920825631; Thu, 22 Jan 2015 02:00:25 -0800 (PST) Received: from xps13.localnet (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by mx.google.com with ESMTPSA id dc1sm2301686wib.18.2015.01.22.02.00.23 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Jan 2015 02:00:24 -0800 (PST) From: Thomas Monjalon To: dev@dpdk.org Date: Thu, 22 Jan 2015 11:00:01 +0100 Message-ID: <7246473.sOL5Cyqyvb@xps13> Organization: 6WIND User-Agent: KMail/4.14.3 (Linux/3.18.2-2-ARCH; KDE/4.14.3; x86_64; ; ) In-Reply-To: <54C0390F.3040004@6wind.com> References: <1421883395-27235-1-git-send-email-olivier.matz@6wind.com> <54C0390F.3040004@6wind.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart2239986.aX5dAVpMei" Content-Transfer-Encoding: 7Bit Subject: Re: [dpdk-dev] [RFC 00/16] enhance checksum offload API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 10:00:25 -0000 This is a multi-part message in MIME format. --nextPart2239986.aX5dAVpMei Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 2015-01-22 00:41, Olivier MATZ: > We use the attached scapy script (dpdk-cksum-test.py) for testing. Attaching the python script which was filtered out. --nextPart2239986.aX5dAVpMei Content-Disposition: attachment; filename="dpdk-cksum-test.py" Content-Transfer-Encoding: 7Bit Content-Type: text/x-python; charset="UTF-8"; name="dpdk-cksum-test.py" class VXLAN(Packet): name = 'VXLAN' fields_desc = [ FlagsField('flags', default=1 << 3, size=8, names=['R', 'R', 'R', 'R', 'I', 'R', 'R', 'R']), XBitField('reserved1', default=0x000000, size=24), BitField('vni', None, size=24), XBitField('reserved2', default=0x00, size=8), ] overload_fields = { UDP: {"sport": 4789, "dport": 4789} } def mysummary(self): return self.sprintf("VXLAN (vni=%VXLAN.vni%)") bind_layers(UDP, VXLAN, dport=4789) bind_layers(VXLAN, Ether) macdst = "00:1B:21:8E:B2:30" # test with ixgbe #macdst = "68:05:CA:26:9B:10" # test with fortvile iface = "ixgbe6" count = 1 macsrc = get_if_hwaddr(iface) def send_test_packets(hdr, iface, count): p = hdr.copy() p /= IP(src=RandIP(), dst=RandIP()) p /= TCP(flags=0x10)/Raw(RandString(1400)) # valid packet q = p.copy() sendp(q, iface=iface, count=count) # bad outer IP checksum q = p.copy() q[IP].chksum=0x1234 sendp(q, iface=iface, count=count) if q.haslayer(UDP): # bad outer UDP checksum q = p.copy() q[UDP].chksum=0x1234 sendp(q, iface=iface, count=count) # disable outer UDP checksum q = p.copy() q[UDP].chksum=0 sendp(q, iface=iface, count=count) if q[IP].payload.haslayer(IP): # bad inner IP checksum q = p.copy() q[IP].payload[IP].chksum=0x1234 sendp(q, iface=iface, count=count) # bad inner TCP checksum q = p.copy() q[IP].payload[TCP].chksum=0x1234 sendp(q, iface=iface, count=count) def do_test(): # Ether packet p = Ether(dst=macdst, src=macsrc) send_test_packets(p, iface, count) # VxLAN packet p = Ether(dst=macdst, src=macsrc)/IP(src=RandIP(), dst=RandIP()) p /= UDP(sport=4789, dport=4789) p /= VXLAN(vni=1234)/Ether(dst=macdst, src=macsrc) send_test_packets(p, iface, count) # Ethernet over GRE p = Ether(dst=macdst, src=macsrc)/IP(src=RandIP(), dst=RandIP()) p /= GRE(proto=0x6558)/Ether(dst=macdst, src=macsrc) send_test_packets(p, iface, count) # IP over GRE p = Ether(dst=macdst, src=macsrc)/IP(src=RandIP(), dst=RandIP()) p /= GRE() send_test_packets(p, iface, count) # IP over IP p = Ether(dst=macdst, src=macsrc)/IP(src=RandIP(), dst=RandIP()) send_test_packets(p, iface, count) do_test() --nextPart2239986.aX5dAVpMei--