Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue

Tony Nguyen says:

====================
ice: allow matching on meta data

Michal Swiatkowski says:

This patchset is intended to improve the usability of the switchdev
slow path. Without matching on a meta data values slow path works
based on VF's MAC addresses. It causes a problem when the VF wants
to use more than one MAC address (e.g. when it is in trusted mode).

Parse all meta data in the same place where protocol type fields are
parsed. Add description for the currently implemented meta data. It is
important to note that depending on DDP not all described meta data can
be available. Using not available meta data leads to error returned by
function which is looking for correct words in profiles read from DDP.

There is also one small improvement, remove of rx field in rule info
structure (patch 2). It is redundant.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

+351 -259
+27 -57
drivers/net/ethernet/intel/ice/ice_eswitch.c
··· 10 10 #include "ice_tc_lib.h" 11 11 12 12 /** 13 - * ice_eswitch_add_vf_mac_rule - add adv rule with VF's MAC 13 + * ice_eswitch_add_vf_sp_rule - add adv rule with VF's VSI index 14 14 * @pf: pointer to PF struct 15 15 * @vf: pointer to VF struct 16 - * @mac: VF's MAC address 17 16 * 18 17 * This function adds advanced rule that forwards packets with 19 - * VF's MAC address (src MAC) to the corresponding switchdev ctrl VSI queue. 18 + * VF's VSI index to the corresponding switchdev ctrl VSI queue. 20 19 */ 21 - int 22 - ice_eswitch_add_vf_mac_rule(struct ice_pf *pf, struct ice_vf *vf, const u8 *mac) 20 + static int 21 + ice_eswitch_add_vf_sp_rule(struct ice_pf *pf, struct ice_vf *vf) 23 22 { 24 23 struct ice_vsi *ctrl_vsi = pf->switchdev.control_vsi; 25 24 struct ice_adv_rule_info rule_info = { 0 }; ··· 31 32 if (!list) 32 33 return -ENOMEM; 33 34 34 - list[0].type = ICE_MAC_OFOS; 35 - ether_addr_copy(list[0].h_u.eth_hdr.src_addr, mac); 36 - eth_broadcast_addr(list[0].m_u.eth_hdr.src_addr); 35 + ice_rule_add_src_vsi_metadata(list); 37 36 38 - rule_info.sw_act.flag |= ICE_FLTR_TX; 37 + rule_info.sw_act.flag = ICE_FLTR_TX; 39 38 rule_info.sw_act.vsi_handle = ctrl_vsi->idx; 40 39 rule_info.sw_act.fltr_act = ICE_FWD_TO_Q; 41 - rule_info.rx = false; 42 40 rule_info.sw_act.fwd_id.q_id = hw->func_caps.common_cap.rxq_first_id + 43 41 ctrl_vsi->rxq_map[vf->vf_id]; 44 42 rule_info.flags_info.act |= ICE_SINGLE_ACT_LB_ENABLE; 45 43 rule_info.flags_info.act_valid = true; 46 44 rule_info.tun_type = ICE_SW_TUN_AND_NON_TUN; 45 + rule_info.src_vsi = vf->lan_vsi_idx; 47 46 48 47 err = ice_add_adv_rule(hw, list, lkups_cnt, &rule_info, 49 - vf->repr->mac_rule); 48 + &vf->repr->sp_rule); 50 49 if (err) 51 - dev_err(ice_pf_to_dev(pf), "Unable to add VF mac rule in switchdev mode for VF %d", 50 + dev_err(ice_pf_to_dev(pf), "Unable to add VF slow-path rule in switchdev mode for VF %d", 52 51 vf->vf_id); 53 - else 54 - vf->repr->rule_added = true; 55 52 56 53 kfree(list); 57 54 return err; 58 55 } 59 56 60 57 /** 61 - * ice_eswitch_replay_vf_mac_rule - replay adv rule with VF's MAC 62 - * @vf: pointer to vF struct 63 - * 64 - * This function replays VF's MAC rule after reset. 65 - */ 66 - void ice_eswitch_replay_vf_mac_rule(struct ice_vf *vf) 67 - { 68 - int err; 69 - 70 - if (!ice_is_switchdev_running(vf->pf)) 71 - return; 72 - 73 - if (is_valid_ether_addr(vf->hw_lan_addr)) { 74 - err = ice_eswitch_add_vf_mac_rule(vf->pf, vf, 75 - vf->hw_lan_addr); 76 - if (err) { 77 - dev_err(ice_pf_to_dev(vf->pf), "Failed to add MAC %pM for VF %d\n, error %d\n", 78 - vf->hw_lan_addr, vf->vf_id, err); 79 - return; 80 - } 81 - vf->num_mac++; 82 - 83 - ether_addr_copy(vf->dev_lan_addr, vf->hw_lan_addr); 84 - } 85 - } 86 - 87 - /** 88 - * ice_eswitch_del_vf_mac_rule - delete adv rule with VF's MAC 58 + * ice_eswitch_del_vf_sp_rule - delete adv rule with VF's VSI index 89 59 * @vf: pointer to the VF struct 90 60 * 91 - * Delete the advanced rule that was used to forward packets with the VF's MAC 92 - * address (src MAC) to the corresponding switchdev ctrl VSI queue. 61 + * Delete the advanced rule that was used to forward packets with the VF's VSI 62 + * index to the corresponding switchdev ctrl VSI queue. 93 63 */ 94 - void ice_eswitch_del_vf_mac_rule(struct ice_vf *vf) 64 + static void ice_eswitch_del_vf_sp_rule(struct ice_vf *vf) 95 65 { 96 - if (!ice_is_switchdev_running(vf->pf)) 66 + if (!vf->repr) 97 67 return; 98 68 99 - if (!vf->repr->rule_added) 100 - return; 101 - 102 - ice_rem_adv_rule_by_id(&vf->pf->hw, vf->repr->mac_rule); 103 - vf->repr->rule_added = false; 69 + ice_rem_adv_rule_by_id(&vf->pf->hw, &vf->repr->sp_rule); 104 70 } 105 71 106 72 /** ··· 201 237 ice_vsi_update_security(vsi, ice_vsi_ctx_set_antispoof); 202 238 metadata_dst_free(vf->repr->dst); 203 239 vf->repr->dst = NULL; 240 + ice_eswitch_del_vf_sp_rule(vf); 204 241 ice_fltr_add_mac_and_broadcast(vsi, vf->hw_lan_addr, 205 242 ICE_FWD_TO_VSI); 206 243 ··· 229 264 vf->repr->dst = metadata_dst_alloc(0, METADATA_HW_PORT_MUX, 230 265 GFP_KERNEL); 231 266 if (!vf->repr->dst) { 232 - ice_fltr_add_mac_and_broadcast(vsi, 233 - vf->hw_lan_addr, 267 + ice_fltr_add_mac_and_broadcast(vsi, vf->hw_lan_addr, 268 + ICE_FWD_TO_VSI); 269 + goto err; 270 + } 271 + 272 + if (ice_eswitch_add_vf_sp_rule(pf, vf)) { 273 + ice_fltr_add_mac_and_broadcast(vsi, vf->hw_lan_addr, 234 274 ICE_FWD_TO_VSI); 235 275 goto err; 236 276 } 237 277 238 278 if (ice_vsi_update_security(vsi, ice_vsi_ctx_clear_antispoof)) { 239 - ice_fltr_add_mac_and_broadcast(vsi, 240 - vf->hw_lan_addr, 279 + ice_fltr_add_mac_and_broadcast(vsi, vf->hw_lan_addr, 241 280 ICE_FWD_TO_VSI); 281 + ice_eswitch_del_vf_sp_rule(vf); 242 282 metadata_dst_free(vf->repr->dst); 243 283 vf->repr->dst = NULL; 244 284 goto err; 245 285 } 246 286 247 287 if (ice_vsi_add_vlan_zero(vsi)) { 248 - ice_fltr_add_mac_and_broadcast(vsi, 249 - vf->hw_lan_addr, 288 + ice_fltr_add_mac_and_broadcast(vsi, vf->hw_lan_addr, 250 289 ICE_FWD_TO_VSI); 290 + ice_eswitch_del_vf_sp_rule(vf); 251 291 metadata_dst_free(vf->repr->dst); 252 292 vf->repr->dst = NULL; 253 293 ice_vsi_update_security(vsi, ice_vsi_ctx_set_antispoof);
-14
drivers/net/ethernet/intel/ice/ice_eswitch.h
··· 20 20 void ice_eswitch_update_repr(struct ice_vsi *vsi); 21 21 22 22 void ice_eswitch_stop_all_tx_queues(struct ice_pf *pf); 23 - int 24 - ice_eswitch_add_vf_mac_rule(struct ice_pf *pf, struct ice_vf *vf, 25 - const u8 *mac); 26 - void ice_eswitch_replay_vf_mac_rule(struct ice_vf *vf); 27 - void ice_eswitch_del_vf_mac_rule(struct ice_vf *vf); 28 23 29 24 void ice_eswitch_set_target_vsi(struct sk_buff *skb, 30 25 struct ice_tx_offload_params *off); ··· 29 34 static inline void ice_eswitch_release(struct ice_pf *pf) { } 30 35 31 36 static inline void ice_eswitch_stop_all_tx_queues(struct ice_pf *pf) { } 32 - static inline void ice_eswitch_replay_vf_mac_rule(struct ice_vf *vf) { } 33 - static inline void ice_eswitch_del_vf_mac_rule(struct ice_vf *vf) { } 34 - 35 - static inline int 36 - ice_eswitch_add_vf_mac_rule(struct ice_pf *pf, struct ice_vf *vf, 37 - const u8 *mac) 38 - { 39 - return -EOPNOTSUPP; 40 - } 41 37 42 38 static inline void 43 39 ice_eswitch_set_target_vsi(struct sk_buff *skb,
+187 -10
drivers/net/ethernet/intel/ice/ice_protocol_type.h
··· 47 47 ICE_L2TPV3, 48 48 ICE_VLAN_EX, 49 49 ICE_VLAN_IN, 50 + ICE_HW_METADATA, 50 51 ICE_VXLAN_GPE, 51 52 ICE_SCTP_IL, 52 53 ICE_PROTOCOL_LAST ··· 116 115 #define ICE_L2TPV3_HW 104 117 116 118 117 #define ICE_UDP_OF_HW 52 /* UDP Tunnels */ 119 - #define ICE_META_DATA_ID_HW 255 /* this is used for tunnel and VLAN type */ 120 118 121 - #define ICE_MDID_SIZE 2 122 - 123 - #define ICE_TUN_FLAG_MDID 21 124 - #define ICE_TUN_FLAG_MDID_OFF (ICE_MDID_SIZE * ICE_TUN_FLAG_MDID) 125 - #define ICE_TUN_FLAG_MASK 0xFF 126 - 127 - #define ICE_VLAN_FLAG_MDID 20 128 - #define ICE_VLAN_FLAG_MDID_OFF (ICE_MDID_SIZE * ICE_VLAN_FLAG_MDID) 129 - #define ICE_PKT_FLAGS_0_TO_15_VLAN_FLAGS_MASK 0xD000 130 119 131 120 #define ICE_TUN_FLAG_FV_IND 2 132 121 ··· 221 230 __be32 tni_flow; 222 231 }; 223 232 233 + /* Metadata information 234 + * 235 + * Not all MDIDs can be used by switch block. It depends on package version. 236 + * 237 + * MDID 16 (Rx offset) 238 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 239 + * | A | B | Reserved | 240 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 241 + * 242 + * A = Source port where the transaction came from (3b). 243 + * 244 + * B = Destination TC of the packet. The TC is relative to a port (5b). 245 + * 246 + * MDID 17 247 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 248 + * | PTYPE | Reserved | 249 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 250 + * 251 + * PTYPE = Encodes the packet type (10b). 252 + * 253 + * MDID 18 254 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 255 + * | Packet length | R | 256 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 257 + * 258 + * Packet length = Length of the packet in bytes 259 + * (packet always carriers CRC) (14b). 260 + * R = Reserved (2b). 261 + * 262 + * MDID 19 263 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 264 + * | Source VSI | Reserved | 265 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 266 + * 267 + * Source VSI = Source VSI of packet loopbacked in switch (for egress) (10b). 268 + */ 269 + #define ICE_MDID_SOURCE_VSI_MASK GENMASK(9, 0) 270 + 271 + /* 272 + * MDID 20 273 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 274 + * |A|B|C|D|E|F|R|R|G|H|I|J|K|L|M|N| 275 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 276 + * 277 + * A = DSI - set for DSI RX pkts. 278 + * B = ipsec_decrypted - invalid on NIC. 279 + * C = marker - this is a marker packet. 280 + * D = from_network - for TX sets to 0 281 + * for RX: 282 + * * 1 - packet is from external link 283 + * * 0 - packet source is from internal 284 + * E = source_interface_is_rx - reflect the physical interface from where the 285 + * packet was received: 286 + * * 1 - Rx 287 + * * 0 - Tx 288 + * F = from_mng - The bit signals that the packet's origin is the management. 289 + * G = ucast - Outer L2 MAC address is unicast. 290 + * H = mcast - Outer L2 MAC address is multicast. 291 + * I = bcast - Outer L2 MAC address is broadcast. 292 + * J = second_outer_mac_present - 2 outer MAC headers are present in the packet. 293 + * K = STAG or BVLAN - Outer L2 header has STAG (ethernet type 0x88a8) or 294 + * BVLAN (ethernet type 0x88a8). 295 + * L = ITAG - Outer L2 header has ITAG *ethernet type 0x88e7) 296 + * M = EVLAN (0x8100) - Outer L2 header has EVLAN (ethernet type 0x8100) 297 + * N = EVLAN (0x9100) - Outer L2 header has EVLAN (ethernet type 0x9100) 298 + */ 299 + #define ICE_PKT_VLAN_STAG BIT(12) 300 + #define ICE_PKT_VLAN_ITAG BIT(13) 301 + #define ICE_PKT_VLAN_EVLAN (BIT(14) | BIT(15)) 302 + #define ICE_PKT_VLAN_MASK (ICE_PKT_VLAN_STAG | ICE_PKT_VLAN_ITAG | \ 303 + ICE_PKT_VLAN_EVLAN) 304 + /* MDID 21 305 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 306 + * |A|B|C|D|E|F|G|H|I|J|R|R|K|L|M|N| 307 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 308 + * 309 + * A = VLAN (0x8100) - Outer L2 header has VLAN (ethernet type 0x8100) 310 + * B = NSHoE - Outer L2 header has NSH (ethernet type 0x894f) 311 + * C = MPLS (0x8847) - There is at least 1 MPLS tag in the outer header 312 + * (ethernet type 0x8847) 313 + * D = MPLS (0x8848) - There is at least 1 MPLS tag in the outer header 314 + * (ethernet type 0x8848) 315 + * E = multi MPLS - There is more than a single MPLS tag in the outer header 316 + * F = inner MPLS - There is inner MPLS tag in the packet 317 + * G = tunneled MAC - Set if the packet includes a tunneled MAC 318 + * H = tunneled VLAN - Same as VLAN, but for a tunneled header 319 + * I = pkt_is_frag - Packet is fragmented (ipv4 or ipv6) 320 + * J = ipv6_ext - The packet has routing or destination ipv6 extension in inner 321 + * or outer ipv6 headers 322 + * K = RoCE - UDP packet detected as RoCEv2 323 + * L = UDP_XSUM_0 - Set to 1 if L4 checksum is 0 in a UDP packet 324 + * M = ESP - This is a ESP packet 325 + * N = NAT_ESP - This is a ESP packet encapsulated in UDP NAT 326 + */ 327 + #define ICE_PKT_TUNNEL_MAC BIT(6) 328 + #define ICE_PKT_TUNNEL_VLAN BIT(7) 329 + #define ICE_PKT_TUNNEL_MASK (ICE_PKT_TUNNEL_MAC | ICE_PKT_TUNNEL_VLAN) 330 + 331 + /* MDID 22 332 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 333 + * |A|B|C|D|E|F| G |H|I|J| K |L|M| 334 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 335 + * 336 + * A = fin - fin flag in tcp header 337 + * B = sync - sync flag in tcp header 338 + * C = rst - rst flag in tcp header 339 + * D = psh - psh flag in tcp header 340 + * E = ack - ack flag in tcp header 341 + * F = urg - urg flag in tcp header 342 + * G = tunnel type (3b) - Flags used to decode tunnel type: 343 + * * b000 - not a VXLAN/Geneve/GRE tunnel 344 + * * b001 - VXLAN-GPE 345 + * * b010 - VXLAN (non-GPE) 346 + * * b011 - Geneve 347 + * * b100 - GRE (no key, no xsum) 348 + * * b101 - GREK (key, no xsum) 349 + * * b110 - GREC (no key, xsum) 350 + * * b111 - GREKC (key, xsum) 351 + * H = UDP_GRE - Packet is UDP (VXLAN or VLAN_GPE or Geneve or MPLSoUDP or GRE) 352 + * tunnel 353 + * I = OAM - VXLAN/Geneve/tunneled NSH packet with the OAM bit set 354 + * J = tunneled NSH - Packet has NSHoGRE or NSHoUDP 355 + * K = switch (2b) - Direction on switch 356 + * * b00 - normal 357 + * * b01 - TX force only LAN 358 + * * b10 - TX disable LAN 359 + * * b11 - direct to VSI 360 + * L = swpe - Represents SWPE bit in TX command 361 + * M = sw_cmd - Switch command 362 + * 363 + * MDID 23 364 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 365 + * |A|B|C|D| R |E|F|R| 366 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 367 + * 368 + * A = MAC error - Produced by MAC according to L2 error conditions 369 + * B = PPRS no offload - FIFO overflow in PPRS or any problematic condition in 370 + * PPRS ANA 371 + * C = abort - Set when malicious packet is detected 372 + * D = partial analysis - ANA's analysing got cut in the middle 373 + * (header > 504B etc.) 374 + * E = FLM - Flow director hit indication 375 + * F = FDLONG - Flow direector long bucket indication 376 + * 377 + */ 378 + #define ICE_MDID_SIZE 2 379 + #define ICE_META_DATA_ID_HW 255 380 + 381 + enum ice_hw_metadata_id { 382 + ICE_SOURCE_PORT_MDID = 16, 383 + ICE_PTYPE_MDID = 17, 384 + ICE_PACKET_LENGTH_MDID = 18, 385 + ICE_SOURCE_VSI_MDID = 19, 386 + ICE_PKT_VLAN_MDID = 20, 387 + ICE_PKT_TUNNEL_MDID = 21, 388 + ICE_PKT_TCP_MDID = 22, 389 + ICE_PKT_ERROR_MDID = 23, 390 + }; 391 + 392 + enum ice_hw_metadata_offset { 393 + ICE_SOURCE_PORT_MDID_OFFSET = ICE_MDID_SIZE * ICE_SOURCE_PORT_MDID, 394 + ICE_PTYPE_MDID_OFFSET = ICE_MDID_SIZE * ICE_PTYPE_MDID, 395 + ICE_PACKET_LENGTH_MDID_OFFSET = ICE_MDID_SIZE * ICE_PACKET_LENGTH_MDID, 396 + ICE_SOURCE_VSI_MDID_OFFSET = ICE_MDID_SIZE * ICE_SOURCE_VSI_MDID, 397 + ICE_PKT_VLAN_MDID_OFFSET = ICE_MDID_SIZE * ICE_PKT_VLAN_MDID, 398 + ICE_PKT_TUNNEL_MDID_OFFSET = ICE_MDID_SIZE * ICE_PKT_TUNNEL_MDID, 399 + ICE_PKT_TCP_MDID_OFFSET = ICE_MDID_SIZE * ICE_PKT_TCP_MDID, 400 + ICE_PKT_ERROR_MDID_OFFSET = ICE_MDID_SIZE * ICE_PKT_ERROR_MDID, 401 + }; 402 + 403 + enum ice_pkt_flags { 404 + ICE_PKT_FLAGS_VLAN = 0, 405 + ICE_PKT_FLAGS_TUNNEL = 1, 406 + ICE_PKT_FLAGS_TCP = 2, 407 + ICE_PKT_FLAGS_ERROR = 3, 408 + }; 409 + 410 + struct ice_hw_metadata { 411 + __be16 source_port; 412 + __be16 ptype; 413 + __be16 packet_length; 414 + __be16 source_vsi; 415 + __be16 flags[4]; 416 + }; 417 + 224 418 union ice_prot_hdr { 225 419 struct ice_ether_hdr eth_hdr; 226 420 struct ice_ethtype_hdr ethertype; ··· 419 243 struct ice_udp_gtp_hdr gtp_hdr; 420 244 struct ice_pppoe_hdr pppoe_hdr; 421 245 struct ice_l2tpv3_sess_hdr l2tpv3_sess_hdr; 246 + struct ice_hw_metadata metadata; 422 247 }; 423 248 424 249 /* This is mapping table entry that maps every word within a given protocol
-17
drivers/net/ethernet/intel/ice/ice_repr.c
··· 298 298 if (!repr) 299 299 return -ENOMEM; 300 300 301 - #ifdef CONFIG_ICE_SWITCHDEV 302 - repr->mac_rule = kzalloc(sizeof(*repr->mac_rule), GFP_KERNEL); 303 - if (!repr->mac_rule) { 304 - err = -ENOMEM; 305 - goto err_alloc_rule; 306 - } 307 - #endif 308 - 309 301 repr->netdev = alloc_etherdev(sizeof(struct ice_netdev_priv)); 310 302 if (!repr->netdev) { 311 303 err = -ENOMEM; ··· 343 351 free_netdev(repr->netdev); 344 352 repr->netdev = NULL; 345 353 err_alloc: 346 - #ifdef CONFIG_ICE_SWITCHDEV 347 - kfree(repr->mac_rule); 348 - repr->mac_rule = NULL; 349 - err_alloc_rule: 350 - #endif 351 354 kfree(repr); 352 355 vf->repr = NULL; 353 356 return err; ··· 363 376 ice_devlink_destroy_vf_port(vf); 364 377 free_netdev(vf->repr->netdev); 365 378 vf->repr->netdev = NULL; 366 - #ifdef CONFIG_ICE_SWITCHDEV 367 - kfree(vf->repr->mac_rule); 368 - vf->repr->mac_rule = NULL; 369 - #endif 370 379 kfree(vf->repr); 371 380 vf->repr = NULL; 372 381
+2 -3
drivers/net/ethernet/intel/ice/ice_repr.h
··· 13 13 struct net_device *netdev; 14 14 struct metadata_dst *dst; 15 15 #ifdef CONFIG_ICE_SWITCHDEV 16 - /* info about slow path MAC rule */ 17 - struct ice_rule_query_data *mac_rule; 18 - u8 rule_added; 16 + /* info about slow path rule */ 17 + struct ice_rule_query_data sp_rule; 19 18 #endif 20 19 }; 21 20
+101 -131
drivers/net/ethernet/intel/ice/ice_switch.c
··· 4540 4540 return status; 4541 4541 } 4542 4542 4543 + #define ICE_PROTOCOL_ENTRY(id, ...) { \ 4544 + .prot_type = id, \ 4545 + .offs = {__VA_ARGS__}, \ 4546 + } 4547 + 4543 4548 /* This is mapping table entry that maps every word within a given protocol 4544 4549 * structure to the real byte offset as per the specification of that 4545 4550 * protocol header. ··· 4555 4550 * structure is added to that union. 4556 4551 */ 4557 4552 static const struct ice_prot_ext_tbl_entry ice_prot_ext[ICE_PROTOCOL_LAST] = { 4558 - { ICE_MAC_OFOS, { 0, 2, 4, 6, 8, 10, 12 } }, 4559 - { ICE_MAC_IL, { 0, 2, 4, 6, 8, 10, 12 } }, 4560 - { ICE_ETYPE_OL, { 0 } }, 4561 - { ICE_ETYPE_IL, { 0 } }, 4562 - { ICE_VLAN_OFOS, { 2, 0 } }, 4563 - { ICE_IPV4_OFOS, { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18 } }, 4564 - { ICE_IPV4_IL, { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18 } }, 4565 - { ICE_IPV6_OFOS, { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 4566 - 26, 28, 30, 32, 34, 36, 38 } }, 4567 - { ICE_IPV6_IL, { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 4568 - 26, 28, 30, 32, 34, 36, 38 } }, 4569 - { ICE_TCP_IL, { 0, 2 } }, 4570 - { ICE_UDP_OF, { 0, 2 } }, 4571 - { ICE_UDP_ILOS, { 0, 2 } }, 4572 - { ICE_VXLAN, { 8, 10, 12, 14 } }, 4573 - { ICE_GENEVE, { 8, 10, 12, 14 } }, 4574 - { ICE_NVGRE, { 0, 2, 4, 6 } }, 4575 - { ICE_GTP, { 8, 10, 12, 14, 16, 18, 20, 22 } }, 4576 - { ICE_GTP_NO_PAY, { 8, 10, 12, 14 } }, 4577 - { ICE_PPPOE, { 0, 2, 4, 6 } }, 4578 - { ICE_L2TPV3, { 0, 2, 4, 6, 8, 10 } }, 4579 - { ICE_VLAN_EX, { 2, 0 } }, 4580 - { ICE_VLAN_IN, { 2, 0 } }, 4553 + ICE_PROTOCOL_ENTRY(ICE_MAC_OFOS, 0, 2, 4, 6, 8, 10, 12), 4554 + ICE_PROTOCOL_ENTRY(ICE_MAC_IL, 0, 2, 4, 6, 8, 10, 12), 4555 + ICE_PROTOCOL_ENTRY(ICE_ETYPE_OL, 0), 4556 + ICE_PROTOCOL_ENTRY(ICE_ETYPE_IL, 0), 4557 + ICE_PROTOCOL_ENTRY(ICE_VLAN_OFOS, 2, 0), 4558 + ICE_PROTOCOL_ENTRY(ICE_IPV4_OFOS, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18), 4559 + ICE_PROTOCOL_ENTRY(ICE_IPV4_IL, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18), 4560 + ICE_PROTOCOL_ENTRY(ICE_IPV6_OFOS, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 4561 + 20, 22, 24, 26, 28, 30, 32, 34, 36, 38), 4562 + ICE_PROTOCOL_ENTRY(ICE_IPV6_IL, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 4563 + 22, 24, 26, 28, 30, 32, 34, 36, 38), 4564 + ICE_PROTOCOL_ENTRY(ICE_TCP_IL, 0, 2), 4565 + ICE_PROTOCOL_ENTRY(ICE_UDP_OF, 0, 2), 4566 + ICE_PROTOCOL_ENTRY(ICE_UDP_ILOS, 0, 2), 4567 + ICE_PROTOCOL_ENTRY(ICE_VXLAN, 8, 10, 12, 14), 4568 + ICE_PROTOCOL_ENTRY(ICE_GENEVE, 8, 10, 12, 14), 4569 + ICE_PROTOCOL_ENTRY(ICE_NVGRE, 0, 2, 4, 6), 4570 + ICE_PROTOCOL_ENTRY(ICE_GTP, 8, 10, 12, 14, 16, 18, 20, 22), 4571 + ICE_PROTOCOL_ENTRY(ICE_GTP_NO_PAY, 8, 10, 12, 14), 4572 + ICE_PROTOCOL_ENTRY(ICE_PPPOE, 0, 2, 4, 6), 4573 + ICE_PROTOCOL_ENTRY(ICE_L2TPV3, 0, 2, 4, 6, 8, 10), 4574 + ICE_PROTOCOL_ENTRY(ICE_VLAN_EX, 2, 0), 4575 + ICE_PROTOCOL_ENTRY(ICE_VLAN_IN, 2, 0), 4576 + ICE_PROTOCOL_ENTRY(ICE_HW_METADATA, 4577 + ICE_SOURCE_PORT_MDID_OFFSET, 4578 + ICE_PTYPE_MDID_OFFSET, 4579 + ICE_PACKET_LENGTH_MDID_OFFSET, 4580 + ICE_SOURCE_VSI_MDID_OFFSET, 4581 + ICE_PKT_VLAN_MDID_OFFSET, 4582 + ICE_PKT_TUNNEL_MDID_OFFSET, 4583 + ICE_PKT_TCP_MDID_OFFSET, 4584 + ICE_PKT_ERROR_MDID_OFFSET), 4581 4585 }; 4582 4586 4583 4587 static struct ice_protocol_entry ice_prot_id_tbl[ICE_PROTOCOL_LAST] = { ··· 4611 4597 { ICE_L2TPV3, ICE_L2TPV3_HW }, 4612 4598 { ICE_VLAN_EX, ICE_VLAN_OF_HW }, 4613 4599 { ICE_VLAN_IN, ICE_VLAN_OL_HW }, 4600 + { ICE_HW_METADATA, ICE_META_DATA_ID_HW }, 4614 4601 }; 4615 4602 4616 4603 /** ··· 5270 5255 return status; 5271 5256 } 5272 5257 5273 - /** 5274 - * ice_tun_type_match_word - determine if tun type needs a match mask 5275 - * @tun_type: tunnel type 5276 - * @mask: mask to be used for the tunnel 5277 - */ 5278 - static bool ice_tun_type_match_word(enum ice_sw_tunnel_type tun_type, u16 *mask) 5279 - { 5280 - switch (tun_type) { 5281 - case ICE_SW_TUN_GENEVE: 5282 - case ICE_SW_TUN_VXLAN: 5283 - case ICE_SW_TUN_NVGRE: 5284 - case ICE_SW_TUN_GTPU: 5285 - case ICE_SW_TUN_GTPC: 5286 - *mask = ICE_TUN_FLAG_MASK; 5287 - return true; 5288 - 5289 - default: 5290 - *mask = 0; 5291 - return false; 5292 - } 5293 - } 5294 - 5295 - /** 5296 - * ice_add_special_words - Add words that are not protocols, such as metadata 5297 - * @rinfo: other information regarding the rule e.g. priority and action info 5298 - * @lkup_exts: lookup word structure 5299 - * @dvm_ena: is double VLAN mode enabled 5300 - */ 5301 - static int 5302 - ice_add_special_words(struct ice_adv_rule_info *rinfo, 5303 - struct ice_prot_lkup_ext *lkup_exts, bool dvm_ena) 5304 - { 5305 - u16 mask; 5306 - 5307 - /* If this is a tunneled packet, then add recipe index to match the 5308 - * tunnel bit in the packet metadata flags. 5309 - */ 5310 - if (ice_tun_type_match_word(rinfo->tun_type, &mask)) { 5311 - if (lkup_exts->n_val_words < ICE_MAX_CHAIN_WORDS) { 5312 - u8 word = lkup_exts->n_val_words++; 5313 - 5314 - lkup_exts->fv_words[word].prot_id = ICE_META_DATA_ID_HW; 5315 - lkup_exts->fv_words[word].off = ICE_TUN_FLAG_MDID_OFF; 5316 - lkup_exts->field_mask[word] = mask; 5317 - } else { 5318 - return -ENOSPC; 5319 - } 5320 - } 5321 - 5322 - if (rinfo->vlan_type != 0 && dvm_ena) { 5323 - if (lkup_exts->n_val_words < ICE_MAX_CHAIN_WORDS) { 5324 - u8 word = lkup_exts->n_val_words++; 5325 - 5326 - lkup_exts->fv_words[word].prot_id = ICE_META_DATA_ID_HW; 5327 - lkup_exts->fv_words[word].off = ICE_VLAN_FLAG_MDID_OFF; 5328 - lkup_exts->field_mask[word] = 5329 - ICE_PKT_FLAGS_0_TO_15_VLAN_FLAGS_MASK; 5330 - } else { 5331 - return -ENOSPC; 5332 - } 5333 - } 5334 - 5335 - return 0; 5336 - } 5337 - 5338 5258 /* ice_get_compat_fv_bitmap - Get compatible field vector bitmap for rule 5339 5259 * @hw: pointer to hardware structure 5340 5260 * @rinfo: other information regarding the rule e.g. priority and action info ··· 5380 5430 ice_get_compat_fv_bitmap(hw, rinfo, fv_bitmap); 5381 5431 5382 5432 status = ice_get_sw_fv_list(hw, lkup_exts, fv_bitmap, &rm->fv_list); 5383 - if (status) 5384 - goto err_unroll; 5385 - 5386 - /* Create any special protocol/offset pairs, such as looking at tunnel 5387 - * bits by extracting metadata 5388 - */ 5389 - status = ice_add_special_words(rinfo, lkup_exts, ice_is_dvm_ena(hw)); 5390 5433 if (status) 5391 5434 goto err_unroll; 5392 5435 ··· 5668 5725 * was already checked when search for the dummy packet 5669 5726 */ 5670 5727 type = lkups[i].type; 5728 + /* metadata isn't present in the packet */ 5729 + if (type == ICE_HW_METADATA) 5730 + continue; 5731 + 5671 5732 for (j = 0; offsets[j].type != ICE_PROTOCOL_LAST; j++) { 5672 5733 if (type == offsets[j].type) { 5673 5734 offset = offsets[j].offset; ··· 5807 5860 5808 5861 /** 5809 5862 * ice_fill_adv_packet_vlan - fill dummy packet with VLAN tag type 5863 + * @hw: pointer to hw structure 5810 5864 * @vlan_type: VLAN tag type 5811 5865 * @pkt: dummy packet to fill in 5812 5866 * @offsets: offset info for the dummy packet 5813 5867 */ 5814 5868 static int 5815 - ice_fill_adv_packet_vlan(u16 vlan_type, u8 *pkt, 5869 + ice_fill_adv_packet_vlan(struct ice_hw *hw, u16 vlan_type, u8 *pkt, 5816 5870 const struct ice_dummy_pkt_offsets *offsets) 5817 5871 { 5818 5872 u16 i; 5873 + 5874 + /* Check if there is something to do */ 5875 + if (!vlan_type || !ice_is_dvm_ena(hw)) 5876 + return 0; 5819 5877 5820 5878 /* Find VLAN header and insert VLAN TPID */ 5821 5879 for (i = 0; offsets[i].type != ICE_PROTOCOL_LAST; i++) { ··· 5838 5886 } 5839 5887 5840 5888 return -EIO; 5889 + } 5890 + 5891 + static bool ice_rules_equal(const struct ice_adv_rule_info *first, 5892 + const struct ice_adv_rule_info *second) 5893 + { 5894 + return first->sw_act.flag == second->sw_act.flag && 5895 + first->tun_type == second->tun_type && 5896 + first->vlan_type == second->vlan_type && 5897 + first->src_vsi == second->src_vsi; 5841 5898 } 5842 5899 5843 5900 /** ··· 5882 5921 lkups_matched = false; 5883 5922 break; 5884 5923 } 5885 - if (rinfo->sw_act.flag == list_itr->rule_info.sw_act.flag && 5886 - rinfo->tun_type == list_itr->rule_info.tun_type && 5887 - rinfo->vlan_type == list_itr->rule_info.vlan_type && 5924 + if (ice_rules_equal(rinfo, &list_itr->rule_info) && 5888 5925 lkups_matched) 5889 5926 return list_itr; 5890 5927 } ··· 5998 6039 return status; 5999 6040 } 6000 6041 6042 + void ice_rule_add_tunnel_metadata(struct ice_adv_lkup_elem *lkup) 6043 + { 6044 + lkup->type = ICE_HW_METADATA; 6045 + lkup->m_u.metadata.flags[ICE_PKT_FLAGS_TUNNEL] = 6046 + cpu_to_be16(ICE_PKT_TUNNEL_MASK); 6047 + } 6048 + 6049 + void ice_rule_add_vlan_metadata(struct ice_adv_lkup_elem *lkup) 6050 + { 6051 + lkup->type = ICE_HW_METADATA; 6052 + lkup->m_u.metadata.flags[ICE_PKT_FLAGS_VLAN] = 6053 + cpu_to_be16(ICE_PKT_VLAN_MASK); 6054 + } 6055 + 6056 + void ice_rule_add_src_vsi_metadata(struct ice_adv_lkup_elem *lkup) 6057 + { 6058 + lkup->type = ICE_HW_METADATA; 6059 + lkup->m_u.metadata.source_vsi = cpu_to_be16(ICE_MDID_SOURCE_VSI_MASK); 6060 + } 6061 + 6001 6062 /** 6002 6063 * ice_add_adv_rule - helper function to create an advanced switch rule 6003 6064 * @hw: pointer to the hardware structure ··· 6099 6120 if (rinfo->sw_act.fltr_act == ICE_FWD_TO_VSI) 6100 6121 rinfo->sw_act.fwd_id.hw_vsi_id = 6101 6122 ice_get_hw_vsi_num(hw, vsi_handle); 6102 - if (rinfo->sw_act.flag & ICE_FLTR_TX) 6123 + 6124 + if (rinfo->src_vsi) 6125 + rinfo->sw_act.src = ice_get_hw_vsi_num(hw, rinfo->src_vsi); 6126 + else 6103 6127 rinfo->sw_act.src = ice_get_hw_vsi_num(hw, vsi_handle); 6104 6128 6105 6129 status = ice_add_adv_recipe(hw, lkups, lkups_cnt, rinfo, &rid); ··· 6171 6189 goto err_ice_add_adv_rule; 6172 6190 } 6173 6191 6174 - /* set the rule LOOKUP type based on caller specified 'Rx' 6175 - * instead of hardcoding it to be either LOOKUP_TX/RX 6192 + /* If there is no matching criteria for direction there 6193 + * is only one difference between Rx and Tx: 6194 + * - get switch id base on VSI number from source field (Tx) 6195 + * - get switch id base on port number (Rx) 6176 6196 * 6177 - * for 'Rx' set the source to be the port number 6178 - * for 'Tx' set the source to be the source HW VSI number (determined 6179 - * by caller) 6197 + * If matching on direction metadata is chose rule direction is 6198 + * extracted from type value set here. 6180 6199 */ 6181 - if (rinfo->rx) { 6182 - s_rule->hdr.type = cpu_to_le16(ICE_AQC_SW_RULES_T_LKUP_RX); 6183 - s_rule->src = cpu_to_le16(hw->port_info->lport); 6184 - } else { 6200 + if (rinfo->sw_act.flag & ICE_FLTR_TX) { 6185 6201 s_rule->hdr.type = cpu_to_le16(ICE_AQC_SW_RULES_T_LKUP_TX); 6186 6202 s_rule->src = cpu_to_le16(rinfo->sw_act.src); 6203 + } else { 6204 + s_rule->hdr.type = cpu_to_le16(ICE_AQC_SW_RULES_T_LKUP_RX); 6205 + s_rule->src = cpu_to_le16(hw->port_info->lport); 6187 6206 } 6188 6207 6189 6208 s_rule->recipe_id = cpu_to_le16(rid); ··· 6194 6211 if (status) 6195 6212 goto err_ice_add_adv_rule; 6196 6213 6197 - if (rinfo->tun_type != ICE_NON_TUN && 6198 - rinfo->tun_type != ICE_SW_TUN_AND_NON_TUN) { 6199 - status = ice_fill_adv_packet_tun(hw, rinfo->tun_type, 6200 - s_rule->hdr_data, 6201 - profile->offsets); 6202 - if (status) 6203 - goto err_ice_add_adv_rule; 6204 - } 6214 + status = ice_fill_adv_packet_tun(hw, rinfo->tun_type, s_rule->hdr_data, 6215 + profile->offsets); 6216 + if (status) 6217 + goto err_ice_add_adv_rule; 6205 6218 6206 - if (rinfo->vlan_type != 0 && ice_is_dvm_ena(hw)) { 6207 - status = ice_fill_adv_packet_vlan(rinfo->vlan_type, 6208 - s_rule->hdr_data, 6209 - profile->offsets); 6210 - if (status) 6211 - goto err_ice_add_adv_rule; 6212 - } 6219 + status = ice_fill_adv_packet_vlan(hw, rinfo->vlan_type, 6220 + s_rule->hdr_data, 6221 + profile->offsets); 6222 + if (status) 6223 + goto err_ice_add_adv_rule; 6213 6224 6214 6225 status = ice_aq_sw_rules(hw, (struct ice_aqc_sw_rules *)s_rule, 6215 6226 rule_buf_sz, 1, ice_aqc_opc_add_sw_rules, ··· 6445 6468 if (!count) 6446 6469 return -EIO; 6447 6470 } 6448 - 6449 - /* Create any special protocol/offset pairs, such as looking at tunnel 6450 - * bits by extracting metadata 6451 - */ 6452 - status = ice_add_special_words(rinfo, &lkup_exts, ice_is_dvm_ena(hw)); 6453 - if (status) 6454 - return status; 6455 6471 6456 6472 rid = ice_find_recp(hw, &lkup_exts, rinfo->tun_type); 6457 6473 /* If did not find a recipe that match the existing criteria */
+8 -5
drivers/net/ethernet/intel/ice/ice_switch.h
··· 10 10 #define ICE_DFLT_VSI_INVAL 0xff 11 11 #define ICE_FLTR_RX BIT(0) 12 12 #define ICE_FLTR_TX BIT(1) 13 - #define ICE_FLTR_TX_RX (ICE_FLTR_RX | ICE_FLTR_TX) 14 13 #define ICE_VSI_INVAL_ID 0xffff 15 14 #define ICE_INVAL_Q_HANDLE 0xFFFF 16 15 ··· 186 187 }; 187 188 188 189 struct ice_adv_rule_info { 190 + /* Store metadata values in rule info */ 189 191 enum ice_sw_tunnel_type tun_type; 190 - struct ice_sw_act_ctrl sw_act; 191 - u32 priority; 192 - u8 rx; /* true means LOOKUP_RX otherwise LOOKUP_TX */ 193 - u16 fltr_rule_id; 194 192 u16 vlan_type; 193 + u16 fltr_rule_id; 194 + u32 priority; 195 + u16 src_vsi; 196 + struct ice_sw_act_ctrl sw_act; 195 197 struct ice_adv_rule_flags_info flags_info; 196 198 }; 197 199 ··· 342 342 u16 counter_id); 343 343 344 344 /* Switch/bridge related commands */ 345 + void ice_rule_add_tunnel_metadata(struct ice_adv_lkup_elem *lkup); 346 + void ice_rule_add_vlan_metadata(struct ice_adv_lkup_elem *lkup); 347 + void ice_rule_add_src_vsi_metadata(struct ice_adv_lkup_elem *lkup); 345 348 int 346 349 ice_add_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups, 347 350 u16 lkups_cnt, struct ice_adv_rule_info *rinfo,
+24 -10
drivers/net/ethernet/intel/ice/ice_tc_lib.c
··· 54 54 if (flags & (ICE_TC_FLWR_FIELD_VLAN | ICE_TC_FLWR_FIELD_VLAN_PRIO)) 55 55 lkups_cnt++; 56 56 57 + /* is VLAN TPID specified */ 58 + if (flags & ICE_TC_FLWR_FIELD_VLAN_TPID) 59 + lkups_cnt++; 60 + 57 61 /* is CVLAN specified? */ 58 62 if (flags & (ICE_TC_FLWR_FIELD_CVLAN | ICE_TC_FLWR_FIELD_CVLAN_PRIO)) 59 63 lkups_cnt++; ··· 82 78 /* is L4 (TCP/UDP/any other L4 protocol fields) specified? */ 83 79 if (flags & (ICE_TC_FLWR_FIELD_DEST_L4_PORT | 84 80 ICE_TC_FLWR_FIELD_SRC_L4_PORT)) 81 + lkups_cnt++; 82 + 83 + /* matching for tunneled packets in metadata */ 84 + if (fltr->tunnel_type != TNL_LAST) 85 85 lkups_cnt++; 86 86 87 87 return lkups_cnt; ··· 328 320 i++; 329 321 } 330 322 323 + /* always fill matching on tunneled packets in metadata */ 324 + ice_rule_add_tunnel_metadata(&list[i]); 325 + i++; 326 + 331 327 return i; 332 328 } 333 329 ··· 402 390 403 391 /* copy VLAN info */ 404 392 if (flags & (ICE_TC_FLWR_FIELD_VLAN | ICE_TC_FLWR_FIELD_VLAN_PRIO)) { 405 - vlan_tpid = be16_to_cpu(headers->vlan_hdr.vlan_tpid); 406 - rule_info->vlan_type = 407 - ice_check_supported_vlan_tpid(vlan_tpid); 408 - 409 393 if (flags & ICE_TC_FLWR_FIELD_CVLAN) 410 394 list[i].type = ICE_VLAN_EX; 411 395 else ··· 423 415 headers->vlan_hdr.vlan_prio; 424 416 } 425 417 418 + i++; 419 + } 420 + 421 + if (flags & ICE_TC_FLWR_FIELD_VLAN_TPID) { 422 + vlan_tpid = be16_to_cpu(headers->vlan_hdr.vlan_tpid); 423 + rule_info->vlan_type = 424 + ice_check_supported_vlan_tpid(vlan_tpid); 425 + 426 + ice_rule_add_vlan_metadata(&list[i]); 426 427 i++; 427 428 } 428 429 ··· 715 698 if (fltr->direction == ICE_ESWITCH_FLTR_INGRESS) { 716 699 rule_info.sw_act.flag |= ICE_FLTR_RX; 717 700 rule_info.sw_act.src = hw->pf_id; 718 - rule_info.rx = true; 719 701 rule_info.flags_info.act = ICE_SINGLE_ACT_LB_ENABLE; 720 702 } else { 721 703 rule_info.sw_act.flag |= ICE_FLTR_TX; 722 704 rule_info.sw_act.src = vsi->idx; 723 - rule_info.rx = false; 724 705 rule_info.flags_info.act = ICE_SINGLE_ACT_LAN_ENABLE; 725 706 } 726 707 ··· 925 910 rule_info.sw_act.vsi_handle = dest_vsi->idx; 926 911 rule_info.priority = ICE_SWITCH_FLTR_PRIO_VSI; 927 912 rule_info.sw_act.src = hw->pf_id; 928 - rule_info.rx = true; 929 913 dev_dbg(dev, "add switch rule for TC:%u vsi_idx:%u, lkups_cnt:%u\n", 930 914 tc_fltr->action.fwd.tc.tc_class, 931 915 rule_info.sw_act.vsi_handle, lkups_cnt); ··· 935 921 rule_info.sw_act.vsi_handle = dest_vsi->idx; 936 922 rule_info.priority = ICE_SWITCH_FLTR_PRIO_QUEUE; 937 923 rule_info.sw_act.src = hw->pf_id; 938 - rule_info.rx = true; 939 924 dev_dbg(dev, "add switch rule action to forward to queue:%u (HW queue %u), lkups_cnt:%u\n", 940 925 tc_fltr->action.fwd.q.queue, 941 926 tc_fltr->action.fwd.q.hw_queue, lkups_cnt); ··· 942 929 case ICE_DROP_PACKET: 943 930 rule_info.sw_act.flag |= ICE_FLTR_RX; 944 931 rule_info.sw_act.src = hw->pf_id; 945 - rule_info.rx = true; 946 932 rule_info.priority = ICE_SWITCH_FLTR_PRIO_VSI; 947 933 break; 948 934 default: ··· 1472 1460 VLAN_PRIO_MASK); 1473 1461 } 1474 1462 1475 - if (match.mask->vlan_tpid) 1463 + if (match.mask->vlan_tpid) { 1476 1464 headers->vlan_hdr.vlan_tpid = match.key->vlan_tpid; 1465 + fltr->flags |= ICE_TC_FLWR_FIELD_VLAN_TPID; 1466 + } 1477 1467 } 1478 1468 1479 1469 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_CVLAN)) {
+1
drivers/net/ethernet/intel/ice/ice_tc_lib.h
··· 33 33 #define ICE_TC_FLWR_FIELD_L2TPV3_SESSID BIT(26) 34 34 #define ICE_TC_FLWR_FIELD_VLAN_PRIO BIT(27) 35 35 #define ICE_TC_FLWR_FIELD_CVLAN_PRIO BIT(28) 36 + #define ICE_TC_FLWR_FIELD_VLAN_TPID BIT(29) 36 37 37 38 #define ICE_TC_FLOWER_MASK_32 0xFFFFFFFF 38 39
-3
drivers/net/ethernet/intel/ice/ice_vf_lib.c
··· 689 689 */ 690 690 ice_vf_clear_all_promisc_modes(vf, vsi); 691 691 692 - ice_eswitch_del_vf_mac_rule(vf); 693 - 694 692 ice_vf_fdir_exit(vf); 695 693 ice_vf_fdir_init(vf); 696 694 /* clean VF control VSI when resetting VF since it should be setup ··· 714 716 } 715 717 716 718 ice_eswitch_update_repr(vsi); 717 - ice_eswitch_replay_vf_mac_rule(vf); 718 719 719 720 /* if the VF has been reset allow it to come up again */ 720 721 ice_mbx_clear_malvf(&vf->mbx_info);
-8
drivers/net/ethernet/intel/ice/ice_virtchnl.c
··· 3730 3730 3731 3731 for (i = 0; i < al->num_elements; i++) { 3732 3732 u8 *mac_addr = al->list[i].addr; 3733 - int result; 3734 3733 3735 3734 if (!is_unicast_ether_addr(mac_addr) || 3736 3735 ether_addr_equal(mac_addr, vf->hw_lan_addr)) ··· 3738 3739 if (vf->pf_set_mac) { 3739 3740 dev_err(ice_pf_to_dev(pf), "VF attempting to override administratively set MAC address\n"); 3740 3741 v_ret = VIRTCHNL_STATUS_ERR_NOT_SUPPORTED; 3741 - goto handle_mac_exit; 3742 - } 3743 - 3744 - result = ice_eswitch_add_vf_mac_rule(pf, vf, mac_addr); 3745 - if (result) { 3746 - dev_err(ice_pf_to_dev(pf), "Failed to add MAC %pM for VF %d\n, error %d\n", 3747 - mac_addr, vf->vf_id, result); 3748 3742 goto handle_mac_exit; 3749 3743 } 3750 3744
+1 -1
drivers/net/ethernet/intel/ice/ice_vlan_mode.c
··· 219 219 .rid = ICE_SW_LKUP_VLAN, 220 220 .fv_idx = ICE_PKT_FLAGS_0_TO_15_FV_IDX, 221 221 .ignore_valid = false, 222 - .mask = ICE_PKT_FLAGS_0_TO_15_VLAN_FLAGS_MASK, 222 + .mask = ICE_PKT_VLAN_MASK, 223 223 .mask_valid = true, 224 224 .lkup_idx = ICE_SW_LKUP_VLAN_PKT_FLAGS_LKUP_IDX, 225 225 },