From ed254d58e1fa80c087f98f4ac5818a4e17547cac Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 18 May 2017 08:13:07 +0200 Subject: dpaa: Use receive checksum offload --- linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c') 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. */ -- cgit v1.2.3