From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
doshir@vmware.com, pv-drivers@vmware.com
Subject: [PATCH net-next v2 7/8] net: drivers: get ready for const netdev->dev_addr
Date: Fri, 22 Oct 2021 16:21:02 -0700 [thread overview]
Message-ID: <20211022232103.2715312-8-kuba@kernel.org> (raw)
In-Reply-To: <20211022232103.2715312-1-kuba@kernel.org>
Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it go through appropriate helpers. We will make
netdev->dev_addr a const.
Make sure local references to netdev->dev_addr are constant.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: doshir@vmware.com
CC: pv-drivers@vmware.com
---
drivers/net/macsec.c | 2 +-
drivers/net/macvlan.c | 3 ++-
drivers/net/vmxnet3/vmxnet3_drv.c | 4 ++--
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c
index 18b6dba9394e..16aa3a478e9e 100644
--- a/drivers/net/macsec.c
+++ b/drivers/net/macsec.c
@@ -250,7 +250,7 @@ static bool send_sci(const struct macsec_secy *secy)
(secy->n_rx_sc > 1 && !tx_sc->end_station && !tx_sc->scb);
}
-static sci_t make_sci(u8 *addr, __be16 port)
+static sci_t make_sci(const u8 *addr, __be16 port)
{
sci_t sci;
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 6189acb33973..d2f830ec2969 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -698,7 +698,8 @@ static int macvlan_stop(struct net_device *dev)
return 0;
}
-static int macvlan_sync_address(struct net_device *dev, unsigned char *addr)
+static int macvlan_sync_address(struct net_device *dev,
+ const unsigned char *addr)
{
struct macvlan_dev *vlan = netdev_priv(dev);
struct net_device *lowerdev = vlan->lowerdev;
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index 7a205ddf0060..3e1b7746cce4 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -46,7 +46,7 @@ MODULE_DEVICE_TABLE(pci, vmxnet3_pciid_table);
static int enable_mq = 1;
static void
-vmxnet3_write_mac_addr(struct vmxnet3_adapter *adapter, u8 *mac);
+vmxnet3_write_mac_addr(struct vmxnet3_adapter *adapter, const u8 *mac);
/*
* Enable/Disable the given intr
@@ -2806,7 +2806,7 @@ vmxnet3_quiesce_dev(struct vmxnet3_adapter *adapter)
static void
-vmxnet3_write_mac_addr(struct vmxnet3_adapter *adapter, u8 *mac)
+vmxnet3_write_mac_addr(struct vmxnet3_adapter *adapter, const u8 *mac)
{
u32 tmp;
--
2.31.1
next prev parent reply other threads:[~2021-10-22 23:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-22 23:20 [PATCH net-next v2 0/8] don't write directly to netdev->dev_addr Jakub Kicinski
2021-10-22 23:20 ` [PATCH net-next v2 1/8] net: core: constify mac addrs in selftests Jakub Kicinski
2021-10-22 23:20 ` [PATCH net-next v2 2/8] net: rtnetlink: use __dev_addr_set() Jakub Kicinski
2021-10-22 23:20 ` [PATCH net-next v2 3/8] net: phy: constify netdev->dev_addr references Jakub Kicinski
2021-10-22 23:20 ` [PATCH net-next v2 4/8] net: bonding: constify and use dev_addr_set() Jakub Kicinski
2021-10-22 23:21 ` [PATCH net-next v2 5/8] net: hsr: get ready for const netdev->dev_addr Jakub Kicinski
2021-10-22 23:21 ` [PATCH net-next v2 6/8] net: caif: " Jakub Kicinski
2021-10-22 23:21 ` Jakub Kicinski [this message]
2021-10-22 23:21 ` [PATCH net-next v2 8/8] net: atm: use address setting helpers Jakub Kicinski
2021-10-25 12:10 ` [PATCH net-next v2 0/8] don't write directly to netdev->dev_addr patchwork-bot+netdevbpf
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=20211022232103.2715312-8-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=doshir@vmware.com \
--cc=netdev@vger.kernel.org \
--cc=pv-drivers@vmware.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;
as well as URLs for NNTP newsgroup(s).