@@ -2490,6 +2490,7 @@ static int i40evf_parse_cls_flower(struct i40evf_adapter *adapter,
2490
2490
u16 addr_type = 0 ;
2491
2491
u16 n_proto = 0 ;
2492
2492
int i = 0 ;
2493
+ struct virtchnl_filter * vf = & filter -> f ;
2493
2494
2494
2495
if (f -> dissector -> used_keys &
2495
2496
~(BIT (FLOW_DISSECTOR_KEY_CONTROL ) |
@@ -2537,7 +2538,7 @@ static int i40evf_parse_cls_flower(struct i40evf_adapter *adapter,
2537
2538
return - EINVAL ;
2538
2539
if (n_proto == ETH_P_IPV6 ) {
2539
2540
/* specify flow type as TCP IPv6 */
2540
- filter -> f . flow_type = VIRTCHNL_TCP_V6_FLOW ;
2541
+ vf -> flow_type = VIRTCHNL_TCP_V6_FLOW ;
2541
2542
}
2542
2543
2543
2544
if (key -> ip_proto != IPPROTO_TCP ) {
@@ -2582,9 +2583,8 @@ static int i40evf_parse_cls_flower(struct i40evf_adapter *adapter,
2582
2583
is_multicast_ether_addr (key -> dst )) {
2583
2584
/* set the mask if a valid dst_mac address */
2584
2585
for (i = 0 ; i < ETH_ALEN ; i ++ )
2585
- filter -> f .mask .tcp_spec .dst_mac [i ] |=
2586
- 0xff ;
2587
- ether_addr_copy (filter -> f .data .tcp_spec .dst_mac ,
2586
+ vf -> mask .tcp_spec .dst_mac [i ] |= 0xff ;
2587
+ ether_addr_copy (vf -> data .tcp_spec .dst_mac ,
2588
2588
key -> dst );
2589
2589
}
2590
2590
@@ -2593,9 +2593,8 @@ static int i40evf_parse_cls_flower(struct i40evf_adapter *adapter,
2593
2593
is_multicast_ether_addr (key -> src )) {
2594
2594
/* set the mask if a valid dst_mac address */
2595
2595
for (i = 0 ; i < ETH_ALEN ; i ++ )
2596
- filter -> f .mask .tcp_spec .src_mac [i ] |=
2597
- 0xff ;
2598
- ether_addr_copy (filter -> f .data .tcp_spec .src_mac ,
2596
+ vf -> mask .tcp_spec .src_mac [i ] |= 0xff ;
2597
+ ether_addr_copy (vf -> data .tcp_spec .src_mac ,
2599
2598
key -> src );
2600
2599
}
2601
2600
}
@@ -2619,8 +2618,8 @@ static int i40evf_parse_cls_flower(struct i40evf_adapter *adapter,
2619
2618
return I40E_ERR_CONFIG ;
2620
2619
}
2621
2620
}
2622
- filter -> f . mask .tcp_spec .vlan_id |= cpu_to_be16 (0xffff );
2623
- filter -> f . data .tcp_spec .vlan_id = cpu_to_be16 (key -> vlan_id );
2621
+ vf -> mask .tcp_spec .vlan_id |= cpu_to_be16 (0xffff );
2622
+ vf -> data .tcp_spec .vlan_id = cpu_to_be16 (key -> vlan_id );
2624
2623
}
2625
2624
2626
2625
if (dissector_uses_key (f -> dissector , FLOW_DISSECTOR_KEY_CONTROL )) {
@@ -2667,14 +2666,12 @@ static int i40evf_parse_cls_flower(struct i40evf_adapter *adapter,
2667
2666
return I40E_ERR_CONFIG ;
2668
2667
}
2669
2668
if (key -> dst ) {
2670
- filter -> f .mask .tcp_spec .dst_ip [0 ] |=
2671
- cpu_to_be32 (0xffffffff );
2672
- filter -> f .data .tcp_spec .dst_ip [0 ] = key -> dst ;
2669
+ vf -> mask .tcp_spec .dst_ip [0 ] |= cpu_to_be32 (0xffffffff );
2670
+ vf -> data .tcp_spec .dst_ip [0 ] = key -> dst ;
2673
2671
}
2674
2672
if (key -> src ) {
2675
- filter -> f .mask .tcp_spec .src_ip [0 ] |=
2676
- cpu_to_be32 (0xffffffff );
2677
- filter -> f .data .tcp_spec .src_ip [0 ] = key -> src ;
2673
+ vf -> mask .tcp_spec .src_ip [0 ] |= cpu_to_be32 (0xffffffff );
2674
+ vf -> data .tcp_spec .src_ip [0 ] = key -> src ;
2678
2675
}
2679
2676
}
2680
2677
@@ -2707,22 +2704,14 @@ static int i40evf_parse_cls_flower(struct i40evf_adapter *adapter,
2707
2704
if (!ipv6_addr_any (& mask -> dst ) || !ipv6_addr_any (& mask -> src ))
2708
2705
field_flags |= I40EVF_CLOUD_FIELD_IIP ;
2709
2706
2710
- if (key -> dst .s6_addr ) {
2711
- for (i = 0 ; i < 4 ; i ++ )
2712
- filter -> f .mask .tcp_spec .dst_ip [i ] |=
2713
- cpu_to_be32 (0xffffffff );
2714
- memcpy (& filter -> f .data .tcp_spec .dst_ip ,
2715
- & key -> dst .s6_addr32 ,
2716
- sizeof (filter -> f .data .tcp_spec .dst_ip ));
2717
- }
2718
- if (key -> src .s6_addr ) {
2719
- for (i = 0 ; i < 4 ; i ++ )
2720
- filter -> f .mask .tcp_spec .src_ip [i ] |=
2721
- cpu_to_be32 (0xffffffff );
2722
- memcpy (& filter -> f .data .tcp_spec .src_ip ,
2723
- & key -> src .s6_addr32 ,
2724
- sizeof (filter -> f .data .tcp_spec .src_ip ));
2725
- }
2707
+ for (i = 0 ; i < 4 ; i ++ )
2708
+ vf -> mask .tcp_spec .dst_ip [i ] |= cpu_to_be32 (0xffffffff );
2709
+ memcpy (& vf -> data .tcp_spec .dst_ip , & key -> dst .s6_addr32 ,
2710
+ sizeof (vf -> data .tcp_spec .dst_ip ));
2711
+ for (i = 0 ; i < 4 ; i ++ )
2712
+ vf -> mask .tcp_spec .src_ip [i ] |= cpu_to_be32 (0xffffffff );
2713
+ memcpy (& vf -> data .tcp_spec .src_ip , & key -> src .s6_addr32 ,
2714
+ sizeof (vf -> data .tcp_spec .src_ip ));
2726
2715
}
2727
2716
if (dissector_uses_key (f -> dissector , FLOW_DISSECTOR_KEY_PORTS )) {
2728
2717
struct flow_dissector_key_ports * key =
@@ -2754,16 +2743,16 @@ static int i40evf_parse_cls_flower(struct i40evf_adapter *adapter,
2754
2743
}
2755
2744
}
2756
2745
if (key -> dst ) {
2757
- filter -> f . mask .tcp_spec .dst_port |= cpu_to_be16 (0xffff );
2758
- filter -> f . data .tcp_spec .dst_port = key -> dst ;
2746
+ vf -> mask .tcp_spec .dst_port |= cpu_to_be16 (0xffff );
2747
+ vf -> data .tcp_spec .dst_port = key -> dst ;
2759
2748
}
2760
2749
2761
2750
if (key -> src ) {
2762
- filter -> f . mask .tcp_spec .src_port |= cpu_to_be16 (0xffff );
2763
- filter -> f . data .tcp_spec .src_port = key -> dst ;
2751
+ vf -> mask .tcp_spec .src_port |= cpu_to_be16 (0xffff );
2752
+ vf -> data .tcp_spec .src_port = key -> dst ;
2764
2753
}
2765
2754
}
2766
- filter -> f . field_flags = field_flags ;
2755
+ vf -> field_flags = field_flags ;
2767
2756
2768
2757
return 0 ;
2769
2758
}
0 commit comments