* [PATCH 1/1] RDMA/ionic: Preserve and set Ethernet source MAC after ib_ud_header_init()
@ 2026-02-27 6:18 Abhijit Gangurde
2026-03-02 19:42 ` Leon Romanovsky
0 siblings, 1 reply; 3+ messages in thread
From: Abhijit Gangurde @ 2026-02-27 6:18 UTC (permalink / raw)
To: jgg, leon
Cc: allen.hubbe, nikhil.agarwal, linux-rdma, linux-kernel, stable,
Abhijit Gangurde
ionic_build_hdr() populated the Ethernet source MAC (hdr->eth.smac_h) by
passing the header’s storage directly to rdma_read_gid_l2_fields().
However, ib_ud_header_init() is called after that and re-initializes the
UD header, which wipes the previously written smac_h. As a result, packets
are emitted with an zero source MAC address on the wire.
Correct the source MAC by reading the GID-derived smac into a temporary
buffer and copy it after ib_ud_header_init() completes.
Fixes: e8521822c733 ("RDMA/ionic: Register device ops for control path")
Cc: stable@vger.kernel.org # 6.18
Signed-off-by: Abhijit Gangurde <abhijit.gangurde@amd.com>
---
drivers/infiniband/hw/ionic/ionic_controlpath.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/ionic/ionic_controlpath.c b/drivers/infiniband/hw/ionic/ionic_controlpath.c
index ea12d9b8e125..84bc5f17a700 100644
--- a/drivers/infiniband/hw/ionic/ionic_controlpath.c
+++ b/drivers/infiniband/hw/ionic/ionic_controlpath.c
@@ -508,6 +508,7 @@ static int ionic_build_hdr(struct ionic_ibdev *dev,
{
const struct ib_global_route *grh;
enum rdma_network_type net;
+ u8 smac[ETH_ALEN];
u16 vlan;
int rc;
@@ -518,7 +519,7 @@ static int ionic_build_hdr(struct ionic_ibdev *dev,
grh = rdma_ah_read_grh(attr);
- rc = rdma_read_gid_l2_fields(grh->sgid_attr, &vlan, &hdr->eth.smac_h[0]);
+ rc = rdma_read_gid_l2_fields(grh->sgid_attr, &vlan, smac);
if (rc)
return rc;
@@ -536,6 +537,7 @@ static int ionic_build_hdr(struct ionic_ibdev *dev,
if (rc)
return rc;
+ ether_addr_copy(hdr->eth.smac_h, smac);
ether_addr_copy(hdr->eth.dmac_h, attr->roce.dmac);
if (net == RDMA_NETWORK_IPV4) {
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH 1/1] RDMA/ionic: Preserve and set Ethernet source MAC after ib_ud_header_init()
2026-02-27 6:18 [PATCH 1/1] RDMA/ionic: Preserve and set Ethernet source MAC after ib_ud_header_init() Abhijit Gangurde
@ 2026-03-02 19:42 ` Leon Romanovsky
0 siblings, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2026-03-02 19:42 UTC (permalink / raw)
To: jgg, Abhijit Gangurde
Cc: allen.hubbe, nikhil.agarwal, linux-rdma, linux-kernel, stable
On Fri, 27 Feb 2026 11:48:09 +0530, Abhijit Gangurde wrote:
> ionic_build_hdr() populated the Ethernet source MAC (hdr->eth.smac_h) by
> passing the header’s storage directly to rdma_read_gid_l2_fields().
> However, ib_ud_header_init() is called after that and re-initializes the
> UD header, which wipes the previously written smac_h. As a result, packets
> are emitted with an zero source MAC address on the wire.
>
> Correct the source MAC by reading the GID-derived smac into a temporary
> buffer and copy it after ib_ud_header_init() completes.
>
> [...]
Applied, thanks!
[1/1] RDMA/ionic: Preserve and set Ethernet source MAC after ib_ud_header_init()
https://git.kernel.org/rdma/rdma/c/cbbdb148c62814
Best regards,
--
Leon Romanovsky <leon@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v3 0/1] cdx: register shutdown callback for cdx controller
@ 2026-07-07 9:55 Abhijit Gangurde
2026-07-07 9:55 ` [PATCH 1/1] RDMA/ionic: Preserve and set Ethernet source MAC after ib_ud_header_init() Abhijit Gangurde
0 siblings, 1 reply; 3+ messages in thread
From: Abhijit Gangurde @ 2026-07-07 9:55 UTC (permalink / raw)
To: nipun.gupta, nikhil.agarwal
Cc: gregkh, linux-kernel, michal.simek, git, Abhijit Gangurde
This is a resubmission of the remaining patch from v2 series.
Patch 2/2 from v2 ("cdx: disable cdx bus from bus shutdown callback")
was already merged as commit 6d2478a103a8.
This patch registers the shutdown callback for the cdx controller
platform device to handle graceful connection closure of rpmsg
transport during system shutdown/reboot.
Changes v2->v3:
- Rebased on v7.2-rc1
- Dropped patch 2/2 (already merged)
Changes v1->v2:
- Split single patch into two (Greg KH)
- https://lore.kernel.org/all/20241203084409.2747897-1-abhijit.gangurde@amd.com/
Abhijit Gangurde (1):
cdx: register shutdown callback for cdx controller
drivers/cdx/controller/cdx_controller.c | 6 ++++++
1 file changed, 6 insertions(+)
base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH 1/1] RDMA/ionic: Preserve and set Ethernet source MAC after ib_ud_header_init()
2026-07-07 9:55 [PATCH v3 0/1] cdx: register shutdown callback for cdx controller Abhijit Gangurde
@ 2026-07-07 9:55 ` Abhijit Gangurde
0 siblings, 0 replies; 3+ messages in thread
From: Abhijit Gangurde @ 2026-07-07 9:55 UTC (permalink / raw)
To: nipun.gupta, nikhil.agarwal
Cc: gregkh, linux-kernel, michal.simek, git, Abhijit Gangurde, stable
ionic_build_hdr() populated the Ethernet source MAC (hdr->eth.smac_h) by
passing the header’s storage directly to rdma_read_gid_l2_fields().
However, ib_ud_header_init() is called after that and re-initializes the
UD header, which wipes the previously written smac_h. As a result, packets
are emitted with an zero source MAC address on the wire.
Correct the source MAC by reading the GID-derived smac into a temporary
buffer and copy it after ib_ud_header_init() completes.
Fixes: e8521822c733 ("RDMA/ionic: Register device ops for control path")
Cc: stable@vger.kernel.org # 6.18
Signed-off-by: Abhijit Gangurde <abhijit.gangurde@amd.com>
---
drivers/infiniband/hw/ionic/ionic_controlpath.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/ionic/ionic_controlpath.c b/drivers/infiniband/hw/ionic/ionic_controlpath.c
index ea12d9b8e125..84bc5f17a700 100644
--- a/drivers/infiniband/hw/ionic/ionic_controlpath.c
+++ b/drivers/infiniband/hw/ionic/ionic_controlpath.c
@@ -508,6 +508,7 @@ static int ionic_build_hdr(struct ionic_ibdev *dev,
{
const struct ib_global_route *grh;
enum rdma_network_type net;
+ u8 smac[ETH_ALEN];
u16 vlan;
int rc;
@@ -518,7 +519,7 @@ static int ionic_build_hdr(struct ionic_ibdev *dev,
grh = rdma_ah_read_grh(attr);
- rc = rdma_read_gid_l2_fields(grh->sgid_attr, &vlan, &hdr->eth.smac_h[0]);
+ rc = rdma_read_gid_l2_fields(grh->sgid_attr, &vlan, smac);
if (rc)
return rc;
@@ -536,6 +537,7 @@ static int ionic_build_hdr(struct ionic_ibdev *dev,
if (rc)
return rc;
+ ether_addr_copy(hdr->eth.smac_h, smac);
ether_addr_copy(hdr->eth.dmac_h, attr->roce.dmac);
if (net == RDMA_NETWORK_IPV4) {
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-07 9:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-27 6:18 [PATCH 1/1] RDMA/ionic: Preserve and set Ethernet source MAC after ib_ud_header_init() Abhijit Gangurde
2026-03-02 19:42 ` Leon Romanovsky
2026-07-07 9:55 [PATCH v3 0/1] cdx: register shutdown callback for cdx controller Abhijit Gangurde
2026-07-07 9:55 ` [PATCH 1/1] RDMA/ionic: Preserve and set Ethernet source MAC after ib_ud_header_init() Abhijit Gangurde
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®