freebsd compat: Updates and additions for a newer iflib.

This commit is contained in:
Augustin Cavalier
2021-10-20 19:13:19 -04:00
parent a139e89af2
commit 034d500610
5 changed files with 32 additions and 1 deletions
@@ -610,4 +610,16 @@ static __inline void IFDI_DEBUG(if_ctx_t _ctx)
((ifdi_debug_t *) _m)(_ctx);
}
extern struct kobjop_desc ifdi_needs_restart_desc;
typedef bool ifdi_needs_restart_t(if_ctx_t _ctx, enum iflib_restart_event _event);
static __inline bool IFDI_NEEDS_RESTART(if_ctx_t _ctx, enum iflib_restart_event _event)
{
kobjop_t _m;
bool rc;
KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_needs_restart);
rc = ((ifdi_needs_restart_t *) _m)(_ctx, _event);
return (rc);
}
#endif
@@ -98,6 +98,7 @@ void taskqgroup_config_gtask_deinit(struct grouptask *gtask);
#define GROUPTASK_INIT(gtask, priority, func, context) \
GTASK_INIT(&(gtask)->gt_task, TASK_SKIP_WAKEUP, priority, func, context)
#define NET_GROUPTASK_INIT GROUPTASK_INIT
#define GROUPTASK_ENQUEUE(gtask) \
grouptaskqueue_enqueue((gtask)->gt_taskqueue, &(gtask)->gt_task)
+9
View File
@@ -103,6 +103,11 @@
{
}
static bool
null_needs_restart_op(if_ctx_t _ctx __unused, enum iflib_restart_event _event __unused)
{
}
static int
null_q_setup(if_ctx_t _ctx __unused, uint32_t _qid __unused)
{
@@ -377,3 +382,7 @@ struct kobjop_desc ifdi_sysctl_int_delay_desc = {
struct kobjop_desc ifdi_debug_desc = {
0, { NULL, ID_ifdi_debug, (kobjop_t)null_void_op }
};
struct kobjop_desc ifdi_needs_restart_desc = {
0, { NULL, ID_ifdi_needs_restart, (kobjop_t)null_needs_restart_op }
};
@@ -35,13 +35,21 @@
#define IFCAP_TOE4 0x04000 /* interface can offload TCP */
#define IFCAP_TOE6 0x08000 /* interface can offload TCP6 */
#define IFCAP_VLAN_HWFILTER 0x10000 /* interface hw can filter vlan tag */
#define IFCAP_POLLING_NOCOUNT 0x20000 /* polling ticks cannot be fragmented */
/* available 0x20000 */
#define IFCAP_VLAN_HWTSO 0x40000 /* can do IFCAP_TSO on VLANs */
#define IFCAP_LINKSTATE 0x80000 /* the runtime link state is dynamic */
#define IFCAP_NETMAP 0x100000 /* netmap mode supported/enabled */
#define IFCAP_RXCSUM_IPV6 0x200000 /* can offload checksum on IPv6 RX */
#define IFCAP_TXCSUM_IPV6 0x400000 /* can offload checksum on IPv6 TX */
#define IFCAP_HWSTATS 0x800000 /* manages counters internally */
#define IFCAP_TXRTLMT 0x1000000 /* hardware supports TX rate limiting */
#define IFCAP_HWRXTSTMP 0x2000000 /* hardware rx timestamping */
#define IFCAP_MEXTPG 0x4000000 /* understands M_EXTPG mbufs */
#define IFCAP_TXTLS4 0x8000000 /* can do TLS encryption and segmentation for TCP */
#define IFCAP_TXTLS6 0x10000000 /* can do TLS encryption and segmentation for TCP6 */
#define IFCAP_VXLAN_HWCSUM 0x20000000 /* can do IFCAN_HWCSUM on VXLANs */
#define IFCAP_VXLAN_HWTSO 0x40000000 /* can do IFCAP_TSO on VXLANs */
#define IFCAP_TXTLS_RTLMT 0x80000000 /* can do TLS with rate limiting */
#define IFCAP_HWCSUM_IPV6 (IFCAP_RXCSUM_IPV6 | IFCAP_TXCSUM_IPV6)
@@ -78,6 +78,7 @@ enum device_method_ids {
ID_ifdi_vlan_unregister,
ID_ifdi_sysctl_int_delay,
ID_ifdi_debug,
ID_ifdi_needs_restart,
};