PERFORCE change 118650 for review
Kip Macy
kmacy at FreeBSD.org
Mon Apr 23 09:01:52 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=118650
Change 118650 by kmacy at kmacy_vt-x:opentoe_init on 2007/04/23 09:01:40
move more offload functionality out from underneath "notyet"
now that l2t is largely implemented
Affected files ...
.. //depot/projects/opentoe/sys/dev/cxgb/cxgb_offload.c#7 edit
.. //depot/projects/opentoe/sys/dev/cxgb/cxgb_offload.h#7 edit
.. //depot/projects/opentoe/sys/dev/cxgb/cxgb_toedev.h#5 edit
Differences ...
==== //depot/projects/opentoe/sys/dev/cxgb/cxgb_offload.c#7 (text+ko) ====
@@ -69,6 +69,7 @@
#include <dev/cxgb/cxgb_offload.h>
#include <net/if_vlan_var.h>
+#include <net/route.h>
/*
* XXX
@@ -481,7 +482,7 @@
}
static void
-dummy_neigh_update(struct toedev *dev, struct ifnet *neigh)
+dummy_neigh_update(struct toedev *dev, struct rtentry *neigh)
{
}
@@ -551,7 +552,7 @@
req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_TID_RELEASE, tid));
}
-#ifdef notyet
+
static void
t3_process_tid_release_list(void *data, int pending)
{
@@ -573,7 +574,7 @@
}
mtx_unlock(&td->tid_release_lock);
}
-#endif
+
/* use ctx as a next pointer in the tid release list */
void
cxgb_queue_tid_release(struct toedev *tdev, unsigned int tid)
@@ -584,7 +585,7 @@
mtx_lock(&td->tid_release_lock);
p->ctx = (void *)td->tid_release_list;
td->tid_release_list = p;
-#if 0
+#ifdef notyet
if (!p->ctx)
schedule_work(&td->tid_release_task);
#endif
@@ -888,7 +889,7 @@
}
static void
-neigh_connect(struct neighbour *neigh)
+neigh_connect(struct ifnet *neigh)
{
struct hh_cache *hh;
@@ -1189,18 +1190,17 @@
}
void
-cxgb_neigh_update(struct ifnet *ifp)
+cxgb_neigh_update(struct rtentry *rt)
{
- if (is_offloading(ifp)) {
- struct toedev *tdev = TOEDEV(ifp);
+ if (is_offloading(rt->rt_ifp)) {
+ struct toedev *tdev = TOEDEV(rt->rt_ifp);
BUG_ON(!tdev);
- t3_l2t_update(tdev, ifp);
+ t3_l2t_update(tdev, rt);
}
}
-#if 0
static void
set_l2t_ix(struct toedev *tdev, u32 tid, struct l2t_entry *e)
{
@@ -1226,7 +1226,7 @@
}
void
-cxgb_redirect(struct dst_entry *old, struct dst_entry *new)
+cxgb_redirect(struct rtentry *old, struct rtentry *new)
{
struct ifnet *olddev, *newdev;
struct tid_info *ti;
@@ -1236,8 +1236,8 @@
struct l2t_entry *e;
struct toe_tid_entry *te;
- olddev = old->neighbour->dev;
- newdev = new->neighbour->dev;
+ olddev = old->rt_ifp;
+ newdev = new->rt_ifp;
if (!is_offloading(olddev))
return;
if (!is_offloading(newdev)) {
@@ -1248,13 +1248,13 @@
tdev = TOEDEV(olddev);
BUG_ON(!tdev);
if (tdev != TOEDEV(newdev)) {
- log(LOG_WARNING "%s: Redirect to different "
+ log(LOG_WARNING, "%s: Redirect to different "
"offload device ignored.\n", __FUNCTION__);
return;
}
/* Add new L2T entry */
- e = t3_l2t_get(tdev, new->neighbour, new->neighbour->dev->if_port);
+ e = t3_l2t_get(tdev, new, ((struct port_info *)new->rt_ifp->if_softc)->port);
if (!e) {
log(LOG_ERR, "%s: couldn't allocate new l2t entry!\n",
__FUNCTION__);
@@ -1277,7 +1277,7 @@
}
l2t_release(L2DATA(tdev), e);
}
-#endif
+
/*
* Allocate a chunk of memory using kmalloc or, if that fails, vmalloc.
* The allocated memory is cleared.
@@ -1298,7 +1298,7 @@
free(addr, M_DEVBUF);
}
-#ifdef notyet
+
/*
* Allocate and initialize the TID tables. Returns 0 on success.
*/
@@ -1343,7 +1343,7 @@
}
return 0;
}
-#endif
+
static void
free_tid_maps(struct tid_info *t)
{
@@ -1374,7 +1374,6 @@
int
cxgb_offload_activate(struct adapter *adapter)
{
-#ifdef notyet
struct toedev *dev = &adapter->tdev;
int natids, err;
struct toe_data *t;
@@ -1435,8 +1434,7 @@
out_free:
free(t, M_DEVBUF);
return err;
-#endif
- return (EOPNOTSUPP);
+
}
void
==== //depot/projects/opentoe/sys/dev/cxgb/cxgb_offload.h#7 (text+ko) ====
@@ -79,11 +79,9 @@
void (*add) (struct toedev *);
void (*remove) (struct toedev *);
cxgb_cpl_handler_func *handlers;
-#ifdef notyet
- int (*redirect)(void *ctx, struct dst_entry *old,
- struct dst_entry *new,
+ int (*redirect)(void *ctx, struct rtentry *old,
+ struct rtentry *new,
struct l2t_entry *l2t);
-#endif
TAILQ_ENTRY(cxgb_client) client_entry;
};
@@ -252,10 +250,8 @@
void *cxgb_alloc_mem(unsigned long size);
void cxgb_free_mem(void *addr);
-void cxgb_neigh_update(struct ifnet *ifp);
-#if 0
-void cxgb_redirect(struct dst_entry *old, struct dst_entry *new);
-#endif
+void cxgb_neigh_update(struct rtentry *rt);
+void cxgb_redirect(struct rtentry *old, struct rtentry *new);
int process_rx(struct toedev *dev, struct mbuf **m, int n);
int attach_toedev(struct toedev *dev);
void detach_toedev(struct toedev *dev);
==== //depot/projects/opentoe/sys/dev/cxgb/cxgb_toedev.h#5 (text+ko) ====
@@ -59,7 +59,7 @@
/*
* XXX point to ARP list entry
*/
- void (*neigh_update)(struct toedev *dev, struct ifnet *ifp);
+ void (*neigh_update)(struct toedev *dev, struct rtentry *rt);
void *priv; /* driver private data */
void *l2opt; /* optional layer 2 data */
void *l3opt; /* optional layer 3 data */
More information about the p4-projects
mailing list