mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-05-14 01:49:16 +08:00
dpaa: Use receive checksum offload
This commit is contained in:
parent
3471177263
commit
ed254d58e1
@ -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.
|
||||
*/
|
||||
|
@ -433,7 +433,7 @@ fman_mac_dev_attach(device_t dev)
|
||||
ifp->if_softc = sc;
|
||||
if_initname(ifp, &sc->name[0], sc->mac_dev.data.mac_hw_id);
|
||||
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
|
||||
ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_TXCSUM_IPV6 |
|
||||
ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6 |
|
||||
IFCAP_VLAN_MTU | IFCAP_JUMBO_MTU;
|
||||
ifp->if_capenable = ifp->if_capabilities;
|
||||
ifp->if_hwassist = FMAN_MAC_CSUM;
|
||||
|
Loading…
x
Reference in New Issue
Block a user