Thread (24 messages) 24 messages, 3 authors, 2024-09-11

Re: [PATCH V9 net-next 05/11] net: hibmcge: Implement some .ndo functions

From: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@broadcom.com>
Date: 2024-09-10 12:20:33
Also in: lkml

On Tue, Sep 10, 2024 at 5:44 PM Andrew Lunn [off-list ref] wrote:
quoted
quoted
+static void hbg_change_mtu(struct hbg_priv *priv, int new_mtu)
+{
+       u32 frame_len;
+
+       frame_len = new_mtu + VLAN_HLEN * priv->dev_specs.vlan_layers +
+                   ETH_HLEN + ETH_FCS_LEN;
+       hbg_hw_set_mtu(priv, frame_len);
+}
+
+static int hbg_net_change_mtu(struct net_device *netdev, int new_mtu)
+{
+       struct hbg_priv *priv = netdev_priv(netdev);
+       bool is_running = netif_running(netdev);
+
+       if (is_running)
+               hbg_net_stop(netdev);
+
+       hbg_change_mtu(priv, new_mtu);
+       WRITE_ONCE(netdev->mtu, new_mtu);
[Kalesh] IMO the setting of "netdev->mtu" should be moved to the core
layer so that not all drivers have to do this.
__dev_set_mtu() can be modified to incorporate this. Just a thought.
Hi Kalesh

If you look at git history, the core has left the driver to set
dev->mtu since the beginning of the code being in git, and probably
longer. It seems a bit unfair to ask a developer to go modify over 200
drivers. Please feel free to submit 200 patches yourself.
Hi Andrew,

I did not ask Jijie to make this change. In fact, I had added my RB
tag and added this as a comment saying this comment has nothing to do
with his changes.
Sorry for the confusion.
         Andrew


-- 
Regards,
Kalesh A P

Attachments

  • smime.p7s [application/pkcs7-signature] 4239 bytes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help