From patchwork Fri May 26 09:02:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mengyuan Lou X-Patchwork-Id: 13256616 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3BB5310967 for ; Fri, 26 May 2023 09:03:09 +0000 (UTC) Received: from smtpbgsg2.qq.com (smtpbgsg2.qq.com [54.254.200.128]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1959712C for ; Fri, 26 May 2023 02:03:06 -0700 (PDT) X-QQ-mid: bizesmtp89t1685091781t2172a2x Received: from localhost.localdomain ( [125.120.148.168]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 26 May 2023 17:02:59 +0800 (CST) X-QQ-SSF: 01400000000000N0Z000000A0000000 X-QQ-FEAT: 7jw2iSiCazpO9lRC5CWx9LP/Zy/DFXjElKHk2pbNcPp3w6J+nmhllL2UrKBG3 UB4zrhtmgK+wVEoagHf9H23/YB45pAYKVTwd23OS4E4n3SFb8f0DSf24EdxENFR+5jmVHLW PAXA3VpDr+6+H8V33CGD3uXgIqQ7P5Z3OK0BaR1I2jBUO3N1h2PB68LtUSTDuA8IfCDTqdw 2NkPo/O6+tANxWQ1HQWkaLRwJeuU7rm1TBQyur+Isfpol/boS+d9x05zWNJAu9SV+HkMsEG vq+m6bSPOPZ8xSZFO3FXFunKJImCy3Fup+zRmFsFbRqOcKDS36DW30okVf5X99h5jbZRbXO TfUXSkAUTHHVI5aTWPtILo3hfDuMyH7fjqa7nQm4l++lECYSW9+iADR1iWwtkSc4ga8vhaa XCzmGlcH3d9JUIuxhQ2CtA== X-QQ-GoodBg: 2 X-BIZMAIL-ID: 14990435723325613460 From: Mengyuan Lou To: netdev@vger.kernel.org Cc: jiawenwu@trustnetic.com, Mengyuan Lou Subject: [PATCH net-next v7 5/8] net: ngbe: Add netdev features support Date: Fri, 26 May 2023 17:02:27 +0800 Message-Id: <20230526090230.71487-6-mengyuanlou@net-swift.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230526090230.71487-1-mengyuanlou@net-swift.com> References: <20230526090230.71487-1-mengyuanlou@net-swift.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:net-swift.com:qybglogicsvrgz:qybglogicsvrgz5a-3 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org Add features and hw_features that ngbe can support. Signed-off-by: Mengyuan Lou --- drivers/net/ethernet/wangxun/ngbe/ngbe_main.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c b/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c index df6b870aa871..f234c9c4b942 100644 --- a/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c +++ b/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c @@ -473,6 +473,7 @@ static const struct net_device_ops ngbe_netdev_ops = { .ndo_change_mtu = wx_change_mtu, .ndo_start_xmit = wx_xmit_frame, .ndo_set_rx_mode = wx_set_rx_mode, + .ndo_set_features = wx_set_features, .ndo_validate_addr = eth_validate_addr, .ndo_set_mac_address = wx_set_mac, .ndo_get_stats64 = wx_get_stats64, @@ -551,12 +552,18 @@ static int ngbe_probe(struct pci_dev *pdev, ngbe_set_ethtool_ops(netdev); netdev->netdev_ops = &ngbe_netdev_ops; - netdev->features |= NETIF_F_HIGHDMA; - netdev->features = NETIF_F_SG; - + netdev->features = NETIF_F_SG | NETIF_F_IP_CSUM | + NETIF_F_TSO | NETIF_F_TSO6 | + NETIF_F_RXHASH | NETIF_F_RXCSUM; + netdev->features |= NETIF_F_SCTP_CRC | NETIF_F_TSO_MANGLEID; + netdev->vlan_features |= netdev->features; + netdev->features |= NETIF_F_IPV6_CSUM | NETIF_F_VLAN_FEATURES; /* copy netdev features into list of user selectable features */ - netdev->hw_features |= netdev->features | - NETIF_F_RXALL; + 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_GRO; + netdev->features |= NETIF_F_GRO; netdev->priv_flags |= IFF_UNICAST_FLT; netdev->priv_flags |= IFF_SUPP_NOFCS;