Deleted Added
full compact
hv_netvsc_drv_freebsd.c (270856) hv_netvsc_drv_freebsd.c (271849)
1/*-
2 * Copyright (c) 2010-2012 Citrix Inc.
3 * Copyright (c) 2009-2012 Microsoft Corp.
4 * Copyright (c) 2012 NetApp Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 39 unchanged lines hidden (view full) ---

48 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
49 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
50 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
51 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
52 * SUCH DAMAGE.
53 */
54
55#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2010-2012 Citrix Inc.
3 * Copyright (c) 2009-2012 Microsoft Corp.
4 * Copyright (c) 2012 NetApp Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 39 unchanged lines hidden (view full) ---

48 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
49 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
50 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
51 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
52 * SUCH DAMAGE.
53 */
54
55#include <sys/cdefs.h>
56__FBSDID("$FreeBSD: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c 270856 2014-08-30 19:55:54Z glebius $");
56__FBSDID("$FreeBSD: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c 271849 2014-09-19 03:51:26Z glebius $");
57
58#include <sys/param.h>
59#include <sys/systm.h>
60#include <sys/sockio.h>
61#include <sys/mbuf.h>
62#include <sys/malloc.h>
63#include <sys/module.h>
64#include <sys/kernel.h>

--- 430 unchanged lines hidden (view full) ---

495 packet->compl.send.on_send_completion = netvsc_xmit_completion;
496 packet->compl.send.send_completion_context = packet;
497 packet->compl.send.send_completion_tid = (uint64_t)(uintptr_t)m_head;
498
499 /* Removed critical_enter(), does not appear necessary */
500 ret = hv_rf_on_send(device_ctx, packet);
501
502 if (ret == 0) {
57
58#include <sys/param.h>
59#include <sys/systm.h>
60#include <sys/sockio.h>
61#include <sys/mbuf.h>
62#include <sys/malloc.h>
63#include <sys/module.h>
64#include <sys/kernel.h>

--- 430 unchanged lines hidden (view full) ---

495 packet->compl.send.on_send_completion = netvsc_xmit_completion;
496 packet->compl.send.send_completion_context = packet;
497 packet->compl.send.send_completion_tid = (uint64_t)(uintptr_t)m_head;
498
499 /* Removed critical_enter(), does not appear necessary */
500 ret = hv_rf_on_send(device_ctx, packet);
501
502 if (ret == 0) {
503 ifp->if_opackets++;
503 if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
504 /* if bpf && mc_head, call bpf_mtap code */
505 if (mc_head) {
506 ETHER_BPF_MTAP(ifp, mc_head);
507 }
508 } else {
509 retries++;
510 if (retries < 4) {
511 goto retry_send;

--- 185 unchanged lines hidden (view full) ---

697 m_new->m_flags |= M_VLANTAG;
698 }
699
700 /*
701 * Note: Moved RX completion back to hv_nv_on_receive() so all
702 * messages (not just data messages) will trigger a response.
703 */
704
504 /* if bpf && mc_head, call bpf_mtap code */
505 if (mc_head) {
506 ETHER_BPF_MTAP(ifp, mc_head);
507 }
508 } else {
509 retries++;
510 if (retries < 4) {
511 goto retry_send;

--- 185 unchanged lines hidden (view full) ---

697 m_new->m_flags |= M_VLANTAG;
698 }
699
700 /*
701 * Note: Moved RX completion back to hv_nv_on_receive() so all
702 * messages (not just data messages) will trigger a response.
703 */
704
705 ifp->if_ipackets++;
705 if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
706
707 /* We're not holding the lock here, so don't release it */
708 (*ifp->if_input)(ifp, m_new);
709
710 return (0);
711}
712
713/*

--- 269 unchanged lines hidden (view full) ---

983static void
984hn_watchdog(struct ifnet *ifp)
985{
986 hn_softc_t *sc;
987 sc = ifp->if_softc;
988
989 printf("hn%d: watchdog timeout -- resetting\n", sc->hn_unit);
990 hn_ifinit(sc); /*???*/
706
707 /* We're not holding the lock here, so don't release it */
708 (*ifp->if_input)(ifp, m_new);
709
710 return (0);
711}
712
713/*

--- 269 unchanged lines hidden (view full) ---

983static void
984hn_watchdog(struct ifnet *ifp)
985{
986 hn_softc_t *sc;
987 sc = ifp->if_softc;
988
989 printf("hn%d: watchdog timeout -- resetting\n", sc->hn_unit);
990 hn_ifinit(sc); /*???*/
991 ifp->if_oerrors++;
991 if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
992}
993#endif
994
995static device_method_t netvsc_methods[] = {
996 /* Device interface */
997 DEVMETHOD(device_probe, netvsc_probe),
998 DEVMETHOD(device_attach, netvsc_attach),
999 DEVMETHOD(device_detach, netvsc_detach),

--- 19 unchanged lines hidden ---
992}
993#endif
994
995static device_method_t netvsc_methods[] = {
996 /* Device interface */
997 DEVMETHOD(device_probe, netvsc_probe),
998 DEVMETHOD(device_attach, netvsc_attach),
999 DEVMETHOD(device_detach, netvsc_detach),

--- 19 unchanged lines hidden ---