From patchwork Mon Jul 3 18:12:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larysa Zaremba X-Patchwork-Id: 13300348 X-Patchwork-Delegate: bpf@iogearbox.net Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8128C10965; Mon, 3 Jul 2023 18:17:27 +0000 (UTC) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98406E5F; Mon, 3 Jul 2023 11:17:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1688408228; x=1719944228; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KZNQXWh2MdBwG4N8vnL1xHks2FCMqv9d41s0YCk66eE=; b=V/SlE2zOqUTfoPuOKgaGG3Qzut7Vg8q5+rjhpDtzlM0E6seEE4QlibBq xachyt0DB6ciWIt7e/x5wH7lQEld6zFVdTZY++H4L3aVr4eQJpIMzKrjL e66yu9KLtu5bjlJ7LVXzxTu4PTnNR+3pOdyHD53xsS0INN4zPW0vslTuh p1CCjde0lfLCkzAtqmcj4GzKkZ4UKVQVhTsj9N/Oi0Ee8+8R0WAR8SXy8 navpxxLvSH45PJhjlzn3Dkg5vOZ3jwwm78DDkKHzqR56i87Uz6NtqMcol QMNfhCTOwjGSDJvL9if/3kd5vkrl28LSscCER5jZ16NfV9vCP5ALx5AyL w==; X-IronPort-AV: E=McAfee;i="6600,9927,10760"; a="393682656" X-IronPort-AV: E=Sophos;i="6.01,178,1684825200"; d="scan'208";a="393682656" 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 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 Subject: [PATCH bpf-next v2 11/20] ice: use VLAN proto from ring packet context in skb path 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> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: bpf@iogearbox.net 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); }