Author: arybchik
Date: Thu Nov 29 06:42:26 2018
New Revision: 341188
URL: https://svnweb.freebsd.org/changeset/base/341188

Log:
  sfxge(4): support VXLAN filter creation
  
  Submitted by:   Vijay Srivastava <vijays at solarflare.com>
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18219

Modified:
  head/sys/dev/sfxge/common/efx.h
  head/sys/dev/sfxge/common/efx_filter.c

Modified: head/sys/dev/sfxge/common/efx.h
==============================================================================
--- head/sys/dev/sfxge/common/efx.h     Thu Nov 29 06:42:15 2018        
(r341187)
+++ head/sys/dev/sfxge/common/efx.h     Thu Nov 29 06:42:26 2018        
(r341188)
@@ -2653,6 +2653,13 @@ efx_filter_spec_set_encap_type(
        __in            efx_tunnel_protocol_t encap_type,
        __in            efx_filter_inner_frame_match_t inner_frame_match);
 
+extern __checkReturn   efx_rc_t
+efx_filter_spec_set_vxlan_full(
+       __inout         efx_filter_spec_t *spec,
+       __in            const uint8_t *vxlan_id,
+       __in            const uint8_t *inner_addr,
+       __in            const uint8_t *outer_addr);
+
 #if EFSYS_OPT_RX_SCALE
 extern __checkReturn   efx_rc_t
 efx_filter_spec_set_rss_context(

Modified: head/sys/dev/sfxge/common/efx_filter.c
==============================================================================
--- head/sys/dev/sfxge/common/efx_filter.c      Thu Nov 29 06:42:15 2018        
(r341187)
+++ head/sys/dev/sfxge/common/efx_filter.c      Thu Nov 29 06:42:26 2018        
(r341188)
@@ -497,6 +497,42 @@ fail1:
        return (rc);
 }
 
+/*
+ * Specify inner and outer Ethernet address and VXLAN ID in filter
+ * specification.
+ */
+       __checkReturn   efx_rc_t
+efx_filter_spec_set_vxlan_full(
+       __inout         efx_filter_spec_t *spec,
+       __in            const uint8_t *vxlan_id,
+       __in            const uint8_t *inner_addr,
+       __in            const uint8_t *outer_addr)
+{
+       EFSYS_ASSERT3P(spec, !=, NULL);
+       EFSYS_ASSERT3P(vxlan_id, !=, NULL);
+       EFSYS_ASSERT3P(inner_addr, !=, NULL);
+       EFSYS_ASSERT3P(outer_addr, !=, NULL);
+
+       if ((inner_addr == NULL) && (outer_addr == NULL))
+               return (EINVAL);
+
+       if (vxlan_id != NULL) {
+               spec->efs_match_flags |= EFX_FILTER_MATCH_VNI_OR_VSID;
+               memcpy(spec->efs_vni_or_vsid, vxlan_id, EFX_VNI_OR_VSID_LEN);
+       }
+       if (outer_addr != NULL) {
+               spec->efs_match_flags |= EFX_FILTER_MATCH_LOC_MAC;
+               memcpy(spec->efs_loc_mac, outer_addr, EFX_MAC_ADDR_LEN);
+       }
+       if (inner_addr != NULL) {
+               spec->efs_match_flags |= EFX_FILTER_MATCH_IFRM_LOC_MAC;
+               memcpy(spec->efs_ifrm_loc_mac, inner_addr, EFX_MAC_ADDR_LEN);
+       }
+       spec->efs_encap_type = EFX_TUNNEL_PROTOCOL_VXLAN;
+
+       return (0);
+}
+
 #if EFSYS_OPT_RX_SCALE
        __checkReturn   efx_rc_t
 efx_filter_spec_set_rss_context(
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to