]> rtime.felk.cvut.cz Git - zynq/linux.git/commit
xilinx_emacps: Log severe errors, fix tx_packets
authorThomas Betker <thomas.betker@rohde-schwarz.com>
Mon, 8 Apr 2013 20:05:40 +0000 (22:05 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Mon, 15 Apr 2013 09:57:49 +0000 (11:57 +0200)
commit4a5f8727c906e373a83de76eeeed5671545bb584
tree1d27b77121fd375012b8591cb5545b736c37110a
parent6b3dda963fef2a6d155baeb8fb203f71e1b08eb1
xilinx_emacps: Log severe errors, fix tx_packets

Certain severe error conditions (which should never occur) should be
logged, in particular since the driver does not take actions to
recover; see 16.3.10 in the TRM. Some kind of dev_err() already used to
exist in previous driver versions, but got lost somehow:
o In xemacps_rx_poll(), log rx_status.HRESPNOK.
o In xemacps_tx_poll(), log tx_status.HRESPNOK and .BUFEXH.

Note: Some rx_status and tx_status error conditions are not covered by
statistics registers. There also used to be some code to increment the
net_device_stats counters, but I have refrained from re-adding it:
o rx_status.HRESPNOK: rx_errors, rx_fifo_errors
o rx_status.RXOVR:    rx_errors, rx_fifo_errors
o tx_status.HRESPNOK: tx_errors, tx_fifo_errors
o tx_status.BUFEXH:   tx_errors, tx_fifo_errors

In xemacps_tx_poll(), increment tx_packets and tx_bytes even if the
transmission failed. This is expected by SNMP (see ifOutUcastPkts in
RFC 2863: "The total number of packets that higher-level protocols
requested be transmitted, ..., including those that were discarded or
not sent."), and other Ethernet drivers also seem to handle it this way.

Note: In order to decide if an error occurred, we would need to check
the ERR bits of all buffers of a (multi-fragment) packet, not just the
last buffer; it is actually easier to drop this altogether, though.

Signed-off-by: Thomas Betker <thomas.betker@rohde-schwarz.com>
Tested-by: Anirudha Sarangi <anirudh@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/net/ethernet/xilinx/xilinx_emacps.c