bluetooth: use eth_hw_addr_set()
Subsystems (2)
PATCH 1/2 bluetooth: use eth_hw_addr_set()
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 got through appropriate helpers.
Convert bluetooth from memcpy(... ETH_ADDR) to eth_hw_addr_set():
@@
expression dev, np;
@@
- memcpy(dev->dev_addr, np, ETH_ALEN)
+ eth_hw_addr_set(dev, np)
--- net/bluetooth/bnep/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/bnep/core.c +1 -1
@@ -594,7 +594,7 @@ int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock)* ie. eh.h_dest is our local address. */ memcpy (s->eh.h_dest, &src,ETH_ALEN );memcpy (s->eh.h_source, &dst,ETH_ALEN ); -memcpy (dev->dev_addr, s->eh.h_dest,ETH_ALEN ); +eth_hw_addr_set (dev, s->eh.h_dest); s->dev = dev; s->sock = sock;
Signature · 1 line
2.31.1
PATCH 2/2 bluetooth: use dev_addr_set()
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 got through appropriate helpers.
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
--- net/bluetooth/6lowpan.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/bluetooth/6lowpan.c +3 -1
@@ -663,6 +663,7 @@ static struct l2cap_chan *add_peer_chan(struct l2cap_chan *chan,static int setup_netdev (struct l2cap_chan *chan,struct lowpan_btle_dev **dev) {struct net_device *netdev; +bdaddr_t addr;int err; netdev = alloc_netdev(LOWPAN_PRIV_SIZE(sizeof(struct lowpan_btle_dev)),
@@ -672,7 +673,8 @@ static int setup_netdev(struct l2cap_chan *chan, struct lowpan_btle_dev **dev)return -ENOMEM ; netdev->addr_assign_type =NET_ADDR_PERM ; -baswap ((void *)netdev->dev_addr, &chan->src); +baswap (&addr, &chan->src); +__dev_addr_set (netdev, &addr,sizeof (addr)); netdev->netdev_ops = &netdev_ops;SET_NETDEV_DEV (netdev, &chan->conn->hcon->hdev->dev);
Signature · 1 line
2.31.1
Re: [PATCH 2/2] bluetooth: use dev_addr_set()
Hi Jakub,
Quoted 6 lines
Commit
406f42fa0d3c("net-next: When a bond have a massive amount of VLANs...") introduced a rbtree for faster Ethernet address look up. To maintainnetdev->dev_addrin this tree we need to make all the writes to it got through appropriate helpers.Signed-off-by Jakub Kicinski <[email protected]>
Quoted 8 lines
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
---net/bluetooth/6lowpan.c| 4 +++-1 file changed, 3 insertions(+), 1 deletion(-)
please also take this directly via net-next.
Regards
Marcel
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 7 lines · On Tue, 19 Oct 2021 10:29:08 -0700 (PDT) [email protected] wrote:
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=566505
Eish, sorry, you need 40af35fdf79c ("netdevice: demote the type of some dev_addr_set() helpers") from net-next for this change to build cleanly.
What are your plans on sending a PR for net-next? Probably easiest if I resend this after such PR? Or apply directly to net-next.
Hi Jakub,
Quoted 9 lines
Quoted 3 lines
Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=566505Eish, sorry, you need
40af35fdf79c("netdevice: demote the type of somedev_addr_set()helpers") from net-next for this change to build cleanly.What are your plans on sending a PR for net-next? Probably easiest if I resend this after such PR? Or apply directly to net-next.
we have one more pull request for you in the works, but I was not planning to rebase bluetooth-next if not needed. So just go ahead and take the patch directly into net-next.
Regards
Marcel
Quoted 10 lines · On Tue, 19 Oct 2021 20:26:39 +0200 Marcel Holtmann wrote:
Quoted 9 lines
Quoted 3 lines
Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=566505Eish, sorry, you need
40af35fdf79c("netdevice: demote the type of somedev_addr_set()helpers") from net-next for this change to build cleanly.What are your plans on sending a PR for net-next? Probably easiest if I resend this after such PR? Or apply directly to net-next.
Quoted 6 lines
we have one more pull request for you in the works, but I was not planning to rebase bluetooth-next if not needed. So just go ahead and take the patch directly into net-next.
Reviewed-by Marcel Holtmann <[email protected]>Acked-by Marcel Holtmann <[email protected]>
Will do, thanks!