linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] bluetooth: use eth_hw_addr_set()
@ 2021-10-19 16:33 Jakub Kicinski
  2021-10-19 16:33 ` [PATCH 2/2] bluetooth: use dev_addr_set() Jakub Kicinski
       [not found] ` <616f0064.1c69fb81.3a2d8.9416@mx.google.com>
  0 siblings, 2 replies; 6+ messages in thread
From: Jakub Kicinski @ 2021-10-19 16:33 UTC (permalink / raw)
  To: marcel, johan.hedberg, luiz.dentz; +Cc: linux-bluetooth, Jakub Kicinski

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)

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 net/bluetooth/bnep/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c
index 72f47b372705..c9add7753b9f 100644
--- a/net/bluetooth/bnep/core.c
+++ b/net/bluetooth/bnep/core.c
@@ -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;
-- 
2.31.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/2] bluetooth: use dev_addr_set()
  2021-10-19 16:33 [PATCH 1/2] bluetooth: use eth_hw_addr_set() Jakub Kicinski
@ 2021-10-19 16:33 ` Jakub Kicinski
  2021-10-19 18:27   ` Marcel Holtmann
       [not found] ` <616f0064.1c69fb81.3a2d8.9416@mx.google.com>
  1 sibling, 1 reply; 6+ messages in thread
From: Jakub Kicinski @ 2021-10-19 16:33 UTC (permalink / raw)
  To: marcel, johan.hedberg, luiz.dentz; +Cc: linux-bluetooth, Jakub Kicinski

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.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: marcel@holtmann.org
CC: johan.hedberg@gmail.com
CC: luiz.dentz@gmail.com
CC: linux-bluetooth@vger.kernel.org
---
 net/bluetooth/6lowpan.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index fd164a248569..133d7ea063fb 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -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);
-- 
2.31.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [1/2] bluetooth: use eth_hw_addr_set()
       [not found] ` <616f0064.1c69fb81.3a2d8.9416@mx.google.com>
@ 2021-10-19 18:05   ` Jakub Kicinski
  2021-10-19 18:26     ` Marcel Holtmann
  0 siblings, 1 reply; 6+ messages in thread
From: Jakub Kicinski @ 2021-10-19 18:05 UTC (permalink / raw)
  To: bluez.test.bot; +Cc: linux-bluetooth

On Tue, 19 Oct 2021 10:29:08 -0700 (PDT) bluez.test.bot@gmail.com 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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [1/2] bluetooth: use eth_hw_addr_set()
  2021-10-19 18:05   ` [1/2] bluetooth: use eth_hw_addr_set() Jakub Kicinski
@ 2021-10-19 18:26     ` Marcel Holtmann
  2021-10-19 19:02       ` Jakub Kicinski
  0 siblings, 1 reply; 6+ messages in thread
From: Marcel Holtmann @ 2021-10-19 18:26 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: bluez.test.bot, linux-bluetooth

Hi Jakub,

>> 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.

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 <marcel@holtmann.org>
Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] bluetooth: use dev_addr_set()
  2021-10-19 16:33 ` [PATCH 2/2] bluetooth: use dev_addr_set() Jakub Kicinski
@ 2021-10-19 18:27   ` Marcel Holtmann
  0 siblings, 0 replies; 6+ messages in thread
From: Marcel Holtmann @ 2021-10-19 18:27 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: Johan Hedberg, Luiz Augusto von Dentz, linux-bluetooth

Hi Jakub,

> 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.
> 
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> CC: marcel@holtmann.org
> CC: johan.hedberg@gmail.com
> CC: luiz.dentz@gmail.com
> CC: linux-bluetooth@vger.kernel.org
> ---
> net/bluetooth/6lowpan.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)

please also take this directly via net-next.

Acked-by: Marcel Holtmann <marcel@holtmann.org>
Reviewed-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [1/2] bluetooth: use eth_hw_addr_set()
  2021-10-19 18:26     ` Marcel Holtmann
@ 2021-10-19 19:02       ` Jakub Kicinski
  0 siblings, 0 replies; 6+ messages in thread
From: Jakub Kicinski @ 2021-10-19 19:02 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: bluez.test.bot, linux-bluetooth

On Tue, 19 Oct 2021 20:26:39 +0200 Marcel Holtmann wrote:
> >> 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.  
> 
> 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 <marcel@holtmann.org>
> Acked-by: Marcel Holtmann <marcel@holtmann.org>

Will do, thanks!

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-10-19 19:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-19 16:33 [PATCH 1/2] bluetooth: use eth_hw_addr_set() Jakub Kicinski
2021-10-19 16:33 ` [PATCH 2/2] bluetooth: use dev_addr_set() Jakub Kicinski
2021-10-19 18:27   ` Marcel Holtmann
     [not found] ` <616f0064.1c69fb81.3a2d8.9416@mx.google.com>
2021-10-19 18:05   ` [1/2] bluetooth: use eth_hw_addr_set() Jakub Kicinski
2021-10-19 18:26     ` Marcel Holtmann
2021-10-19 19:02       ` Jakub Kicinski

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).