* [net-next PATCH] net/ncsi: Send device address as source address
@ 2020-01-07 19:30 Vijay Khemka
2020-01-08 21:09 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Vijay Khemka @ 2020-01-07 19:30 UTC (permalink / raw)
To: Samuel Mendoza-Jonas, David S. Miller, netdev, linux-kernel
Cc: vijaykhemka, joel, linux-aspeed, sdasari
After receiving device mac address from device, send this as
a source address for further commands instead of broadcast
address.
This will help in multi host NIC cards.
Signed-off-by: Vijay Khemka <vijaykhemka@fb.com>
---
net/ncsi/ncsi-cmd.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/net/ncsi/ncsi-cmd.c b/net/ncsi/ncsi-cmd.c
index 0187e65176c0..ba9ae482141b 100644
--- a/net/ncsi/ncsi-cmd.c
+++ b/net/ncsi/ncsi-cmd.c
@@ -369,7 +369,15 @@ int ncsi_xmit_cmd(struct ncsi_cmd_arg *nca)
eh = skb_push(nr->cmd, sizeof(*eh));
eh->h_proto = htons(ETH_P_NCSI);
eth_broadcast_addr(eh->h_dest);
- eth_broadcast_addr(eh->h_source);
+
+ /* If mac address received from device then use it for
+ * source address as unicast address else use broadcast
+ * address as source address
+ */
+ if (nca->ndp->gma_flag == 1)
+ memcpy(eh->h_source, nca->ndp->ndev.dev->dev_addr, ETH_ALEN);
+ else
+ eth_broadcast_addr(eh->h_source);
/* Start the timer for the request that might not have
* corresponding response. Given NCSI is an internal
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [net-next PATCH] net/ncsi: Send device address as source address
2020-01-07 19:30 [net-next PATCH] net/ncsi: Send device address as source address Vijay Khemka
@ 2020-01-08 21:09 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-01-08 21:09 UTC (permalink / raw)
To: vijaykhemka; +Cc: sam, netdev, linux-kernel, joel, linux-aspeed, sdasari
From: Vijay Khemka <vijaykhemka@fb.com>
Date: Tue, 7 Jan 2020 11:30:33 -0800
> After receiving device mac address from device, send this as
> a source address for further commands instead of broadcast
> address.
>
> This will help in multi host NIC cards.
>
> Signed-off-by: Vijay Khemka <vijaykhemka@fb.com>
Applied to net-next, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-01-08 21:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-07 19:30 [net-next PATCH] net/ncsi: Send device address as source address Vijay Khemka
2020-01-08 21:09 ` David Miller
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).