mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-19 10:53:58 +00:00
cxgbe(4): allow the SET_FILTER_MODE ioctl to change the mode when it's
safe to do so. MFC after: 1 month
This commit is contained in:
parent
ec273ebf3b
commit
d5d9fbbae2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=278485
@ -3111,6 +3111,31 @@ void t4_write_rss_pf_mask(struct adapter *adapter, u32 pfmask)
|
||||
&pfmask, 1, A_TP_RSS_PF_MSK);
|
||||
}
|
||||
|
||||
static void refresh_vlan_pri_map(struct adapter *adap)
|
||||
{
|
||||
|
||||
t4_read_indirect(adap, A_TP_PIO_ADDR, A_TP_PIO_DATA,
|
||||
&adap->params.tp.vlan_pri_map, 1,
|
||||
A_TP_VLAN_PRI_MAP);
|
||||
|
||||
/*
|
||||
* Now that we have TP_VLAN_PRI_MAP cached, we can calculate the field
|
||||
* shift positions of several elements of the Compressed Filter Tuple
|
||||
* for this adapter which we need frequently ...
|
||||
*/
|
||||
adap->params.tp.vlan_shift = t4_filter_field_shift(adap, F_VLAN);
|
||||
adap->params.tp.vnic_shift = t4_filter_field_shift(adap, F_VNIC_ID);
|
||||
adap->params.tp.port_shift = t4_filter_field_shift(adap, F_PORT);
|
||||
adap->params.tp.protocol_shift = t4_filter_field_shift(adap, F_PROTOCOL);
|
||||
|
||||
/*
|
||||
* If TP_INGRESS_CONFIG.VNID == 0, then TP_VLAN_PRI_MAP.VNIC_ID
|
||||
* represents the presense of an Outer VLAN instead of a VNIC ID.
|
||||
*/
|
||||
if ((adap->params.tp.ingress_config & F_VNIC) == 0)
|
||||
adap->params.tp.vnic_shift = -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* t4_set_filter_mode - configure the optional components of filter tuples
|
||||
* @adap: the adapter
|
||||
@ -3134,6 +3159,8 @@ int t4_set_filter_mode(struct adapter *adap, unsigned int mode_map)
|
||||
return -EINVAL;
|
||||
t4_write_indirect(adap, A_TP_PIO_ADDR, A_TP_PIO_DATA, &mode_map, 1,
|
||||
A_TP_VLAN_PRI_MAP);
|
||||
refresh_vlan_pri_map(adap);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -5618,33 +5645,10 @@ int __devinit t4_init_tp_params(struct adapter *adap)
|
||||
for (chan = 0; chan < NCHAN; chan++)
|
||||
adap->params.tp.tx_modq[chan] = chan;
|
||||
|
||||
/*
|
||||
* Cache the adapter's Compressed Filter Mode and global Incress
|
||||
* Configuration.
|
||||
*/
|
||||
t4_read_indirect(adap, A_TP_PIO_ADDR, A_TP_PIO_DATA,
|
||||
&adap->params.tp.vlan_pri_map, 1,
|
||||
A_TP_VLAN_PRI_MAP);
|
||||
t4_read_indirect(adap, A_TP_PIO_ADDR, A_TP_PIO_DATA,
|
||||
&adap->params.tp.ingress_config, 1,
|
||||
A_TP_INGRESS_CONFIG);
|
||||
|
||||
/*
|
||||
* Now that we have TP_VLAN_PRI_MAP cached, we can calculate the field
|
||||
* shift positions of several elements of the Compressed Filter Tuple
|
||||
* for this adapter which we need frequently ...
|
||||
*/
|
||||
adap->params.tp.vlan_shift = t4_filter_field_shift(adap, F_VLAN);
|
||||
adap->params.tp.vnic_shift = t4_filter_field_shift(adap, F_VNIC_ID);
|
||||
adap->params.tp.port_shift = t4_filter_field_shift(adap, F_PORT);
|
||||
adap->params.tp.protocol_shift = t4_filter_field_shift(adap, F_PROTOCOL);
|
||||
|
||||
/*
|
||||
* If TP_INGRESS_CONFIG.VNID == 0, then TP_VLAN_PRI_MAP.VNIC_ID
|
||||
* represents the presense of an Outer VLAN instead of a VNIC ID.
|
||||
*/
|
||||
if ((adap->params.tp.ingress_config & F_VNIC) == 0)
|
||||
adap->params.tp.vnic_shift = -1;
|
||||
refresh_vlan_pri_map(adap);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -7116,10 +7116,9 @@ get_filter_mode(struct adapter *sc, uint32_t *mode)
|
||||
log(LOG_WARNING, "%s: cached filter mode out of sync %x %x.\n",
|
||||
device_get_nameunit(sc->dev), sc->params.tp.vlan_pri_map,
|
||||
fconf);
|
||||
sc->params.tp.vlan_pri_map = fconf;
|
||||
}
|
||||
|
||||
*mode = fconf_to_mode(sc->params.tp.vlan_pri_map);
|
||||
*mode = fconf_to_mode(fconf);
|
||||
|
||||
end_synchronized_op(sc, LOCK_HELD);
|
||||
return (0);
|
||||
@ -7150,14 +7149,7 @@ set_filter_mode(struct adapter *sc, uint32_t mode)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef notyet
|
||||
rc = -t4_set_filter_mode(sc, fconf);
|
||||
if (rc == 0)
|
||||
sc->filter_mode = fconf;
|
||||
#else
|
||||
rc = ENOTSUP;
|
||||
#endif
|
||||
|
||||
done:
|
||||
end_synchronized_op(sc, LOCK_HELD);
|
||||
return (rc);
|
||||
|
Loading…
Reference in New Issue
Block a user