From patchwork Mon Jun 15 05:59:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenzhuo Lu X-Patchwork-Id: 5424 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 34C0C5A65; Mon, 15 Jun 2015 07:59:38 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 19C42DE6 for ; Mon, 15 Jun 2015 07:59:35 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 14 Jun 2015 22:59:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,617,1427785200"; d="scan'208";a="711007421" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga001.jf.intel.com with ESMTP; 14 Jun 2015 22:59:33 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t5F5xWGb017513; Mon, 15 Jun 2015 13:59:32 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t5F5xS0O029703; Mon, 15 Jun 2015 13:59:30 +0800 Received: (from wenzhuol@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t5F5xSgr029699; Mon, 15 Jun 2015 13:59:28 +0800 From: Wenzhuo Lu To: dev@dpdk.org Date: Mon, 15 Jun 2015 13:59:26 +0800 Message-Id: <1434347966-29668-1-git-send-email-wenzhuo.lu@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] ixgbe: fix x550 flow director issue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On x550, flow director doesn't support other IP packets directly. If we want to monitor IP other packets, the L4 protocol and ports must be masked. It means, on x550, if we want to add a flow director filter for other IP packets, a flow director mask must have been configed to mask L4 protocol and ports. Return err when the user try to config a flow director filter for other IP packets without flow director mask configed before. And print err log for it. Signed-off-by: Wenzhuo Lu Acked-by: Jingjing Wu --- drivers/net/ixgbe/ixgbe_fdir.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdir.c index db48817..40824ba 100644 --- a/drivers/net/ixgbe/ixgbe_fdir.c +++ b/drivers/net/ixgbe/ixgbe_fdir.c @@ -334,9 +334,10 @@ fdir_set_input_mask_82599(struct rte_eth_dev *dev, fdirtcpm = reverse_fdir_bitmasks(input_mask->dst_port_mask, input_mask->src_port_mask); - /* write both the same so that UDP and TCP use the same mask */ + /* write all the same so that UDP, TCP and SCTP use the same mask */ IXGBE_WRITE_REG(hw, IXGBE_FDIRTCPM, ~fdirtcpm); IXGBE_WRITE_REG(hw, IXGBE_FDIRUDPM, ~fdirtcpm); + IXGBE_WRITE_REG(hw, IXGBE_FDIRSCTPM, ~fdirtcpm); info->mask.src_port_mask = input_mask->src_port_mask; info->mask.dst_port_mask = input_mask->dst_port_mask; @@ -899,10 +900,31 @@ ixgbe_add_del_fdir_filter(struct rte_eth_dev *dev, uint8_t queue; bool is_perfect = FALSE; int err; + struct ixgbe_hw_fdir_info *info = + IXGBE_DEV_PRIVATE_TO_FDIR_INFO(dev->data->dev_private); if (dev->data->dev_conf.fdir_conf.mode == RTE_FDIR_MODE_NONE) return -ENOTSUP; + /* + * Sanity check for x550. + * When adding a new filter with flow type set to IPv4-other, + * the flow director mask should be configed before, + * and the L4 protocol and ports are masked. + */ + if ((!del) && + (hw->mac.type == ixgbe_mac_X550 || + hw->mac.type == ixgbe_mac_X550EM_x) && + (fdir_filter->input.flow_type == + RTE_ETH_FLOW_NONFRAG_IPV4_OTHER) && + (info->mask.src_port_mask != 0 || + info->mask.dst_port_mask != 0)) { + PMD_DRV_LOG(ERR, "By this device," + " IPv4-other is not supported without" + " L4 protocol and ports masked!"); + return -ENOTSUP; + } + if (dev->data->dev_conf.fdir_conf.mode == RTE_FDIR_MODE_PERFECT) is_perfect = TRUE;