From: Abhijit Gangurde <abhijit.gangurde@amd.com>
To: <nipun.gupta@amd.com>, <nikhil.agarwal@amd.com>
Cc: <gregkh@linuxfoundation.org>, <linux-kernel@vger.kernel.org>,
<michal.simek@amd.com>, <git@amd.com>,
Abhijit Gangurde <abhijit.gangurde@amd.com>,
<stable@vger.kernel.org>
Subject: [PATCH 1/1] RDMA/ionic: Preserve and set Ethernet source MAC after ib_ud_header_init()
Date: Tue, 7 Jul 2026 15:25:40 +0530 [thread overview]
Message-ID: <20260707095555.3939295-2-abhijit.gangurde@amd.com> (raw)
In-Reply-To: <20260707095555.3939295-1-abhijit.gangurde@amd.com>
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
next prev parent reply other threads:[~2026-07-07 9:56 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-07 9:55 [PATCH v3 0/1] cdx: register shutdown callback for cdx controller Abhijit Gangurde
2024-12-03 8:44 ` [PATCH v2 1/2] " Abhijit Gangurde
2024-12-03 8:44 ` [PATCH v2 2/2] cdx: disable cdx bus from bus shutdown callback Abhijit Gangurde
2024-12-10 7:05 ` [PATCH v2 1/2] cdx: register shutdown callback for cdx controller Agarwal, Nikhil
2026-07-07 9:55 ` Abhijit Gangurde
2026-07-07 9:55 ` Abhijit Gangurde [this message]
2026-07-07 9:55 ` [PATCH 1/1] RDMA/ionic: Reserve bytes in CQE format for future use Abhijit Gangurde
2026-07-07 9:55 ` [PATCH 1/1] RDMA/ionic: map PHC state into user space Abhijit Gangurde
2026-07-07 9:55 ` [PATCH 1/1] RDMA/ionic: simplify rq_meta allocation Abhijit Gangurde
2026-07-07 9:55 ` [PATCH v3 1/1] cdx: register shutdown callback for cdx controller Abhijit Gangurde
2026-07-07 9:55 ` [PATCH 1/4] net: ionic: update LIF identity for RDMA SRQ capability Abhijit Gangurde
2026-07-07 9:55 ` [PATCH 2/4] RDMA/ionic: segregate rq related fields from ionic_qp into a new ionic_rq struct Abhijit Gangurde
2026-07-07 9:55 ` [PATCH 3/4] RDMA/ionic: add Shared receive queue (SRQ) support Abhijit Gangurde
2026-07-07 9:55 ` [PATCH 4/4] RDMA/ionic: implement SRQ event handling support Abhijit Gangurde
2026-07-07 9:55 ` [PATCH v3 0/1] cdx: register shutdown callback for cdx controller Abhijit Gangurde
2026-07-07 9:55 ` [PATCH v3 1/1] " Abhijit Gangurde
2026-07-07 9:55 ` [PATCH v99 1/1] One more fix Abhijit Gangurde
2026-07-07 10:06 ` Greg KH
2026-07-07 10:13 ` Abhijit Gangurde
2026-07-07 9:55 ` [PATCH v99 1/1] merge me Abhijit Gangurde
2026-07-07 9:55 ` [PATCH v3 0/1] cdx: register shutdown callback for cdx controller Abhijit Gangurde
2026-07-07 9:55 ` [PATCH v3 1/1] " Abhijit Gangurde
2026-07-07 10:06 ` [PATCH v3 0/1] " Michal Simek
-- strict thread matches above, loose matches on Subject: below --
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
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=20260707095555.3939295-2-abhijit.gangurde@amd.com \
--to=abhijit.gangurde@amd.com \
--cc=git@amd.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@amd.com \
--cc=nikhil.agarwal@amd.com \
--cc=nipun.gupta@amd.com \
--cc=stable@vger.kernel.org \
/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
all inboxes | Powered by JetHome®