From owner-svn-src-stable-10@freebsd.org Thu Oct 15 20:37:31 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4ACAA167C1; Thu, 15 Oct 2015 20:37:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56897FE4; Thu, 15 Oct 2015 20:37:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9FKbUuX034117; Thu, 15 Oct 2015 20:37:30 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9FKbUVI034115; Thu, 15 Oct 2015 20:37:30 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201510152037.t9FKbUVI034115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 15 Oct 2015 20:37:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r289386 - stable/10/sys/dev/e1000 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2015 20:37:31 -0000 Author: adrian Date: Thu Oct 15 20:37:30 2015 New Revision: 289386 URL: https://svnweb.freebsd.org/changeset/base/289386 Log: if_lem: Bring over the missing pieces from -HEAD to make NIC_PARAVIRT work. The paravirt support for the driver and netmap code was already MFCed, but the adapter and ifnet API bits weren't. This was backported from -HEAD by Eric Melville . Submitted by: eric Sponsored by: Norse Corp, Inc. Modified: stable/10/sys/dev/e1000/if_lem.c stable/10/sys/dev/e1000/if_lem.h Modified: stable/10/sys/dev/e1000/if_lem.c ============================================================================== --- stable/10/sys/dev/e1000/if_lem.c Thu Oct 15 20:36:04 2015 (r289385) +++ stable/10/sys/dev/e1000/if_lem.c Thu Oct 15 20:37:30 2015 (r289386) @@ -951,7 +951,7 @@ lem_start_locked(struct ifnet *ifp) if (adapter->num_tx_desc_avail <= EM_TX_OP_THRESHOLD) ifp->if_drv_flags |= IFF_DRV_OACTIVE; #ifdef NIC_PARAVIRT - if (if_getdrvflags(ifp) & IFF_DRV_OACTIVE && adapter->csb && + if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) && adapter->csb && adapter->csb->guest_csb_on && !(adapter->csb->guest_need_txkick & 1)) { adapter->csb->guest_need_txkick = 1; Modified: stable/10/sys/dev/e1000/if_lem.h ============================================================================== --- stable/10/sys/dev/e1000/if_lem.h Thu Oct 15 20:36:04 2015 (r289385) +++ stable/10/sys/dev/e1000/if_lem.h Thu Oct 15 20:37:30 2015 (r289386) @@ -265,6 +265,13 @@ #define PICOSECS_PER_TICK 20833 #define TSYNC_PORT 319 /* UDP port for the protocol */ +#ifdef NIC_PARAVIRT +#define E1000_PARA_SUBDEV 0x1101 /* special id */ +#define E1000_CSBAL 0x02830 /* csb phys. addr. low */ +#define E1000_CSBAH 0x02834 /* csb phys. addr. hi */ +#include +#endif + /* * Bus dma allocation structure used by * e1000_dma_malloc and e1000_dma_free. @@ -437,6 +444,15 @@ struct adapter { boolean_t pcix_82544; boolean_t in_detach; +#ifdef NIC_PARAVIRT + struct em_dma_alloc csb_mem; + struct paravirt_csb *csb; + uint32_t rx_retries; + uint32_t tdt_csb_count; + uint32_t tdt_reg_count; + uint32_t tdt_int_count; + uint32_t guest_need_kick_count; +#endif struct e1000_hw_stats stats; };