From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mail.toke.dk (Postfix) with ESMTPS id 7984CA15805 for ; Mon, 3 Jul 2023 20:17:10 +0200 (CEST) Authentication-Results: mail.toke.dk; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=QAFeJ/dM DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1688408230; x=1719944230; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KZNQXWh2MdBwG4N8vnL1xHks2FCMqv9d41s0YCk66eE=; b=QAFeJ/dMtbz9B4PcATt6Xs2jFzU7g4ry0dzj3jL95kAanbS2YifJvWmG hVe/8c9bNYYr+3PBBiWlaQNzUZVzLI/Yaz1QTz09TEf3nwcL5XkrPgyp/ sq/O7urzA2j5WYFuhmTmPVy4qvwVRqT05tldMcAOuJB2a62fBp2rSqwFb mE4Q2nginGAEhyiQG79TuaY3Mtl4TohTgTqtDXM87vZwiLArO/rqYX1wh Xhj8SicrLdLAZ7RQg6h6n1W9JQ7o7IFk1bdXbzAXES9SmRl6r/NItYfTN emmURfK0Og60wyWRCgQ7blaeHTlZHypMjXXsda+Rohr4hr58he5LfaqxQ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10760"; a="393682655" X-IronPort-AV: E=Sophos;i="6.01,178,1684825200"; d="scan'208";a="393682655" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2023 11:17:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10760"; a="892615133" X-IronPort-AV: E=Sophos;i="6.01,178,1684825200"; d="scan'208";a="892615133" Received: from irvmail002.ir.intel.com ([10.43.11.120]) by orsmga005.jf.intel.com with ESMTP; 03 Jul 2023 11:17:02 -0700 Received: from lincoln.igk.intel.com (lincoln.igk.intel.com [10.102.21.235]) by irvmail002.ir.intel.com (Postfix) with ESMTP id 06BED3580F; Mon, 3 Jul 2023 19:17:00 +0100 (IST) From: Larysa Zaremba To: bpf@vger.kernel.org Date: Mon, 3 Jul 2023 20:12:17 +0200 Message-ID: <20230703181226.19380-12-larysa.zaremba@intel.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230703181226.19380-1-larysa.zaremba@intel.com> References: <20230703181226.19380-1-larysa.zaremba@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: APSWPOYYHOYTGB6D7PH62CSRZ7AEOCY7 X-Message-ID-Hash: APSWPOYYHOYTGB6D7PH62CSRZ7AEOCY7 X-MailFrom: larysa.zaremba@intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Larysa Zaremba , ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, song@kernel.org, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, David Ahern , Jakub Kicinski , Willem de Bruijn , Jesper Dangaard Brouer , Anatoly Burakov , Alexander Lobakin , Magnus Karlsson , Maryam Tahhan , xdp-hints@xdp-project.net, netdev@vger.kernel.org X-Mailman-Version: 3.3.8 Precedence: list Subject: [xdp-hints] [PATCH bpf-next v2 11/20] ice: use VLAN proto from ring packet context in skb path List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: VLAN proto, used in ice XDP hints implementation is stored in ring packet context. Utilize this value in skb VLAN processing too instead of checking netdev features. Signed-off-by: Larysa Zaremba --- drivers/net/ethernet/intel/ice/ice_txrx_lib.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_txrx_lib.c b/drivers/net/ethernet/intel/ice/ice_txrx_lib.c index c290c9d20c5c..e9f334fecdf1 100644 --- a/drivers/net/ethernet/intel/ice/ice_txrx_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_txrx_lib.c @@ -291,13 +291,9 @@ ice_process_skb_fields(struct ice_rx_ring *rx_ring, void ice_receive_skb(struct ice_rx_ring *rx_ring, struct sk_buff *skb, u16 vlan_tag) { - netdev_features_t features = rx_ring->netdev->features; - bool non_zero_vlan = !!(vlan_tag & VLAN_VID_MASK); - - if ((features & NETIF_F_HW_VLAN_CTAG_RX) && non_zero_vlan) - __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_tag); - else if ((features & NETIF_F_HW_VLAN_STAG_RX) && non_zero_vlan) - __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021AD), vlan_tag); + if (vlan_tag & VLAN_VID_MASK && rx_ring->pkt_ctx.vlan_proto) + __vlan_hwaccel_put_tag(skb, rx_ring->pkt_ctx.vlan_proto, + vlan_tag); napi_gro_receive(&rx_ring->q_vector->napi, skb); } -- 2.41.0