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 C04105A65 for ; Mon, 15 Jun 2015 03:25:31 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 14 Jun 2015 18:25:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,615,1427785200"; d="scan'208";a="710911850" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga001.jf.intel.com with ESMTP; 14 Jun 2015 18:25:30 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t5F1PSSt008790; Mon, 15 Jun 2015 09:25:28 +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 t5F1PPnE031282; Mon, 15 Jun 2015 09:25:27 +0800 Received: (from heshaope@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t5F1PPiX031278; Mon, 15 Jun 2015 09:25:25 +0800 From: Shaopeng He To: dev@dpdk.org Date: Mon, 15 Jun 2015 09:23:59 +0800 Message-Id: <1434331439-31223-4-git-send-email-shaopeng.he@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1434331439-31223-1-git-send-email-shaopeng.he@intel.com> References: <1433213937-21690-1-git-send-email-shaopeng.he@intel.com> <1434331439-31223-1-git-send-email-shaopeng.he@intel.com> Cc: Shaopeng He Subject: [dpdk-dev] [PATCH v2 3/3] fm10k: update VLAN offload features 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: Mon, 15 Jun 2015 01:25:32 -0000 Fm10k PF/VF does not support QinQ; VLAN strip and filter are always on for PF/VF ports. Signed-off-by: Shaopeng He --- drivers/net/fm10k/fm10k_ethdev.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index 5f962d2..802a930 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -787,10 +787,12 @@ fm10k_dev_infos_get(struct rte_eth_dev *dev, dev_info->max_vfs = FM10K_MAX_VF_NUM; dev_info->max_vmdq_pools = ETH_64_POOLS; dev_info->rx_offload_capa = + DEV_RX_OFFLOAD_VLAN_STRIP | DEV_RX_OFFLOAD_IPV4_CKSUM | DEV_RX_OFFLOAD_UDP_CKSUM | DEV_RX_OFFLOAD_TCP_CKSUM; - dev_info->tx_offload_capa = 0; + dev_info->tx_offload_capa = + DEV_TX_OFFLOAD_VLAN_INSERT; dev_info->reta_size = FM10K_MAX_RSS_INDICES; dev_info->default_rxconf = (struct rte_eth_rxconf) { @@ -892,6 +894,27 @@ fm10k_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) return 0; } +static void +fm10k_vlan_offload_set(__rte_unused struct rte_eth_dev *dev, int mask) +{ + if (mask & ETH_VLAN_STRIP_MASK) { + if (!dev->data->dev_conf.rxmode.hw_vlan_strip) + PMD_INIT_LOG(ERR, "VLAN stripping is " + "always on in fm10k"); + } + + if (mask & ETH_VLAN_EXTEND_MASK) { + if (dev->data->dev_conf.rxmode.hw_vlan_extend) + PMD_INIT_LOG(ERR, "VLAN QinQ is not " + "supported in fm10k"); + } + + if (mask & ETH_VLAN_FILTER_MASK) { + if (!dev->data->dev_conf.rxmode.hw_vlan_filter) + PMD_INIT_LOG(ERR, "VLAN filter is always on in fm10k"); + } +} + /* Add/Remove a MAC address, and update filters */ static void fm10k_MAC_filter_set(struct rte_eth_dev *dev, const u8 *mac, bool add) @@ -1810,6 +1833,7 @@ static const struct eth_dev_ops fm10k_eth_dev_ops = { .link_update = fm10k_link_update, .dev_infos_get = fm10k_dev_infos_get, .vlan_filter_set = fm10k_vlan_filter_set, + .vlan_offload_set = fm10k_vlan_offload_set, .mac_addr_add = fm10k_macaddr_add, .mac_addr_remove = fm10k_macaddr_remove, .rx_queue_start = fm10k_dev_rx_queue_start, -- 1.9.3