diff options
author | Alexander Motin <mav@FreeBSD.org> | 2016-07-09 12:00:04 +0000 |
---|---|---|
committer | Alexander Motin <mav@FreeBSD.org> | 2016-07-09 12:00:04 +0000 |
commit | b42e3ec60b94176410d7a109bc266c5967db582e (patch) | |
tree | e8a20088edcc5e7df2de29836b8736e72acc206c /sys/dev/ntb/if_ntb | |
parent | a7e0f01a3d669fc708e6dca3b0134082e97105c5 (diff) | |
download | src-b42e3ec60b94176410d7a109bc266c5967db582e.tar.gz src-b42e3ec60b94176410d7a109bc266c5967db582e.zip |
Improve memory allocation errors handling on receive.
Notes
Notes:
svn path=/head/; revision=302495
Diffstat (limited to 'sys/dev/ntb/if_ntb')
-rw-r--r-- | sys/dev/ntb/if_ntb/if_ntb.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/ntb/if_ntb/if_ntb.c b/sys/dev/ntb/if_ntb/if_ntb.c index d592e09b39dd..4c0914909969 100644 --- a/sys/dev/ntb/if_ntb/if_ntb.c +++ b/sys/dev/ntb/if_ntb/if_ntb.c @@ -241,7 +241,12 @@ ntb_net_rx_handler(struct ntb_transport_qp *qp, void *qp_data, void *data, struct mbuf *m = data; struct ifnet *ifp = qp_data; - CTR0(KTR_NTB, "RX: rx handler"); + CTR1(KTR_NTB, "RX: rx handler (%d)", len); + if (len < 0) { + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); + return; + } + m->m_pkthdr.csum_flags = CSUM_IP_CHECKED | CSUM_IP_VALID; (*ifp->if_input)(ifp, m); } |