Skip to content

Commit f9f8320

Browse files
dmertmananguy11
authored andcommitted
ice: Allow all LLDP packets from PF to Tx
Currently in the ice driver, the check whether to allow a LLDP packet to egress the interface from the PF_VSI is being based on the SKB's priority field. It checks to see if the packets priority is equal to TC_PRIO_CONTROL. Injected LLDP packets do not always meet this condition. SCAPY defaults to a sk_buff->protocol value of ETH_P_ALL (0x0003) and does not set the priority field. There will be other injection methods (even ones used by end users) that will not correctly configure the socket so that SKB fields are correctly populated. Then ethernet header has to have to correct value for the protocol though. Add a check to also allow packets whose ethhdr->h_proto matches ETH_P_LLDP (0x88CC). Fixes: 0c3a610 ("ice: Allow egress control packets from PF_VSI") Signed-off-by: Dave Ertman <[email protected]> Tested-by: Tony Brelinski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 5cd349c commit f9f8320

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/net/ethernet/intel/ice/ice_txrx.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2149,6 +2149,7 @@ ice_xmit_frame_ring(struct sk_buff *skb, struct ice_ring *tx_ring)
21492149
struct ice_tx_offload_params offload = { 0 };
21502150
struct ice_vsi *vsi = tx_ring->vsi;
21512151
struct ice_tx_buf *first;
2152+
struct ethhdr *eth;
21522153
unsigned int count;
21532154
int tso, csum;
21542155

@@ -2195,7 +2196,9 @@ ice_xmit_frame_ring(struct sk_buff *skb, struct ice_ring *tx_ring)
21952196
goto out_drop;
21962197

21972198
/* allow CONTROL frames egress from main VSI if FW LLDP disabled */
2198-
if (unlikely(skb->priority == TC_PRIO_CONTROL &&
2199+
eth = (struct ethhdr *)skb_mac_header(skb);
2200+
if (unlikely((skb->priority == TC_PRIO_CONTROL ||
2201+
eth->h_proto == htons(ETH_P_LLDP)) &&
21992202
vsi->type == ICE_VSI_PF &&
22002203
vsi->port_info->qos_cfg.is_sw_lldp))
22012204
offload.cd_qw1 |= (u64)(ICE_TX_DESC_DTYPE_CTX |

0 commit comments

Comments
 (0)