cxgbe(4): Use VLAN_TRUNKDEV instead of private cookie to figure out the
parent of a VLAN ifnet. MFC after: 1 week Sponsored by: Chelsio Communications
This commit is contained in:
parent
56f6287638
commit
00438ff7b4
@ -194,8 +194,6 @@ struct vi_info {
|
||||
uint16_t rss_size; /* size of VI's RSS table slice */
|
||||
uint16_t rss_base; /* start of VI's RSS table slice */
|
||||
|
||||
eventhandler_tag vlan_c;
|
||||
|
||||
int nintr;
|
||||
int first_intr;
|
||||
|
||||
|
@ -544,7 +544,6 @@ static void get_regs(struct adapter *, struct t4_regdump *, uint8_t *);
|
||||
static void vi_refresh_stats(struct adapter *, struct vi_info *);
|
||||
static void cxgbe_refresh_stats(struct adapter *, struct port_info *);
|
||||
static void cxgbe_tick(void *);
|
||||
static void cxgbe_vlan_config(void *, struct ifnet *, uint16_t);
|
||||
static void cxgbe_sysctls(struct port_info *);
|
||||
static int sysctl_int_array(SYSCTL_HANDLER_ARGS);
|
||||
static int sysctl_bitfield_8b(SYSCTL_HANDLER_ARGS);
|
||||
@ -1522,9 +1521,6 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi)
|
||||
ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS;
|
||||
ifp->if_hw_tsomaxsegsize = 65536;
|
||||
|
||||
vi->vlan_c = EVENTHANDLER_REGISTER(vlan_config, cxgbe_vlan_config, ifp,
|
||||
EVENTHANDLER_PRI_ANY);
|
||||
|
||||
ether_ifattach(ifp, vi->hw_addr);
|
||||
#ifdef DEV_NETMAP
|
||||
if (ifp->if_capabilities & IFCAP_NETMAP)
|
||||
@ -1602,9 +1598,6 @@ cxgbe_vi_detach(struct vi_info *vi)
|
||||
|
||||
ether_ifdetach(ifp);
|
||||
|
||||
if (vi->vlan_c)
|
||||
EVENTHANDLER_DEREGISTER(vlan_config, vi->vlan_c);
|
||||
|
||||
/* Let detach proceed even if these fail. */
|
||||
#ifdef DEV_NETMAP
|
||||
if (ifp->if_capabilities & IFCAP_NETMAP)
|
||||
@ -5461,18 +5454,6 @@ vi_tick(void *arg)
|
||||
callout_schedule(&vi->tick, hz);
|
||||
}
|
||||
|
||||
static void
|
||||
cxgbe_vlan_config(void *arg, struct ifnet *ifp, uint16_t vid)
|
||||
{
|
||||
struct ifnet *vlan;
|
||||
|
||||
if (arg != ifp || ifp->if_type != IFT_ETHER)
|
||||
return;
|
||||
|
||||
vlan = VLAN_DEVAT(ifp, vid);
|
||||
VLAN_SETCOOKIE(vlan, ifp);
|
||||
}
|
||||
|
||||
/*
|
||||
* Should match fw_caps_config_<foo> enums in t4fw_interface.h
|
||||
*/
|
||||
|
@ -335,7 +335,7 @@ t4_connect(struct toedev *tod, struct socket *so, struct rtentry *rt,
|
||||
if (rt_ifp->if_type == IFT_ETHER)
|
||||
vi = rt_ifp->if_softc;
|
||||
else if (rt_ifp->if_type == IFT_L2VLAN) {
|
||||
struct ifnet *ifp = VLAN_COOKIE(rt_ifp);
|
||||
struct ifnet *ifp = VLAN_TRUNKDEV(rt_ifp);
|
||||
|
||||
vi = ifp->if_softc;
|
||||
VLAN_TAG(rt_ifp, &vid);
|
||||
|
Loading…
x
Reference in New Issue
Block a user