From owner-freebsd-bugs@FreeBSD.ORG Mon Feb 23 10:50:01 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 518FE106566B for ; Mon, 23 Feb 2009 10:50:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 2D2CA8FC14 for ; Mon, 23 Feb 2009 10:50:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n1NAo1P3040761 for ; Mon, 23 Feb 2009 10:50:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n1NAo19b040760; Mon, 23 Feb 2009 10:50:01 GMT (envelope-from gnats) Resent-Date: Mon, 23 Feb 2009 10:50:01 GMT Resent-Message-Id: <200902231050.n1NAo19b040760@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Oleg Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CCB31065670 for ; Mon, 23 Feb 2009 10:40:12 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 3B8B08FC18 for ; Mon, 23 Feb 2009 10:40:12 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n1NAeBAF089340 for ; Mon, 23 Feb 2009 10:40:11 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n1NAeBce089339; Mon, 23 Feb 2009 10:40:11 GMT (envelope-from nobody) Message-Id: <200902231040.n1NAeBce089339@www.freebsd.org> Date: Mon, 23 Feb 2009 10:40:11 GMT From: Oleg To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/132001: [patch] ixgb update X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 10:50:01 -0000 >Number: 132001 >Category: kern >Synopsis: [patch] ixgb update >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Mon Feb 23 10:50:00 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Oleg >Release: FreeBSD 7.1 RELEASE >Organization: Sunbay >Environment: >Description: First of all, need to update driver stored into src/sys/dev/ixgb/ with fresh sources from Intel (ixgb-6.1.0.tar.gz): http://downloadcenter.intel.com/Detail_Desc.aspx?ProductID=2245&DwnldID=10958&lang=eng Next, apply this patch to make Intel driver compiled successfully into FreeBSD 7 environment. >How-To-Repeat: ixgb driver located in the trunk doesnt support cx4 adapter >Fix: Patch attached with submission follows: diff -u -r ixgb-6.1.0/src/if_ixgb.c ixgb-6.1.0-patched/src/if_ixgb.c --- ixgb-6.1.0/src/if_ixgb.c 2006-07-15 01:35:01.000000000 +0300 +++ ixgb-6.1.0-patched/src/if_ixgb.c 2009-01-16 17:06:41.000000000 +0200 @@ -665,8 +665,13 @@ ixgb_stop(adapter); /* Get the latest mac address, User can use a LAA */ +#ifdef IFP2ENADDR bcopy(IFP2ENADDR(adapter->ifp), adapter->hw.curr_mac_addr, IXGB_ETH_LENGTH_OF_ADDRESS); +#elif __FreeBSD_version >= 700000 + bcopy(IF_LLADDR(adapter->ifp), adapter->hw.curr_mac_addr, + IXGB_ETH_LENGTH_OF_ADDRESS); +#endif /* Initialize the hardware */ if (ixgb_hardware_init(adapter)) { @@ -928,7 +933,9 @@ u_int8_t txd_popts; int i, j, error, nsegs; +#if __FreeBSD_version <= 700022 struct m_tag *mtag; +#endif bus_dma_segment_t segs[IXGB_MAX_SCATTER]; bus_dmamap_t map; struct ixgb_buffer *tx_buffer = NULL; @@ -976,7 +983,10 @@ txd_popts = 0; /* Find out if we are in vlan mode */ +#if __FreeBSD_version <= 700022 mtag = VLAN_OUTPUT_TAG(ifp, m_head); +#endif + i = adapter->next_avail_tx_desc; for (j = 0; j < nsegs; j++) { tx_buffer = &adapter->tx_buffer_area[i]; @@ -993,7 +1003,13 @@ adapter->num_tx_desc_avail -= nsegs; adapter->next_avail_tx_desc = i; - +#if __FreeBSD_version > 700022 + if (m_head->m_flags & M_VLANTAG) { + current_tx_desc->cmd_type_len |= IXGB_TX_DESC_CMD_VLE; + current_tx_desc->vlan = m_head->m_pkthdr.ether_vtag; + } else + current_tx_desc->vlan = 0; +#else if (mtag != NULL) { /* Set the vlan id */ current_tx_desc->vlan = VLAN_TAG_VALUE(mtag); @@ -1001,6 +1017,7 @@ /* Tell hardware to add tag */ current_tx_desc->cmd_type_len |= IXGB_TX_DESC_CMD_VLE; } +#endif tx_buffer->m_head = m_head; tx_buffer->map = map; bus_dmamap_sync(adapter->txtag, map, BUS_DMASYNC_PREWRITE); @@ -1254,7 +1271,7 @@ } if (bus_setup_intr(dev, adapter->res_interrupt, INTR_TYPE_NET | INTR_MPSAFE, - (void (*) (void *))ixgb_intr, adapter, + NULL, (void (*) (void *))ixgb_intr, adapter, &adapter->int_handler_tag)) { printf("ixgb%d: Error registering interrupt handler!\n", adapter->unit); @@ -2119,18 +2136,34 @@ ixgb_receive_checksum(adapter, current_desc, adapter->fmp); - if (current_desc->status & IXGB_RX_DESC_STATUS_VP) +#if __FreeBSD_version < 700000 + if (current_desc->status & IXGB_RX_DESC_STATUS_VP) VLAN_INPUT_TAG(eh, adapter->fmp, current_desc->special); +#else + if (current_desc->status & IXGB_RX_DESC_STATUS_VP) { + adapter->fmp->m_pkthdr.ether_vtag = + current_desc->special; + adapter->fmp->m_flags |= M_VLANTAG; + } +#endif else ether_input(ifp, eh, adapter->fmp); #else ixgb_receive_checksum(adapter, current_desc, adapter->fmp); +#if __FreeBSD_version < 700000 if (current_desc->status & IXGB_RX_DESC_STATUS_VP) VLAN_INPUT_TAG(ifp, adapter->fmp, current_desc->special, adapter->fmp = NULL); +#else + if (current_desc->status & IXGB_RX_DESC_STATUS_VP) { + adapter->fmp->m_pkthdr.ether_vtag = + current_desc->special; + adapter->fmp->m_flags |= M_VLANTAG; + } +#endif if (adapter->fmp != NULL) { IXGB_UNLOCK(adapter); >Release-Note: >Audit-Trail: >Unformatted: