Netdev List
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] net: macb: add pad and fcs support
@ 2018-07-18 12:58 Claudiu Beznea
  2018-07-18 12:58 ` [RFC PATCH 1/3] net: macb: use netdev_tx_t return type for ndo_start_xmit functions Claudiu Beznea
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Claudiu Beznea @ 2018-07-18 12:58 UTC (permalink / raw)
  To: nicolas.ferre, davem
  Cc: netdev, jennifer.dahm, nathan.sullivan, Claudiu Beznea

Hi,

In [1] it was reported that UDP checksum is offloaded to hardware no mather
it was previously computed in software or not. The proposal on [1] was to
disable TX checksum offload.

This series (mostly patch 3/3) address the issue described at [1] by
setting NOCRC bit to TX buffer descriptor for SKBs that arrived from
networking stack with checksum computed. For these packets padding and FCS
need to be added (hardware doesn't compute them if NOCRC bit is set). The
minimum packet size that hardware expects is 64 bytes (including FCS).
This feature could not be used in case of GSO, so, it was used only for
no GSO SKBs.

For SKBs wich requires padding and FCS computation macb_pad_and_fcs()
checks if there is enough headroom and tailroom in SKB to avoid copying
SKB structure. Since macb_pad_and_fcs() may change SKB the
macb_pad_and_fcs() was places in macb_start_xmit() b/w macb_csum_clear()
and skb_headlen() calls.

This patch was tested with pktgen in kernel tool in a script like this:
(pktgen_sample01_simple.sh is at [2]):

minSize=1
maxSize=1500

for i in `seq $minSize $maxSize` ; do
	copy="$(shuf -i 1-2000 -n 1)"
	./pktgen_sample01_simple.sh -i eth0 \
		-m <dst-mac-addr> -d <dst-ip-addr> -x -s $i -c $copy
done

minStep=1
maxStep=200
for i in `seq $minStep $maxStep` ; do
	copy="$(shuf -i 1-2000 -n 1)"
	size="$(shuf -i 1-1500 -n 1)"
	./pktgen_sample01_simple.sh -i eth0 \
		-m <dst-mac-addr> -d <dst-ip-addr> -x -s $size -c $copy
done

[1] https://www.spinics.net/lists/netdev/msg505065.html
[2] https://github.com/netoptimizer/network-testing/blob/master/pktgen/pktgen_sample01_simple.sh

Claudiu Beznea (3):
  net: macb: use netdev_tx_t return type for ndo_start_xmit functions
  net: macb: move checksum clearing outside of spinlock.
  net: macb: add support for padding and fcs computation

 drivers/net/ethernet/cadence/macb_main.c | 88 +++++++++++++++++++++++++++++---
 1 file changed, 80 insertions(+), 8 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-07-19  7:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-18 12:58 [RFC PATCH 0/3] net: macb: add pad and fcs support Claudiu Beznea
2018-07-18 12:58 ` [RFC PATCH 1/3] net: macb: use netdev_tx_t return type for ndo_start_xmit functions Claudiu Beznea
2018-07-18 12:58 ` [RFC PATCH 2/3] net: macb: move checksum clearing outside of spinlock Claudiu Beznea
2018-07-18 12:58 ` [RFC PATCH 3/3] net: macb: add support for padding and fcs computation Claudiu Beznea
2018-07-18 17:54   ` David Miller
2018-07-19  7:03     ` Claudiu Beznea

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox