From owner-p4-projects@FreeBSD.ORG Thu Apr 19 07:23:55 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A932316A404; Thu, 19 Apr 2007 07:23:55 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 56C0116A400 for ; Thu, 19 Apr 2007 07:23:55 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 46F7013C459 for ; Thu, 19 Apr 2007 07:23:55 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l3J7Ntgx021173 for ; Thu, 19 Apr 2007 07:23:55 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l3J7NtjZ021169 for perforce@freebsd.org; Thu, 19 Apr 2007 07:23:55 GMT (envelope-from kmacy@freebsd.org) Date: Thu, 19 Apr 2007 07:23:55 GMT Message-Id: <200704190723.l3J7NtjZ021169@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to kmacy@freebsd.org using -f From: Kip Macy To: Perforce Change Reviews Cc: Subject: PERFORCE change 118397 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2007 07:23:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=118397 Change 118397 by kmacy@kmacy_vt-x:opentoe_init on 2007/04/19 07:22:58 remove last vestiges of t3cdev enable offload support at attach time Affected files ... .. //depot/projects/opentoe/sys/dev/cxgb/cxgb_adapter.h#8 edit .. //depot/projects/opentoe/sys/dev/cxgb/cxgb_l2t.c#2 edit .. //depot/projects/opentoe/sys/dev/cxgb/cxgb_main.c#5 edit .. //depot/projects/opentoe/sys/dev/cxgb/cxgb_offload.c#5 edit .. //depot/projects/opentoe/sys/dev/cxgb/cxgb_offload.h#5 edit .. //depot/projects/opentoe/sys/dev/cxgb/cxgb_osdep.h#6 edit .. //depot/projects/opentoe/sys/dev/cxgb/cxgb_sge.c#6 edit Differences ... ==== //depot/projects/opentoe/sys/dev/cxgb/cxgb_adapter.h#8 (text+ko) ==== @@ -128,14 +128,6 @@ struct sge_lro_session s[MAX_LRO_PER_QSET]; }; -/* has its own header on linux XXX - * but I don't even know what it is :-/ - */ - -struct t3cdev { - int foo; /* XXX fill in */ -}; - #define RX_BUNDLE_SIZE 8 struct rsp_desc; @@ -298,6 +290,7 @@ struct toedev tdev; char fw_version[64]; uint32_t open_device_map; + uint32_t registered_device_map; struct mtx lock; }; ==== //depot/projects/opentoe/sys/dev/cxgb/cxgb_l2t.c#2 (text+ko) ==== @@ -1,42 +1,9 @@ -/* - * Copyright (c) 2006 Chelsio, Inc. All rights reserved. - * Copyright (c) 2006 Open Grid Computing, Inc. All rights reserved. - * - * This software is available to you under a choice of one of two - * licenses. You may choose to be licensed under the terms of the GNU - * General Public License (GPL) Version 2, available from the file - * COPYING in the main directory of this source tree, or the - * OpenIB.org BSD license below: - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * - Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * - * - Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ #include #include #include #include #include #include -#include "t3cdev.h" #include "cxgb3_defs.h" #include "l2t.h" #include "t3_cpl.h" @@ -83,7 +50,7 @@ * supplied skb is used for the CPL_L2T_WRITE_REQ. Must be called with the * entry locked. */ -static int setup_l2e_send_pending(struct t3cdev *dev, struct sk_buff *skb, +static int setup_l2e_send_pending(struct toedev *dev, struct sk_buff *skb, struct l2t_entry *e) { struct cpl_l2t_write_req *req; @@ -130,7 +97,7 @@ e->arpq_tail = skb; } -int t3_l2t_send_slow(struct t3cdev *dev, struct sk_buff *skb, +int t3_l2t_send_slow(struct toedev *dev, struct sk_buff *skb, struct l2t_entry *e) { again: @@ -178,7 +145,7 @@ } EXPORT_SYMBOL(t3_l2t_send_slow); -void t3_l2t_send_event(struct t3cdev *dev, struct l2t_entry *e) +void t3_l2t_send_event(struct toedev *dev, struct l2t_entry *e) { again: switch (e->state) { @@ -299,7 +266,7 @@ spin_unlock(&e->lock); } -struct l2t_entry *t3_l2t_get(struct t3cdev *dev, struct neighbour *neigh, +struct l2t_entry *t3_l2t_get(struct toedev *dev, struct neighbour *neigh, unsigned int smt_idx) { struct l2t_entry *e; @@ -350,7 +317,7 @@ * XXX: maybe we should abandon the latter behavior and just require a failure * handler. */ -static void handle_failed_resolution(struct t3cdev *dev, struct sk_buff *arpq) +static void handle_failed_resolution(struct toedev *dev, struct sk_buff *arpq) { while (arpq) { struct sk_buff *skb = arpq; @@ -369,7 +336,7 @@ * Called when the host's ARP layer makes a change to some entry that is * loaded into the HW L2 table. */ -void t3_l2t_update(struct t3cdev *dev, struct neighbour *neigh) +void t3_l2t_update(struct toedev *dev, struct neighbour *neigh) { struct l2t_entry *e; struct sk_buff *arpq = NULL; @@ -415,7 +382,7 @@ /* * Called from a kprobe, interrupts are off. */ -void t3_l2t_update(struct t3cdev *dev, struct neighbour *neigh) +void t3_l2t_update(struct toedev *dev, struct neighbour *neigh) { struct l2t_entry *e; struct l2t_data *d = L2DATA(dev); @@ -444,7 +411,7 @@ struct sk_buff *arpq = NULL; struct l2t_entry *e = (struct l2t_entry *)data; struct neighbour *neigh = e->neigh; - struct t3cdev *dev = e->tdev; + struct toedev *dev = e->tdev; barrier(); if (!atomic_read(&e->refcnt)) ==== //depot/projects/opentoe/sys/dev/cxgb/cxgb_main.c#5 (text+ko) ==== @@ -79,6 +79,7 @@ #include #include #include +#include #include #include #include @@ -504,6 +505,11 @@ if (error) goto out; + if (is_offload(sc)) { + setbit(&sc->registered_device_map, OFFLOAD_DEVMAP_BIT); + cxgb_adapter_ofld(sc); + } + snprintf(&sc->fw_version[0], sizeof(sc->fw_version), "%d.%d", G_FW_VERSION_MAJOR(vers), G_FW_VERSION_MINOR(vers)); ==== //depot/projects/opentoe/sys/dev/cxgb/cxgb_offload.c#5 (text+ko) ==== @@ -204,10 +204,10 @@ return 0; } -static struct net_device * +static struct ifnet * get_iff_from_mac(adapter_t *adapter, const uint8_t *mac, unsigned int vlan) { -#ifdef notyet +#ifdef notyet int i; for_each_port(adapter, i) { @@ -215,8 +215,8 @@ const struct port_info *p = &adapter->port[i]; struct ifnet *ifnet = p->ifp; - if (!memcmp(port->hw_addr, mac, ETH_ALEN)) { - if (vlan && vlan != VLAN_VID_MASK) { + if (!memcmp(p->hw_addr, mac, ETHER_ADDR_LEN)) { + if (vlan && vlan != EVL_VLID_MASK) { grp = p->vlan_grp; dev = grp ? grp->vlan_devices[vlan] : NULL; } else @@ -225,7 +225,7 @@ return dev; } } -#endif +#endif return NULL; } @@ -1444,7 +1444,7 @@ mtx_unlock(&cxgb_db_lock); } -void __devinit +void cxgb_adapter_ofld(struct adapter *adapter) { struct toedev *tdev = &adapter->tdev; ==== //depot/projects/opentoe/sys/dev/cxgb/cxgb_offload.h#5 (text+ko) ==== @@ -256,8 +256,8 @@ void cxgb_redirect(struct dst_entry *old, struct dst_entry *new); #endif int process_rx(struct toedev *dev, struct mbuf **m, int n); -int attach_t3cdev(struct toedev *dev); -void detach_t3cdev(struct toedev *dev); +int attach_toedev(struct toedev *dev); +void detach_toedev(struct toedev *dev); #endif ==== //depot/projects/opentoe/sys/dev/cxgb/cxgb_osdep.h#6 (text+ko) ==== @@ -138,6 +138,9 @@ #define t3_os_sleep(x) DELAY((x) * 1000) #define max_t(type, a, b) (type)max((a), (b)) +#define net_device ifnet + + /* Standard PHY definitions */ #define BMCR_LOOPBACK BMCR_LOOP ==== //depot/projects/opentoe/sys/dev/cxgb/cxgb_sge.c#6 (text+ko) ==== @@ -1690,13 +1690,13 @@ #define NOMEM_INTR_DELAY 2500 static __inline void -deliver_partial_bundle(struct t3cdev *tdev, struct sge_rspq *q) +deliver_partial_bundle(struct toedev *tdev, struct sge_rspq *q) { ; } static __inline void -rx_offload(struct t3cdev *tdev, struct sge_rspq *rq, +rx_offload(struct toedev *tdev, struct sge_rspq *rq, struct mbuf *m) { #ifdef notyet