Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

RDMA/ionic: Preserve and set Ethernet source MAC after ib_ud_header_init()

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>
Link: https://patch.msgid.link/20260227061809.2979990-1-abhijit.gangurde@amd.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>

authored by

Abhijit Gangurde and committed by
Leon Romanovsky
a08aaf39 29a3edd7

+3 -1
+3 -1
drivers/infiniband/hw/ionic/ionic_controlpath.c
··· 508 508 { 509 509 const struct ib_global_route *grh; 510 510 enum rdma_network_type net; 511 + u8 smac[ETH_ALEN]; 511 512 u16 vlan; 512 513 int rc; 513 514 ··· 519 518 520 519 grh = rdma_ah_read_grh(attr); 521 520 522 - rc = rdma_read_gid_l2_fields(grh->sgid_attr, &vlan, &hdr->eth.smac_h[0]); 521 + rc = rdma_read_gid_l2_fields(grh->sgid_attr, &vlan, smac); 523 522 if (rc) 524 523 return rc; 525 524 ··· 537 536 if (rc) 538 537 return rc; 539 538 539 + ether_addr_copy(hdr->eth.smac_h, smac); 540 540 ether_addr_copy(hdr->eth.dmac_h, attr->roce.dmac); 541 541 542 542 if (net == RDMA_NETWORK_IPV4) {