From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id B5084B6E4 for ; Thu, 19 Feb 2015 17:15:09 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 19 Feb 2015 08:14:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,609,1418112000"; d="scan'208";a="654411692" Received: from unknown (HELO Sent) ([10.217.248.233]) by orsmga001.jf.intel.com with SMTP; 19 Feb 2015 08:14:06 -0800 Received: by Sent (sSMTP sendmail emulation); Thu, 19 Feb 2015 17:14:58 +0100 From: Pawel Wodkowski To: dev@dpdk.org Date: Thu, 19 Feb 2015 16:54:49 +0100 Message-Id: <1424361289-30718-8-git-send-email-pawelx.wodkowski@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1424361289-30718-1-git-send-email-pawelx.wodkowski@intel.com> References: <1421672551-11652-1-git-send-email-pawelx.wodkowski@intel.com> <1424361289-30718-1-git-send-email-pawelx.wodkowski@intel.com> Subject: [dpdk-dev] [PATCH v4 7/7] pmd ixgbe: fix vlan setting in in PF 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: , X-List-Received-Date: Thu, 19 Feb 2015 16:15:10 -0000 The ixgbe_vlan_filter_set() should use hw->mac.ops.set_vfta() to set VLAN filtering as this is generic function that handles both non-SRIOV and SRIOV cases. Bug was discovered issuing command in testpmd 'rx_vlan add VLAN PORT' for PF. Requested VLAN was enabled but pool mask is not set. Only command 'rx_vlan add VLAN port PORT vf MASK' can enable pointed VLAN id for PF. Signed-off-by: Pawel Wodkowski --- lib/librte_pmd_ixgbe/ixgbe_ethdev.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c index 7551bcc..7aef0e8 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c +++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c @@ -1162,21 +1162,18 @@ ixgbe_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct ixgbe_vfta * shadow_vfta = IXGBE_DEV_PRIVATE_TO_VFTA(dev->data->dev_private); - uint32_t vfta; + struct rte_eth_dev_sriov *sriov = &RTE_ETH_DEV_SRIOV(dev); + u32 vind = sriov->active ? sriov->def_vmdq_idx : 0; + s32 ret_val; uint32_t vid_idx; - uint32_t vid_bit; - vid_idx = (uint32_t) ((vlan_id >> 5) & 0x7F); - vid_bit = (uint32_t) (1 << (vlan_id & 0x1F)); - vfta = IXGBE_READ_REG(hw, IXGBE_VFTA(vid_idx)); - if (on) - vfta |= vid_bit; - else - vfta &= ~vid_bit; - IXGBE_WRITE_REG(hw, IXGBE_VFTA(vid_idx), vfta); + ret_val = hw->mac.ops.set_vfta(hw, vlan_id, vind, on); + if (ret_val != IXGBE_SUCCESS) + return ret_val; + vid_idx = (uint32_t) ((vlan_id >> 5) & 0x7F); /* update local VFTA copy */ - shadow_vfta->vfta[vid_idx] = vfta; + shadow_vfta->vfta[vid_idx] = IXGBE_READ_REG(hw, IXGBE_VFTA(vid_idx)); return 0; } -- 1.9.1