Page MenuHomeFreeBSD

dpaa2: Perform bus_dma pre-write sync before enqueue operation
Needs ReviewPublic

Authored by dsl on Sun, Mar 29, 11:36 AM.
Tags
None
Referenced Files
F150125231: D56144.diff
Sun, Mar 29, 2:38 PM
F150111558: test01.c
Sun, Mar 29, 11:37 AM
F150111545: test01d.c
Sun, Mar 29, 11:37 AM
Subscribers

Details

Reviewers
tuexen
bz
Summary

Without a proper synchronization payload of the egress TCP segments
can be corrupted as tuexen@ described in
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292006#c31.

This patch is indirectly related to 292006 because a properly enabled
and announced support for the TX checksum offloading hides potentially
corrupted frame payload.

Test Plan


  1. cc -O3 -o test01 test01.c to get a "test01" client (run on FreeBSD with DPAA2 to send a pattern over TCP to test01d);
  2. cc -O3 -o test01d test01d.c to get a "test01" server (run on FreeBSD ideally without DPAA2 to receive a pattern sent by test01);

test01d forks into a daemon listening for a TCP connection on port 5202. test01 tries to establish a connection to 10.100.0.2:5202 to send a pattern to. test01d reads incoming pattern byte-by-byte trying to detect a corruption. If it's there, it'll report a wrong symbol and its position within all of the data sent by test01. Pattern is 0xA, 0xB, ..., 0xF sent in blocks 128 bytes each. It was the quickest way to trigger a TCP payload corruption on my Honeycomb LX2 where cache line size is 128 bytes. NOTE: Test will only be able to spot a wrong symbol if the TX checksum offloading is enabled on the FreeBSD host with DPAA2 where test01 is running.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped