From patchwork Fri Apr 14 10:48:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mengyuan Lou X-Patchwork-Id: 13211257 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42FCEC77B76 for ; Fri, 14 Apr 2023 10:49:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230213AbjDNKtj (ORCPT ); Fri, 14 Apr 2023 06:49:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229636AbjDNKtc (ORCPT ); Fri, 14 Apr 2023 06:49:32 -0400 Received: from smtpbguseast1.qq.com (smtpbguseast1.qq.com [54.204.34.129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 698D09010 for ; Fri, 14 Apr 2023 03:49:17 -0700 (PDT) X-QQ-mid: bizesmtp74t1681469343trfgp513 Received: from localhost.localdomain ( [183.129.236.74]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 14 Apr 2023 18:49:02 +0800 (CST) X-QQ-SSF: 01400000000000N0R000000A0000000 X-QQ-FEAT: iDzLjIm7mlYXNWdwGP1FstgpZqZBYL0ylMhv7MLvn+wBeYZFEsdEmootHLeH2 Wbg/bZy4Qusu87HRQAXoa0eOEM/Y+6hkPCOttL6JrJ56Jc9cDchHa358HtYg4yKcs7hREUc rOev0M+xSeEVTmiDgZhvYXhjKkjUWvX3BFLEh+c7UF2wY/HAh35ErhJkLKtV2jd9ld6EFRJ DaH7Xx+4iLW/TCyfJiljCnlmqOxreuq2yzBHidN+SXMDhtH0En7LrfAVE9w+dS+HtJmMtbn 1C1q/KIR3xkrWKIsYRm64uXRRamBHAj8X3Zt+LLytyfj4SRc8e6d6M0TyiPwTKfMlDOPNsf wvg4YvAzf8Ka2sHm2hcjET5trFAFj+1kgucW1yizp8NmoYxHXMwU3XZZUWd3LXh0txLLXBc 8Jug5kZcOux2rHuNaB/97tNlKXG6wsUS X-QQ-GoodBg: 2 X-BIZMAIL-ID: 10901563166072606592 From: Mengyuan Lou To: netdev@vger.kernel.org Cc: jiawenwu@trustnetic.com, Mengyuan Lou Subject: [PATCH net-next 5/5] net: wangxun: txgbe add netdev features support Date: Fri, 14 Apr 2023 18:48:33 +0800 Message-Id: <20230414104833.42989-6-mengyuanlou@net-swift.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230414104833.42989-1-mengyuanlou@net-swift.com> References: <20230414104833.42989-1-mengyuanlou@net-swift.com> MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:net-swift.com:qybglogicsvrgz:qybglogicsvrgz6a-1 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org txgbe add ndo_vlan_rx_add_vid and ndo_vlan_rx_kill_vid. Add features and hw_features that ngbe can support. Signed-off-by: Mengyuan Lou --- .../net/ethernet/wangxun/txgbe/txgbe_main.c | 24 ++++++++++++++++--- .../net/ethernet/wangxun/txgbe/txgbe_type.h | 1 + 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c index 5b8a121fb496..81b511dac94c 100644 --- a/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c +++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c @@ -258,6 +258,7 @@ static void txgbe_reset(struct wx *wx) if (err != 0) wx_err(wx, "Hardware Error: %d\n", err); + wx_start_hw(wx); /* do not flush user set addresses */ memcpy(old_addr, &wx->mac_table[0].addr, netdev->addr_len); wx_flush_sw_mac_table(wx); @@ -330,6 +331,7 @@ static int txgbe_sw_init(struct wx *wx) wx->mac.max_tx_queues = TXGBE_SP_MAX_TX_QUEUES; wx->mac.max_rx_queues = TXGBE_SP_MAX_RX_QUEUES; wx->mac.mcft_size = TXGBE_SP_MC_TBL_SIZE; + wx->mac.vft_size = TXGBE_SP_VFT_TBL_SIZE; wx->mac.rx_pb_size = TXGBE_SP_RX_PB_SIZE; wx->mac.tx_pb_size = TXGBE_SP_TDB_PB_SZ; @@ -494,6 +496,8 @@ static const struct net_device_ops txgbe_netdev_ops = { .ndo_validate_addr = eth_validate_addr, .ndo_set_mac_address = wx_set_mac, .ndo_get_stats64 = wx_get_stats64, + .ndo_vlan_rx_add_vid = wx_vlan_rx_add_vid, + .ndo_vlan_rx_kill_vid = wx_vlan_rx_kill_vid, }; /** @@ -596,11 +600,25 @@ static int txgbe_probe(struct pci_dev *pdev, goto err_free_mac_table; } - netdev->features |= NETIF_F_HIGHDMA; - netdev->features = NETIF_F_SG; - + netdev->features = NETIF_F_SG | + NETIF_F_TSO | + NETIF_F_TSO6 | + NETIF_F_RXHASH | + NETIF_F_RXCSUM | + NETIF_F_HW_CSUM; + + netdev->gso_partial_features = NETIF_F_GSO_ENCAP_ALL; + netdev->features |= netdev->gso_partial_features; + netdev->features |= NETIF_F_SCTP_CRC; + netdev->vlan_features |= netdev->features | NETIF_F_TSO_MANGLEID; + netdev->hw_enc_features |= netdev->vlan_features; + netdev->features |= NETIF_F_VLAN_FEATURES; /* copy netdev features into list of user selectable features */ netdev->hw_features |= netdev->features | NETIF_F_RXALL; + netdev->hw_features |= NETIF_F_NTUPLE | NETIF_F_HW_TC; + netdev->features |= NETIF_F_HIGHDMA; + netdev->hw_features |= NETIF_F_LRO | NETIF_F_GRO; + netdev->features |= NETIF_F_LRO | NETIF_F_GRO; netdev->priv_flags |= IFF_UNICAST_FLT; netdev->priv_flags |= IFF_SUPP_NOFCS; diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_type.h b/drivers/net/ethernet/wangxun/txgbe/txgbe_type.h index 63a1c733718d..032972369965 100644 --- a/drivers/net/ethernet/wangxun/txgbe/txgbe_type.h +++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_type.h @@ -77,6 +77,7 @@ #define TXGBE_SP_MAX_RX_QUEUES 128 #define TXGBE_SP_RAR_ENTRIES 128 #define TXGBE_SP_MC_TBL_SIZE 128 +#define TXGBE_SP_VFT_TBL_SIZE 128 #define TXGBE_SP_RX_PB_SIZE 512 #define TXGBE_SP_TDB_PB_SZ (160 * 1024) /* 160KB Packet Buffer */