From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 41CED8D8B for ; Thu, 4 Feb 2016 13:43:32 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP; 04 Feb 2016 04:43:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,395,1449561600"; d="scan'208";a="908395942" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga002.fm.intel.com with ESMTP; 04 Feb 2016 04:43:27 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id u14ChPS5029013; Thu, 4 Feb 2016 20:43:25 +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 u14ChNTw000725; Thu, 4 Feb 2016 20:43:25 +0800 Received: (from heshaope@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id u14ChNHl000721; Thu, 4 Feb 2016 20:43:23 +0800 From: Shaopeng He To: dev@dpdk.org Date: Thu, 4 Feb 2016 20:43:21 +0800 Message-Id: <1454589801-691-1-git-send-email-shaopeng.he@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH v2] fm10k: enable PCIe port level Loopback Suppression 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, 04 Feb 2016 12:43:32 -0000 In FM10K, a single PCIe port can derive out a few logical ports, like SRIOV PF/VF devices, VMDQ objects. To better manage them, FM10K silicon assigned a Unique GLORT ID to each logical ports. When a logical port sends a broadcast packet, the silicon will flood it to all Logical ports, including the one sent the broadcast packet. To prevent this, silicon has a rxq register to fill the glort id of the logical port that queue binds to. FM10K has a switch core inside, which has another loopback suppression mechanism in the switch level. Switch level loopback suppression mostly works for the ether port traffic. This patch assigns a SGLORT for each RX queue, and enables PCIe port level Loopback Suppression. Signed-off-by: Shaopeng He --- drivers/net/fm10k/fm10k_ethdev.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index f6eb05d..60f821a 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -690,12 +690,15 @@ static int fm10k_dev_rx_init(struct rte_eth_dev *dev) { struct fm10k_hw *hw = FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private); + struct fm10k_macvlan_filter_info *macvlan; int i, ret; struct fm10k_rx_queue *rxq; uint64_t base_addr; uint32_t size; uint32_t rxdctl = FM10K_RXDCTL_WRITE_BACK_MIN_DELAY; + uint32_t logic_port = hw->mac.dglort_map; uint16_t buf_size; + uint16_t queue_stride = 0; /* Disable RXINT to avoid possible interrupt */ for (i = 0; i < hw->mac.max_queues; i++) @@ -735,7 +738,8 @@ fm10k_dev_rx_init(struct rte_eth_dev *dev) buf_size -= FM10K_RX_DATABUF_ALIGN; FM10K_WRITE_REG(hw, FM10K_SRRCTL(i), - buf_size >> FM10K_SRRCTL_BSIZEPKT_SHIFT); + (buf_size >> FM10K_SRRCTL_BSIZEPKT_SHIFT) | + FM10K_SRRCTL_LOOPBACK_SUPPRESS); /* It adds dual VLAN length for supporting dual VLAN */ if ((dev->data->dev_conf.rxmode.max_rx_pkt_len + @@ -762,6 +766,18 @@ fm10k_dev_rx_init(struct rte_eth_dev *dev) /* Decide the best RX function */ fm10k_set_rx_function(dev); + /* update RX_SGLORT for loopback suppress*/ + if (hw->mac.type != fm10k_mac_pf) + return 0; + macvlan = FM10K_DEV_PRIVATE_TO_MACVLAN(dev->data->dev_private); + if (macvlan->nb_queue_pools) + queue_stride = dev->data->nb_rx_queues / macvlan->nb_queue_pools; + for (i = 0; i < dev->data->nb_rx_queues; ++i) { + if (i && queue_stride && !(i % queue_stride)) + logic_port++; + FM10K_WRITE_REG(hw, FM10K_RX_SGLORT(i), logic_port); + } + return 0; } -- 1.9.3