From patchwork Fri Apr 23 16:42:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Nguyen X-Patchwork-Id: 426669 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11AF9C433B4 for ; Fri, 23 Apr 2021 16:40:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D9DA261467 for ; Fri, 23 Apr 2021 16:40:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242966AbhDWQlb (ORCPT ); Fri, 23 Apr 2021 12:41:31 -0400 Received: from mga17.intel.com ([192.55.52.151]:13567 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231499AbhDWQl2 (ORCPT ); Fri, 23 Apr 2021 12:41:28 -0400 IronPort-SDR: hz+y4AT+VcE08OLyk9v73bpb677cI8jnwRVnZksl+EWr5Vy1iF1poIZU3yhbPDzuqrEpp39HPy xlaaS/WXx+zQ== X-IronPort-AV: E=McAfee;i="6200,9189,9963"; a="176218635" X-IronPort-AV: E=Sophos;i="5.82,246,1613462400"; d="scan'208";a="176218635" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2021 09:40:52 -0700 IronPort-SDR: nIekR9G//K6Bbaz6sXUeTkG3sCUzHBhiaxiTB7fODNzoqsbbIzViY8NsO64UjcWRBORPT2YTNz VJzGab01TSMA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,246,1613462400"; d="scan'208";a="456285962" Received: from anguy11-desk2.jf.intel.com ([10.166.244.147]) by fmsmga002.fm.intel.com with ESMTP; 23 Apr 2021 09:40:51 -0700 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org Cc: Coiby Xu , netdev@vger.kernel.org, sassmann@redhat.com, anthony.l.nguyen@intel.com, Dave Switzer Subject: [PATCH net-next 2/8] i40e: use minimal Tx and Rx pairs for kdump Date: Fri, 23 Apr 2021 09:42:41 -0700 Message-Id: <20210423164247.3252913-3-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210423164247.3252913-1-anthony.l.nguyen@intel.com> References: <20210423164247.3252913-1-anthony.l.nguyen@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Coiby Xu Set the number of the MSI-X vectors to 1. When MSI-X is enabled, it's not allowed to use more TC queue pairs than MSI-X vectors (pf->num_lan_msix) exist. Thus the number of Tx and Rx pairs (vsi->num_queue_pairs) will be equal to the number of MSI-X vectors, i.e., 1. Signed-off-by: Coiby Xu Tested-by: Dave Switzer Signed-off-by: Tony Nguyen --- drivers/net/ethernet/intel/i40e/i40e_main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 687ef52a8116..b51b8e25501d 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -6,6 +6,7 @@ #include #include #include +#include /* Local includes */ #include "i40e.h" @@ -15506,6 +15507,14 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (err) goto err_switch_setup; + /* Reduce Tx and Rx pairs for kdump + * When MSI-X is enabled, it's not allowed to use more TC queue + * pairs than MSI-X vectors (pf->num_lan_msix) exist. Thus + * vsi->num_queue_pairs will be equal to pf->num_lan_msix, i.e., 1. + */ + if (is_kdump_kernel()) + pf->num_lan_msix = 1; + pf->udp_tunnel_nic.set_port = i40e_udp_tunnel_set_port; pf->udp_tunnel_nic.unset_port = i40e_udp_tunnel_unset_port; pf->udp_tunnel_nic.flags = UDP_TUNNEL_NIC_INFO_MAY_SLEEP; From patchwork Fri Apr 23 16:42:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Nguyen X-Patchwork-Id: 426668 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF2E9C43460 for ; Fri, 23 Apr 2021 16:40:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 999F161462 for ; Fri, 23 Apr 2021 16:40:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243109AbhDWQle (ORCPT ); Fri, 23 Apr 2021 12:41:34 -0400 Received: from mga17.intel.com ([192.55.52.151]:13569 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232065AbhDWQl3 (ORCPT ); Fri, 23 Apr 2021 12:41:29 -0400 IronPort-SDR: oDeRTx8/gD27XqBIgVoHodJbuZowa53gKOCtanT102YXR9nW48Sx7deQNdSb2b+aqYg2oLpxuW wfYQX6AZkhMg== X-IronPort-AV: E=McAfee;i="6200,9189,9963"; a="176218637" X-IronPort-AV: E=Sophos;i="5.82,246,1613462400"; d="scan'208";a="176218637" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2021 09:40:52 -0700 IronPort-SDR: 6liM/nSwHn1/YX6sxd857eoaNVRDe3DLsrLezNHv/VeTSns4fTt8eCBsiVv63z5uuCZ3O5Je+o y76DamiwxFKQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,246,1613462400"; d="scan'208";a="456285967" Received: from anguy11-desk2.jf.intel.com ([10.166.244.147]) by fmsmga002.fm.intel.com with ESMTP; 23 Apr 2021 09:40:52 -0700 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org Cc: Coiby Xu , netdev@vger.kernel.org, sassmann@redhat.com, anthony.l.nguyen@intel.com, Dave Switzer Subject: [PATCH net-next 4/8] i40e: use minimal admin queue for kdump Date: Fri, 23 Apr 2021 09:42:43 -0700 Message-Id: <20210423164247.3252913-5-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210423164247.3252913-1-anthony.l.nguyen@intel.com> References: <20210423164247.3252913-1-anthony.l.nguyen@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Coiby Xu The minimum size of admin send/receive queue is 1 and 2 respectively. The admin send queue can't be set to 1 because in that case, the firmware would fail to init. Signed-off-by: Coiby Xu Tested-by: Dave Switzer Signed-off-by: Tony Nguyen --- drivers/net/ethernet/intel/i40e/i40e.h | 2 ++ drivers/net/ethernet/intel/i40e/i40e_main.c | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h index 15f93b355099..9067cd3ce243 100644 --- a/drivers/net/ethernet/intel/i40e/i40e.h +++ b/drivers/net/ethernet/intel/i40e/i40e.h @@ -66,6 +66,8 @@ #define I40E_FDIR_RING_COUNT 32 #define I40E_MAX_AQ_BUF_SIZE 4096 #define I40E_AQ_LEN 256 +#define I40E_MIN_ARQ_LEN 1 +#define I40E_MIN_ASQ_LEN 2 #define I40E_AQ_WORK_LIMIT 66 /* max number of VFs + a little */ #define I40E_MAX_USER_PRIORITY 8 #define I40E_DEFAULT_TRAFFIC_CLASS BIT(0) diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 2d3dbb3c0e14..c2d145a56b5e 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -15348,8 +15348,13 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) i40e_check_recovery_mode(pf); - hw->aq.num_arq_entries = I40E_AQ_LEN; - hw->aq.num_asq_entries = I40E_AQ_LEN; + if (is_kdump_kernel()) { + hw->aq.num_arq_entries = I40E_MIN_ARQ_LEN; + hw->aq.num_asq_entries = I40E_MIN_ASQ_LEN; + } else { + hw->aq.num_arq_entries = I40E_AQ_LEN; + hw->aq.num_asq_entries = I40E_AQ_LEN; + } hw->aq.arq_buf_size = I40E_MAX_AQ_BUF_SIZE; hw->aq.asq_buf_size = I40E_MAX_AQ_BUF_SIZE; pf->adminq_work_limit = I40E_AQ_WORK_LIMIT; From patchwork Fri Apr 23 16:42:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Nguyen X-Patchwork-Id: 426667 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59356C43461 for ; Fri, 23 Apr 2021 16:41:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2CF60611CC for ; Fri, 23 Apr 2021 16:41:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243162AbhDWQlh (ORCPT ); Fri, 23 Apr 2021 12:41:37 -0400 Received: from mga17.intel.com ([192.55.52.151]:13569 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231341AbhDWQlb (ORCPT ); Fri, 23 Apr 2021 12:41:31 -0400 IronPort-SDR: Zv45ehdGcKWMRsbRkdqMXT2SUvhlE5glazUPhUBbbMQr3c0gJ7LPUOrZC4XQ1jL43La94w+SxW 31TvIOI+mg3A== X-IronPort-AV: E=McAfee;i="6200,9189,9963"; a="176218639" X-IronPort-AV: E=Sophos;i="5.82,246,1613462400"; d="scan'208";a="176218639" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2021 09:40:53 -0700 IronPort-SDR: yTdkVDXI5E6J6geH12M21Z9riRZEyxmKeWUr/3eQh8tR+FeSi61N4QPDsNzcRYjf9CFm0CSm4A lh6IsmFXAP2g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,246,1613462400"; d="scan'208";a="456285975" Received: from anguy11-desk2.jf.intel.com ([10.166.244.147]) by fmsmga002.fm.intel.com with ESMTP; 23 Apr 2021 09:40:52 -0700 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org Cc: Haiyue Wang , netdev@vger.kernel.org, sassmann@redhat.com, anthony.l.nguyen@intel.com Subject: [PATCH net-next 6/8] iavf: change the flex-byte support number to macro definition Date: Fri, 23 Apr 2021 09:42:45 -0700 Message-Id: <20210423164247.3252913-7-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210423164247.3252913-1-anthony.l.nguyen@intel.com> References: <20210423164247.3252913-1-anthony.l.nguyen@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Haiyue Wang The maximum number (2) of flex-byte support is derived from ethtool use-def data size (8 byte). Change the magic number 2 to macro definition, and add the comment to track the design thinking, so the code is clear and easily maintained. Signed-off-by: Haiyue Wang Signed-off-by: Tony Nguyen --- drivers/net/ethernet/intel/iavf/iavf_ethtool.c | 2 +- drivers/net/ethernet/intel/iavf/iavf_fdir.h | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c index 3d904bc6ee76..af43fbd8cb75 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c +++ b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c @@ -939,7 +939,7 @@ iavf_parse_rx_flow_user_data(struct ethtool_rx_flow_spec *fsp, if (!(fsp->flow_type & FLOW_EXT)) return 0; - for (i = 0; i < 2; i++) { + for (i = 0; i < IAVF_FLEX_WORD_NUM; i++) { #define IAVF_USERDEF_FLEX_WORD_M GENMASK(15, 0) #define IAVF_USERDEF_FLEX_OFFS_S 16 #define IAVF_USERDEF_FLEX_OFFS_M GENMASK(31, IAVF_USERDEF_FLEX_OFFS_S) diff --git a/drivers/net/ethernet/intel/iavf/iavf_fdir.h b/drivers/net/ethernet/intel/iavf/iavf_fdir.h index 2439c970b657..33c55c366315 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_fdir.h +++ b/drivers/net/ethernet/intel/iavf/iavf_fdir.h @@ -35,6 +35,11 @@ enum iavf_fdir_flow_type { IAVF_FDIR_FLOW_PTYPE_MAX, }; +/* Must not exceed the array element number of '__be32 data[2]' in the ethtool + * 'struct ethtool_rx_flow_spec.m_ext.data[2]' to express the flex-byte (word). + */ +#define IAVF_FLEX_WORD_NUM 2 + struct iavf_flex_word { u16 offset; u16 word; @@ -71,7 +76,7 @@ struct iavf_fdir_ip { }; struct iavf_fdir_extra { - u32 usr_def[2]; + u32 usr_def[IAVF_FLEX_WORD_NUM]; }; /* bookkeeping of Flow Director filters */ @@ -95,7 +100,7 @@ struct iavf_fdir_fltr { /* flex byte filter data */ u8 ip_ver; /* used to adjust the flex offset, 4 : IPv4, 6 : IPv6 */ u8 flex_cnt; - struct iavf_flex_word flex_words[2]; + struct iavf_flex_word flex_words[IAVF_FLEX_WORD_NUM]; u32 flow_id; From patchwork Fri Apr 23 16:42:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Nguyen X-Patchwork-Id: 426666 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6869C433B4 for ; Fri, 23 Apr 2021 16:41:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9C56461462 for ; Fri, 23 Apr 2021 16:41:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243236AbhDWQlk (ORCPT ); Fri, 23 Apr 2021 12:41:40 -0400 Received: from mga17.intel.com ([192.55.52.151]:13567 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242687AbhDWQlb (ORCPT ); Fri, 23 Apr 2021 12:41:31 -0400 IronPort-SDR: h2Sohiu+IUieHoIrBxcnr5YfTc3aYzddL7wsHHE1iH6HdOcwUlo/UvCQZ5xBuEEEH6yH3JvIzh WweHyJKiCmrg== X-IronPort-AV: E=McAfee;i="6200,9189,9963"; a="176218641" X-IronPort-AV: E=Sophos;i="5.82,246,1613462400"; d="scan'208";a="176218641" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2021 09:40:53 -0700 IronPort-SDR: BoH7gZ9HoYWQ9SEmt4bj4Shz1lbKhXokjbj8RwS9CY3brlvKYmWOlpOWY21okCSOw3ozoD4QFg CqTAYYCbqh4g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,246,1613462400"; d="scan'208";a="456285980" Received: from anguy11-desk2.jf.intel.com ([10.166.244.147]) by fmsmga002.fm.intel.com with ESMTP; 23 Apr 2021 09:40:53 -0700 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org Cc: Haiyue Wang , netdev@vger.kernel.org, sassmann@redhat.com, anthony.l.nguyen@intel.com Subject: [PATCH net-next 8/8] iavf: redefine the magic number for FDIR GTP-U header fields Date: Fri, 23 Apr 2021 09:42:47 -0700 Message-Id: <20210423164247.3252913-9-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210423164247.3252913-1-anthony.l.nguyen@intel.com> References: <20210423164247.3252913-1-anthony.l.nguyen@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Haiyue Wang The flex-byte for GTP-U protocol header fields uses the magic number, which is hard to maintain and understand, define the interested fields with meaningful macro name, based on the GTP-U protocol stack: GTP-U header +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 0x1 |1|0|1|0|0| 0xff | Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TEID = 1654 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Sequence Number = 0 |N-PDU Number=0 |NextExtHdr=0x85| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ GTP-U Extension Header (PDU Session Container) +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ExtHdrLen=2 |Type=0 | Spare |0|0| QFI | PPI | Spare | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Padding |NextExtHdr=0x0 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Signed-off-by: Haiyue Wang Signed-off-by: Tony Nguyen --- drivers/net/ethernet/intel/iavf/iavf_fdir.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/iavf/iavf_fdir.c b/drivers/net/ethernet/intel/iavf/iavf_fdir.c index af872ea3163f..6146203efd84 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_fdir.c +++ b/drivers/net/ethernet/intel/iavf/iavf_fdir.c @@ -54,8 +54,13 @@ iavf_fill_fdir_gtpu_hdr(struct iavf_fdir_fltr *fltr, #define IAVF_GTPU_HDR_TEID_OFFS0 4 #define IAVF_GTPU_HDR_TEID_OFFS1 6 #define IAVF_GTPU_HDR_N_PDU_AND_NEXT_EXTHDR_OFFS 10 +#define IAVF_GTPU_HDR_NEXT_EXTHDR_TYPE_MASK 0x00FF /* skip N_PDU */ +/* PDU Session Container Extension Header (PSC) */ +#define IAVF_GTPU_PSC_EXTHDR_TYPE 0x85 #define IAVF_GTPU_HDR_PSC_PDU_TYPE_AND_QFI_OFFS 13 -#define IAVF_GTPU_PSC_EXTHDR_TYPE 0x85 /* PDU Session Container Extension Header */ +#define IAVF_GTPU_HDR_PSC_PDU_QFI_MASK 0x3F /* skip Type */ +#define IAVF_GTPU_EH_QFI_IDX 1 + if (fltr->flex_words[i].offset < adj_offs) return -EINVAL; @@ -71,7 +76,9 @@ iavf_fill_fdir_gtpu_hdr(struct iavf_fdir_fltr *fltr, } break; case IAVF_GTPU_HDR_N_PDU_AND_NEXT_EXTHDR_OFFS: - if ((fltr->flex_words[i].word & 0xff) != IAVF_GTPU_PSC_EXTHDR_TYPE) + if ((fltr->flex_words[i].word & + IAVF_GTPU_HDR_NEXT_EXTHDR_TYPE_MASK) != + IAVF_GTPU_PSC_EXTHDR_TYPE) return -EOPNOTSUPP; if (!ehdr) ehdr = &proto_hdrs->proto_hdr[proto_hdrs->count++]; @@ -80,7 +87,9 @@ iavf_fill_fdir_gtpu_hdr(struct iavf_fdir_fltr *fltr, case IAVF_GTPU_HDR_PSC_PDU_TYPE_AND_QFI_OFFS: if (!ehdr) return -EINVAL; - ehdr->buffer[1] = fltr->flex_words[i].word & 0x3F; + ehdr->buffer[IAVF_GTPU_EH_QFI_IDX] = + fltr->flex_words[i].word & + IAVF_GTPU_HDR_PSC_PDU_QFI_MASK; VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(ehdr, GTPU_EH, QFI); break; default: