lkml.org 
[lkml]   [2021]   [Jun]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.10 049/137] ice: Allow all LLDP packets from PF to Tx
    Date
    From: Dave Ertman <david.m.ertman@intel.com>

    [ Upstream commit f9f83202b7263ac371d616d6894a2c9ed79158ef ]

    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: 0c3a6101ff2d ("ice: Allow egress control packets from PF_VSI")
    Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
    Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/net/ethernet/intel/ice/ice_txrx.c | 5 ++++-
    1 file changed, 4 insertions(+), 1 deletion(-)

    diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c
    index 0f2544c420ac..1510091a63e8 100644
    --- a/drivers/net/ethernet/intel/ice/ice_txrx.c
    +++ b/drivers/net/ethernet/intel/ice/ice_txrx.c
    @@ -2373,6 +2373,7 @@ ice_xmit_frame_ring(struct sk_buff *skb, struct ice_ring *tx_ring)
    struct ice_tx_offload_params offload = { 0 };
    struct ice_vsi *vsi = tx_ring->vsi;
    struct ice_tx_buf *first;
    + struct ethhdr *eth;
    unsigned int count;
    int tso, csum;

    @@ -2419,7 +2420,9 @@ ice_xmit_frame_ring(struct sk_buff *skb, struct ice_ring *tx_ring)
    goto out_drop;

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


    \
     
     \ /
      Last update: 2021-06-08 21:02    [W:4.088 / U:0.148 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site