From patchwork Thu Jun 11 08:43:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zhang X-Patchwork-Id: 71247 X-Patchwork-Delegate: xiaolong.ye@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 15016A00C5; Thu, 11 Jun 2020 10:40:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E5E1E1BEC5; Thu, 11 Jun 2020 10:39:50 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 1DC351BDAE for ; Thu, 11 Jun 2020 10:39:48 +0200 (CEST) IronPort-SDR: mUPcOA8xmUp+jNPgZUcC9NhvPVo/B1c+UhCgT0tDIbawX8dgCeJBtBwojqQ5PGdeWB4KIC8Am5 HKDhSWM2+DSw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2020 01:39:49 -0700 IronPort-SDR: h8vztkDQApH8Tbr2Paj39+1Tc0xaBrKzDuM+qh0w7P7tyYiRfUoLdao4x4f+HG0IHnoKKAXqcK C+9grGx+mBLw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,499,1583222400"; d="scan'208";a="419039198" Received: from dpdk51.sh.intel.com ([10.67.111.82]) by orsmga004.jf.intel.com with ESMTP; 11 Jun 2020 01:39:47 -0700 From: Qi Zhang To: qiming.yang@intel.com Cc: dev@dpdk.org, xiaolong.ye@intel.com, Qi Zhang , Wei Zhao , Paul M Stillwell Jr Date: Thu, 11 Jun 2020 16:43:28 +0800 Message-Id: <20200611084330.18301-9-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20200611084330.18301-1-qi.z.zhang@intel.com> References: <20200611084330.18301-1-qi.z.zhang@intel.com> Subject: [dpdk-dev] [PATCH 08/10] net/ice/base: choose TCP dummy packet by protocol X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" In order to find proper dummy packets for switch filter, it need to check ipv4 next protocol number, if it is 0x06, which means next payload is TCP, we need to use TCP format dummy packet. Signed-off-by: Wei Zhao Signed-off-by: Paul M Stillwell Jr Signed-off-by: Qi Zhang --- drivers/net/ice/base/ice_switch.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index 06d8f9c55..ee0813b52 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -13,6 +13,7 @@ #define ICE_IPV4_NVGRE_PROTO_ID 0x002F #define ICE_PPP_IPV6_PROTO_ID 0x0057 #define ICE_IPV6_ETHER_ID 0x86DD +#define ICE_TCP_PROTO_ID 0x06 /* Dummy ethernet header needed in the ice_aqc_sw_rules_elem * struct to configure any switch filter rules. @@ -6836,6 +6837,12 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt, lkups[i].m_u.ethertype.ethtype_id == 0xFFFF) ipv6 = true; + else if (lkups[i].type == ICE_IPV4_IL && + lkups[i].h_u.ipv4_hdr.protocol == + ICE_TCP_PROTO_ID && + lkups[i].m_u.ipv4_hdr.protocol == + 0xFF) + tcp = true; } if (tun_type == ICE_SW_TUN_IPV4_ESP) {