From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 16D2423C for ; Tue, 21 Nov 2017 14:30:51 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id AA87820696; Tue, 21 Nov 2017 08:30:50 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 21 Nov 2017 08:30:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=mIVTyHiQR5uFG75cP QEIxMcRBdr4ZMm5wkmm0DkEvVQ=; b=r15VpkiFKGBrxK76aOCOVhruCkKtLHjpN wnfpHwf6TsIAHcVNWdhBeC44zSSGAaA9TBvOL0f73gApZoIORiUlmrLycj+zvkSA A9w2NlrkRjIDOPJhmue+uxQ2+cpvn5KMLP9Eapp/XfkLSFcOANOlbYS9zwVfTJk0 4Ldbdg8+kBURIN05/zwjf3KEm7hEUTbMbpzNAtuhKKOnIZbLH+RPR2Q/bgpBHV8L GRYrNRBabAxN16CtL1wEmtr2kYEvOs/Q+1PXHO1523M/PTTOUH8MSk50SsA9Tp8k /vlJVBAK2YbsnvXL/AgVCj4E6ipsWgOrEXtbkGQxj1V+DKPnlbpLg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=mIVTyHiQR5uFG75cPQEIxMcRBdr4ZMm5wkmm0DkEvVQ=; b=OSRhnKH8 MVcQHxhSx7m5bE62ImHztSAtGFGUsdoGqHBfZqQCjviQbfzMhDuFqIwQZBpF4nio ZbUsQUNPN03SrodThbbXyMIfOg483GSuquMR80NehcFH4H+w13sE5H1o/xE87l25 n8ZMbqVxZmhr9K/jdij48n5hWyMV3CihSQr0ROl7/B9ImWDISCH3hQzCBtSWdE5k mZbZS0kFZFPYYmEfCbJytozAMFxw08uoU+Gm+t99utWPSJ1J2XAmS9LGzQqbTRnI Jb5i6jIkXatlHDy5Idh7bpASSYjLmYQ26k/yz3WtqDnlSLMTVKK61sIYCV46Zr3V MiQaruAWhm0/AA== X-ME-Sender: Received: from localhost.localdomain (unknown [180.158.62.0]) by mail.messagingengine.com (Postfix) with ESMTPA id 9197A243B9; Tue, 21 Nov 2017 08:30:40 -0500 (EST) From: Yuanhan Liu To: Wei Zhao Cc: Yuan Peng , Wei Dai , dpdk stable Date: Tue, 21 Nov 2017 21:18:40 +0800 Message-Id: <1511270333-31002-178-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> References: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/ixgbe: fix filter parser for L2 tunnel' has been queued to stable release 17.08.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 13:30:51 -0000 Hi, FYI, your patch has been queued to stable release 17.08.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/24/17. So please shout if anyone has objections. Thanks. --yliu --- >>From 8bf5b2c0dd8d615d757578afff81ec808cfa470e Mon Sep 17 00:00:00 2001 From: Wei Zhao Date: Fri, 3 Nov 2017 15:38:38 +0800 Subject: [PATCH] net/ixgbe: fix filter parser for L2 tunnel [ upstream commit 52960057f1d4958b541331ccba88c3241ebe9613 ] The action for L2 tunnel should be VF or PF, not QUEUE. Fixes: 99e7003831c ("net/ixgbe: parse L2 tunnel filter") Signed-off-by: Wei Zhao Tested-by: Yuan Peng Acked-by: Wei Dai --- drivers/net/ixgbe/ixgbe_flow.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c index d679608..a63ae1b 100644 --- a/drivers/net/ixgbe/ixgbe_flow.c +++ b/drivers/net/ixgbe/ixgbe_flow.c @@ -1004,7 +1004,7 @@ ixgbe_parse_syn_filter(struct rte_eth_dev *dev, * The first not void item can be E_TAG. * The next not void item must be END. * action: - * The first not void action should be QUEUE. + * The first not void action should be VF or PF. * The next not void action should be END. * pattern example: * ITEM Spec Mask @@ -1015,7 +1015,8 @@ ixgbe_parse_syn_filter(struct rte_eth_dev *dev, * item->last should be NULL. */ static int -cons_parse_l2_tn_filter(const struct rte_flow_attr *attr, +cons_parse_l2_tn_filter(struct rte_eth_dev *dev, + const struct rte_flow_attr *attr, const struct rte_flow_item pattern[], const struct rte_flow_action actions[], struct rte_eth_l2_tunnel_conf *filter, @@ -1025,7 +1026,8 @@ cons_parse_l2_tn_filter(const struct rte_flow_attr *attr, const struct rte_flow_item_e_tag *e_tag_spec; const struct rte_flow_item_e_tag *e_tag_mask; const struct rte_flow_action *act; - const struct rte_flow_action_queue *act_q; + const struct rte_flow_action_vf *act_vf; + struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); if (!pattern) { rte_flow_error_set(error, EINVAL, @@ -1133,9 +1135,10 @@ cons_parse_l2_tn_filter(const struct rte_flow_attr *attr, return -rte_errno; } - /* check if the first not void action is QUEUE. */ + /* check if the first not void action is VF or PF. */ act = next_no_void_action(actions, NULL); - if (act->type != RTE_FLOW_ACTION_TYPE_QUEUE) { + if (act->type != RTE_FLOW_ACTION_TYPE_VF && + act->type != RTE_FLOW_ACTION_TYPE_PF) { memset(filter, 0, sizeof(struct rte_eth_l2_tunnel_conf)); rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, @@ -1143,8 +1146,12 @@ cons_parse_l2_tn_filter(const struct rte_flow_attr *attr, return -rte_errno; } - act_q = (const struct rte_flow_action_queue *)act->conf; - filter->pool = act_q->index; + if (act->type == RTE_FLOW_ACTION_TYPE_VF) { + act_vf = (const struct rte_flow_action_vf *)act->conf; + filter->pool = act_vf->id; + } else { + filter->pool = pci_dev->max_vfs; + } /* check if the next not void item is END */ act = next_no_void_action(actions, act); @@ -1169,8 +1176,10 @@ ixgbe_parse_l2_tn_filter(struct rte_eth_dev *dev, { int ret = 0; struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); + struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); + uint16_t vf_num; - ret = cons_parse_l2_tn_filter(attr, pattern, + ret = cons_parse_l2_tn_filter(dev, attr, pattern, actions, l2_tn_filter, error); if (hw->mac.type != ixgbe_mac_X550 && @@ -1183,7 +1192,9 @@ ixgbe_parse_l2_tn_filter(struct rte_eth_dev *dev, return -rte_errno; } - if (l2_tn_filter->pool >= dev->data->nb_rx_queues) + vf_num = pci_dev->max_vfs; + + if (l2_tn_filter->pool > vf_num) return -rte_errno; return ret; -- 2.7.4