aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sfxge/common/ef10_nic.c
diff options
context:
space:
mode:
authorAndrew Rybchenko <arybchik@FreeBSD.org>2018-11-26 06:20:13 +0000
committerAndrew Rybchenko <arybchik@FreeBSD.org>2018-11-26 06:20:13 +0000
commitfdbe38cf9d141b62afae760a2f30d545949d8650 (patch)
tree40240151e1fa3f3b199a3606c2be6286ebd63d85 /sys/dev/sfxge/common/ef10_nic.c
parenta02bd3e38ccefc7c2de92652ebd11d12e53efa85 (diff)
downloadsrc-fdbe38cf9d141b62afae760a2f30d545949d8650.tar.gz
src-fdbe38cf9d141b62afae760a2f30d545949d8650.zip
sfxge(4): add API to control UDP tunnel ports
HW needs to know which UDP packets should be treated as tunnel encapsulation to do inner packet recognition, classification and offloads. Submitted by: Ivan Malov <ivan.malov at oktetlabs.ru> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18134
Notes
Notes: svn path=/head/; revision=340928
Diffstat (limited to 'sys/dev/sfxge/common/ef10_nic.c')
-rw-r--r--sys/dev/sfxge/common/ef10_nic.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/dev/sfxge/common/ef10_nic.c b/sys/dev/sfxge/common/ef10_nic.c
index 7032ffbc665b..4cd1a8c86ec8 100644
--- a/sys/dev/sfxge/common/ef10_nic.c
+++ b/sys/dev/sfxge/common/ef10_nic.c
@@ -1079,12 +1079,20 @@ ef10_get_datapath_caps(
* Check if firmware supports VXLAN and NVGRE tunnels.
* The capability indicates Geneve protocol support as well.
*/
- if (CAP_FLAG(flags, VXLAN_NVGRE))
+ if (CAP_FLAG(flags, VXLAN_NVGRE)) {
encp->enc_tunnel_encapsulations_supported =
(1u << EFX_TUNNEL_PROTOCOL_VXLAN) |
(1u << EFX_TUNNEL_PROTOCOL_GENEVE) |
(1u << EFX_TUNNEL_PROTOCOL_NVGRE);
+ EFX_STATIC_ASSERT(EFX_TUNNEL_MAXNENTRIES ==
+ MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_ENTRIES_MAXNUM);
+ encp->enc_tunnel_config_udp_entries_max =
+ EFX_TUNNEL_MAXNENTRIES;
+ } else {
+ encp->enc_tunnel_config_udp_entries_max = 0;
+ }
+
#undef CAP_FLAG
#undef CAP_FLAG2