summaryrefslogtreecommitdiffstats
path: root/linux
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-05-18 08:13:07 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-10-23 09:24:05 +0200
commited254d58e1fa80c087f98f4ac5818a4e17547cac (patch)
tree36eb115311595648a02ef49d6f435d3ed50a95c3 /linux
parent3471177263dcf828ecb8a34f4a3c0ed03aa78bd9 (diff)
downloadrtems-libbsd-ed254d58e1fa80c087f98f4ac5818a4e17547cac.tar.bz2
dpaa: Use receive checksum offload
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
index be6d0d7c..3698101a 100644
--- a/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
+++ b/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
@@ -2272,7 +2272,7 @@ static void dpaa_tx_conf(struct net_device *net_dev,
#else /* __rtems__ */
struct ifnet *ifp = net_dev->ifp;
- if (unlikely(fd->status & FM_FD_STAT_TX_ERRORS) != 0) {
+ if (unlikely(be32_to_cpu(fd->status) & FM_FD_STAT_TX_ERRORS) != 0) {
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
}
@@ -2427,13 +2427,15 @@ dpaa_rx(struct net_device *net_dev, struct qman_portal *portal,
const struct qm_fd *fd, u32 fqid, int *count_ptr)
{
struct dpaa_bp *dpaa_bp;
+ u32 fd_status;
enum qm_fd_format fd_format;
struct mbuf *m;
struct ifnet *ifp;
+ fd_status = be32_to_cpu(fd->status);
ifp = net_dev->ifp;
- if (unlikely(fd->status & FM_FD_STAT_RX_ERRORS) != 0) {
+ if (unlikely(fd_status & FM_FD_STAT_RX_ERRORS) != 0) {
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
dpaa_fd_release(net_dev, fd);
return;
@@ -2449,6 +2451,12 @@ dpaa_rx(struct net_device *net_dev, struct qman_portal *portal,
m = sg_fd_to_mbuf(dpaa_bp, fd, ifp, count_ptr);
}
+ if ((be32_to_cpu(fd->status) & FM_FD_STAT_L4CV) != 0) {
+ m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED | CSUM_IP_VALID |
+ CSUM_DATA_VALID | CSUM_PSEUDO_HDR;
+ m->m_pkthdr.csum_data = 0xffff;
+ }
+
/* Account for either the contig buffer or the SGT buffer (depending on
* which case we were in) having been removed from the pool.
*/