From owner-svn-src-head@FreeBSD.ORG Mon Sep 29 17:51:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ABA4A1BB; Mon, 29 Sep 2014 17:51:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 8C55ACA8; Mon, 29 Sep 2014 17:51:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8THpeXG047517; Mon, 29 Sep 2014 17:51:40 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8THpdho047514; Mon, 29 Sep 2014 17:51:39 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201409291751.s8THpdho047514@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Mon, 29 Sep 2014 17:51:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272285 - head/sys/dev/ixl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Sep 2014 17:51:40 -0000 Author: rstone Date: Mon Sep 29 17:51:39 2014 New Revision: 272285 URL: http://svnweb.freebsd.org/changeset/base/272285 Log: Ensure that ixl_flush() uses a defined register on VFs In some code that is shared between the ixl(4) and ixlv(4) drivers, a macro hard-coded a register offset that was not valid on ixlv devices. Fix this by having each driver define a variable that contains the correct offset. Reviewed by: Eric Joyner MFC after: 3 days Sponsored by: Sandvine Inc Modified: head/sys/dev/ixl/i40e_osdep.h head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/if_ixlv.c Modified: head/sys/dev/ixl/i40e_osdep.h ============================================================================== --- head/sys/dev/ixl/i40e_osdep.h Mon Sep 29 17:38:50 2014 (r272284) +++ head/sys/dev/ixl/i40e_osdep.h Mon Sep 29 17:51:39 2014 (r272285) @@ -152,6 +152,7 @@ struct i40e_osdep bus_space_tag_t mem_bus_space_tag; bus_space_handle_t mem_bus_space_handle; bus_size_t mem_bus_space_size; + uint32_t flush_reg; struct device *dev; }; @@ -208,6 +209,13 @@ wr32_osdep(struct i40e_osdep *osdep, uin osdep->mem_bus_space_handle, reg, value); } +static __inline void +ixl_flush_osdep(struct i40e_osdep *osdep) +{ + + rd32_osdep(osdep, osdep->flush_reg); +} + #define rd32(a, reg) rd32_osdep((a)->back, (reg)) #define wr32(a, reg, value) wr32_osdep((a)->back, (reg), (value)) @@ -221,9 +229,6 @@ wr32_osdep(struct i40e_osdep *osdep, uin ((struct i40e_osdep *)(a)->back)->mem_bus_space_handle, \ reg, value)) -#define ixl_flush(a) (\ - bus_space_read_4( ((struct i40e_osdep *)(a)->back)->mem_bus_space_tag, \ - ((struct i40e_osdep *)(a)->back)->mem_bus_space_handle, \ - I40E_GLGEN_STAT)) +#define ixl_flush(a) ixl_flush_osdep((a)->back) #endif /* _I40E_OSDEP_H_ */ Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Mon Sep 29 17:38:50 2014 (r272284) +++ head/sys/dev/ixl/if_ixl.c Mon Sep 29 17:51:39 2014 (r272285) @@ -2177,6 +2177,7 @@ ixl_allocate_pci_resources(struct ixl_pf pf->osdep.mem_bus_space_handle = rman_get_bushandle(pf->pci_mem); pf->osdep.mem_bus_space_size = rman_get_size(pf->pci_mem); + pf->osdep.flush_reg = I40E_GLGEN_STAT; pf->hw.hw_addr = (u8 *) &pf->osdep.mem_bus_space_handle; pf->hw.back = &pf->osdep; Modified: head/sys/dev/ixl/if_ixlv.c ============================================================================== --- head/sys/dev/ixl/if_ixlv.c Mon Sep 29 17:38:50 2014 (r272284) +++ head/sys/dev/ixl/if_ixlv.c Mon Sep 29 17:51:39 2014 (r272285) @@ -1137,6 +1137,7 @@ ixlv_allocate_pci_resources(struct ixlv_ sc->osdep.mem_bus_space_handle = rman_get_bushandle(sc->pci_mem); sc->osdep.mem_bus_space_size = rman_get_size(sc->pci_mem); + sc->osdep.flush_reg = I40E_VFGEN_RSTAT; sc->hw.hw_addr = (u8 *) &sc->osdep.mem_bus_space_handle; sc->hw.back = &sc->osdep;