Skip to content

Commit

Permalink
ON-14927: allow insertion of "ethertype:ARP" filters
Browse files Browse the repository at this point in the history
A wrinkle in the logic of efx_spec_to_ethtool_flow prevented the flow_type
being set in this case, so the filter was later rejected.
  • Loading branch information
Mike Seymour authored and mseymour-xilinx committed Jun 9, 2023
1 parent 8215a12 commit e7b100e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/lib/efhw/ethtool_flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,16 +160,19 @@ int efx_spec_to_ethtool_flow(const struct efx_filter_spec *src,
* ports, addresses etc.) then the handling of MAC addresses should be done
* by setting FLOW_MAC_EXT in dst->flow_type and updating dst->h_ext.
*/
if( (src->match_flags & EFX_FILTER_MATCH_LOC_MAC) &&
if( (src->match_flags & (EFX_FILTER_MATCH_LOC_MAC |
EFX_FILTER_MATCH_ETHER_TYPE)) &&
!(src->match_flags & (EFX_FILTER_MATCH_IP_PROTO |
EFX_FILTER_MATCH_LOC_HOST |
EFX_FILTER_MATCH_LOC_PORT)) ) {
dst->flow_type = ETHER_FLOW;

memcpy(dst->h_u.ether_spec.h_dest, src->loc_mac,
sizeof(dst->h_u.ether_spec.h_dest));
memcpy(dst->m_u.ether_spec.h_dest, minus1,
sizeof(dst->m_u.ether_spec.h_dest));
if( src->match_flags & EFX_FILTER_MATCH_LOC_MAC ) {
memcpy(dst->h_u.ether_spec.h_dest, src->loc_mac,
sizeof(dst->h_u.ether_spec.h_dest));
memcpy(dst->m_u.ether_spec.h_dest, minus1,
sizeof(dst->m_u.ether_spec.h_dest));
}

if( src->match_flags & EFX_FILTER_MATCH_ETHER_TYPE ) {
dst->h_u.ether_spec.h_proto = src->ether_type;
Expand Down

0 comments on commit e7b100e

Please # to comment.