Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4829384pxj; Wed, 9 Jun 2021 02:56:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxIU4PuSSOZzI+3/9SejQE/NvtKxYJlO9DjuIpcxxaV92gLDVMXk8J4h/d4y7EjwmzTp69 X-Received: by 2002:a05:6602:22ca:: with SMTP id e10mr18708544ioe.57.1623232589800; Wed, 09 Jun 2021 02:56:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623232589; cv=none; d=google.com; s=arc-20160816; b=n+F8bHHp0rMnEkYxZffhtbiRt/OMplMyd2pGwglWIluvjU4ksjcidA+IlwNKSRvcO4 8CqoqAghKSGN6JqYGjTwsVVpXGcqBSgoLFvd7RfBNjbU40RmwGzrKbGWjPYySmoH8e7W ghz5tcPKZeyX4CPrbG9xqJ7i56oCRjtxzPSCR1txt6wRcwC66xjCH803nYr/+LHP2/nN iasSW+VE7HVUopfBDA8IQvOLabW9L3PEFFobGPr/nWzJSiYS/bqYIlfFRrZ2KtZyAbYg 6PbeBeYfw+jvOPnCz+8IqyTjmAsi2ujY08MPlPe7MrguyLIxKX+PYFZ+lFh58dhqd+1P +ICg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3dzrINowz0AacRPIR/Ix7ZYTtZDXEmu+/MRTKBrPTUM=; b=zvsbt3UsZpDBDZItnoyo79qcQgdHMGcxcdNqsw2JKflosemf0I5X2OROHC8JugdaGm bEHGGVzOYEr9dqBuGaJgM05ayTSjT05wTnxhpZvgin4s++0CSip/EJrvSIZ83jojEoLb g9kH37Pfy4OCWCDvy945Bzl3BuQ9XJpiPKI6qAaLh2fEaZent5zt1RFEioXv7C8xdIZv I2A/ehNSgf8SRDELD6RBYuWNKTZVO7IRH6troNxnHhtPaISXxmvAFonjqm1ShdzLFEmP Z/+iKkQCnU+aJQ0JqI8sScXLcVikyH49G7wuxpc54hseWFHn1kL9fGMxa23gV7Jv694K izkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VQ9Ra1EB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l6si2668199ilf.146.2021.06.09.02.56.17; Wed, 09 Jun 2021 02:56:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VQ9Ra1EB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235794AbhFHStP (ORCPT + 99 others); Tue, 8 Jun 2021 14:49:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:42532 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234953AbhFHSnP (ORCPT ); Tue, 8 Jun 2021 14:43:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2D32E613CE; Tue, 8 Jun 2021 18:36:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623177366; bh=TSZW2gIdiGR3JjeKFgZ1dIFNndfUAXUWJL8acTA0aV8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VQ9Ra1EBqykW5Yum+M4az7avDlbBoyMkfGsU2OI7TpR0th6RbXevc7O1KUJVZ8evg AKJLzftqYvCySwg6C+iEwFu3rBV6qhFgIrwXaOAcEME1Qs+fqZ4ijXFSE7alo+Sqpw NMcs33eOebPZLrZEFpFh6i8IRupFlI4f2YCrI4t8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dave Ertman , Tony Brelinski , Tony Nguyen , Sasha Levin Subject: [PATCH 5.4 26/78] ice: Allow all LLDP packets from PF to Tx Date: Tue, 8 Jun 2021 20:26:55 +0200 Message-Id: <20210608175936.150925370@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175935.254388043@linuxfoundation.org> References: <20210608175935.254388043@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dave Ertman [ 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 Tested-by: Tony Brelinski Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- 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 33dd103035dc..2b55efe5ed96 100644 --- a/drivers/net/ethernet/intel/ice/ice_txrx.c +++ b/drivers/net/ethernet/intel/ice/ice_txrx.c @@ -2109,6 +2109,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; @@ -2156,7 +2157,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->is_sw_lldp)) offload.cd_qw1 |= (u64)(ICE_TX_DESC_DTYPE_CTX | -- 2.30.2