mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Jijie Shao <shaojijie@huawei.com>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, shenjian15@huawei.com,
	wangpeiyang1@huawei.com, liuyonglong@huawei.com,
	chenhao418@huawei.com, sudongming1@huawei.com,
	xujunsheng@huawei.com, shiyongbang@huawei.com,
	libaihan@huawei.com, jdamato@fastly.com, horms@kernel.org,
	kalesh-anakkur.purayil@broadcom.com, jonathan.cameron@huawei.com,
	shameerali.kolothum.thodi@huawei.com, salil.mehta@huawei.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V9 net-next 05/11] net: hibmcge: Implement some .ndo functions
Date: Tue, 10 Sep 2024 14:34:12 +0200	[thread overview]
Message-ID: <a863646c-adc0-4d16-aad3-158702dfef45@lunn.ch> (raw)
In-Reply-To: <20240910075942.1270054-6-shaojijie@huawei.com>

On Tue, Sep 10, 2024 at 03:59:36PM +0800, Jijie Shao wrote:
> Implement the .ndo_open() .ndo_stop() .ndo_set_mac_address()
> .ndo_change_mtu functions() and ndo.get_stats64()
> And .ndo_validate_addr calls the eth_validate_addr function directly
> 
> Signed-off-by: Jijie Shao <shaojijie@huawei.com>
> ---
> ChangeLog:
> v8 -> v9:
>   - Remove HBG_NIC_STATE_OPEN in ndo.open() and ndo.stop(),
>     suggested by Kalesh and Andrew.
>   - Use netif_running() instead of hbg_nic_is_open() in ndo.change_mtu(),
>     suggested by Kalesh and Andrew
>   v8: https://lore.kernel.org/all/20240909023141.3234567-1-shaojijie@huawei.com/
> v6 -> v7:
>   - Add implement ndo.get_stats64(), suggested by Paolo.
>   v6: https://lore.kernel.org/all/20240830121604.2250904-6-shaojijie@huawei.com/
> v5 -> v6:
>   - Delete netif_carrier_off() in .ndo_open() and .ndo_stop(),
>     suggested by Jakub and Andrew.
>  v5: https://lore.kernel.org/all/20240827131455.2919051-1-shaojijie@huawei.com/
> v3 -> v4:
>   - Delete INITED_STATE in priv, suggested by Andrew.
>   - Delete unnecessary defensive code in hbg_phy_start()
>     and hbg_phy_stop(), suggested by Andrew.
>   v3: https://lore.kernel.org/all/20240822093334.1687011-1-shaojijie@huawei.com/
> RFC v1 -> RFC v2:
>   - Delete validation for mtu in hbg_net_change_mtu(), suggested by Andrew.
>   - Delete validation for mac address in hbg_net_set_mac_address(),
>     suggested by Andrew.
>   - Add a patch to add is_valid_ether_addr check in dev_set_mac_address,
>     suggested by Andrew.
>   RFC v1: https://lore.kernel.org/all/20240731094245.1967834-1-shaojijie@huawei.com/
> ---
>  .../net/ethernet/hisilicon/hibmcge/hbg_hw.c   | 39 ++++++++
>  .../net/ethernet/hisilicon/hibmcge/hbg_hw.h   |  3 +
>  .../net/ethernet/hisilicon/hibmcge/hbg_main.c | 97 +++++++++++++++++++
>  .../net/ethernet/hisilicon/hibmcge/hbg_reg.h  | 11 ++-
>  4 files changed, 149 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/hisilicon/hibmcge/hbg_hw.c b/drivers/net/ethernet/hisilicon/hibmcge/hbg_hw.c
> index 8e971e9f62a0..97fee714155a 100644
> --- a/drivers/net/ethernet/hisilicon/hibmcge/hbg_hw.c
> +++ b/drivers/net/ethernet/hisilicon/hibmcge/hbg_hw.c
> @@ -15,6 +15,7 @@
>   * ctrl means packet description, data means skb packet data
>   */
>  #define HBG_ENDIAN_CTRL_LE_DATA_BE	0x0
> +#define HBG_PCU_FRAME_LEN_PLUS 4
>  
>  static bool hbg_hw_spec_is_valid(struct hbg_priv *priv)
>  {
> @@ -129,6 +130,44 @@ void hbg_hw_irq_enable(struct hbg_priv *priv, u32 mask, bool enable)
>  	hbg_reg_write(priv, HBG_REG_CF_INTRPT_MSK_ADDR, value);
>  }
>  
> +void hbg_hw_set_uc_addr(struct hbg_priv *priv, u64 mac_addr)
> +{
> +	hbg_reg_write64(priv, HBG_REG_STATION_ADDR_LOW_2_ADDR, mac_addr);
> +}
> +
> @@ -88,6 +181,10 @@ static int hbg_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>  	if (ret)
>  		return ret;
>  
> +	netdev->max_mtu = priv->dev_specs.max_mtu;
> +	netdev->min_mtu = priv->dev_specs.min_mtu;
> +	hbg_change_mtu(priv, HBG_DEFAULT_MTU_SIZE);

It does not help that you added added HBG_DEFAULT_MTU_SIZE in a
previous patch, but as far as i see, it is just ETH_DATA_LEN.

Please use the standard defines, rather than adding your own. It makes
the code a lot easier to understand, it is not using some special
jumbo size by default, it is just the plain, boring, normal 1500
bytes.

    Andrew

---
pw-bot: cr

  parent reply	other threads:[~2024-09-10 12:34 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-10  7:59 [PATCH V9 net-next 00/11] Add support of HIBMCGE Ethernet Driver Jijie Shao
2024-09-10  7:59 ` [PATCH V9 net-next 01/11] net: hibmcge: Add pci table supported in this module Jijie Shao
2024-09-10  7:59 ` [PATCH V9 net-next 02/11] net: hibmcge: Add read/write registers supported through the bar space Jijie Shao
2024-09-10  7:59 ` [PATCH V9 net-next 03/11] net: hibmcge: Add mdio and hardware configuration supported in this module Jijie Shao
2024-09-10 12:21   ` Andrew Lunn
2024-09-10 13:54     ` Jijie Shao
2024-09-10  7:59 ` [PATCH V9 net-next 04/11] net: hibmcge: Add interrupt " Jijie Shao
2024-09-10  7:59 ` [PATCH V9 net-next 05/11] net: hibmcge: Implement some .ndo functions Jijie Shao
2024-09-10  8:20   ` Kalesh Anakkur Purayil
2024-09-10 12:14     ` Andrew Lunn
2024-09-10 12:20       ` Kalesh Anakkur Purayil
2024-09-10 12:34   ` Andrew Lunn [this message]
2024-09-10 13:58     ` Jijie Shao
2024-09-10  7:59 ` [PATCH V9 net-next 06/11] net: hibmcge: Implement .ndo_start_xmit function Jijie Shao
2024-09-10  7:59 ` [PATCH V9 net-next 07/11] net: hibmcge: Implement rx_poll function to receive packets Jijie Shao
2024-09-10  7:59 ` [PATCH V9 net-next 08/11] net: hibmcge: Implement some ethtool_ops functions Jijie Shao
2024-09-10  8:41   ` Kalesh Anakkur Purayil
2024-09-10  7:59 ` [PATCH V9 net-next 09/11] net: hibmcge: Add a Makefile and update Kconfig for hibmcge Jijie Shao
2024-09-10  7:59 ` [PATCH V9 net-next 10/11] net: hibmcge: Add maintainer " Jijie Shao
2024-09-10  7:59 ` [PATCH V9 net-next 11/11] net: add ndo_validate_addr check in dev_set_mac_address Jijie Shao
2024-09-10  8:39   ` Kalesh Anakkur Purayil
2024-09-10 14:01     ` Jijie Shao
2024-09-11 13:30     ` Jijie Shao
2024-09-11 14:41       ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a863646c-adc0-4d16-aad3-158702dfef45@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=chenhao418@huawei.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jdamato@fastly.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=kalesh-anakkur.purayil@broadcom.com \
    --cc=kuba@kernel.org \
    --cc=libaihan@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuyonglong@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=salil.mehta@huawei.com \
    --cc=shameerali.kolothum.thodi@huawei.com \
    --cc=shaojijie@huawei.com \
    --cc=shenjian15@huawei.com \
    --cc=shiyongbang@huawei.com \
    --cc=sudongming1@huawei.com \
    --cc=wangpeiyang1@huawei.com \
    --cc=xujunsheng@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®