Skip to content

Commit 2696c15

Browse files
committed
Merge branch 'net-xilinx-axienet-multicast-fixes-and-improvements'
Sean Anderson says: ==================== net: xilinx: axienet: Multicast fixes and improvements [part] ==================== First two patches of the series which are fixes. Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents a812a3f + 797a68c commit 2696c15

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

drivers/net/ethernet/xilinx/xilinx_axienet.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@
170170
#define XAE_UAW0_OFFSET 0x00000700 /* Unicast address word 0 */
171171
#define XAE_UAW1_OFFSET 0x00000704 /* Unicast address word 1 */
172172
#define XAE_FMI_OFFSET 0x00000708 /* Frame Filter Control */
173+
#define XAE_FFE_OFFSET 0x0000070C /* Frame Filter Enable */
173174
#define XAE_AF0_OFFSET 0x00000710 /* Address Filter 0 */
174175
#define XAE_AF1_OFFSET 0x00000714 /* Address Filter 1 */
175176

drivers/net/ethernet/xilinx/xilinx_axienet_main.c

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ static int netdev_set_mac_address(struct net_device *ndev, void *p)
432432
*/
433433
static void axienet_set_multicast_list(struct net_device *ndev)
434434
{
435-
int i;
435+
int i = 0;
436436
u32 reg, af0reg, af1reg;
437437
struct axienet_local *lp = netdev_priv(ndev);
438438

@@ -450,7 +450,10 @@ static void axienet_set_multicast_list(struct net_device *ndev)
450450
} else if (!netdev_mc_empty(ndev)) {
451451
struct netdev_hw_addr *ha;
452452

453-
i = 0;
453+
reg = axienet_ior(lp, XAE_FMI_OFFSET);
454+
reg &= ~XAE_FMI_PM_MASK;
455+
axienet_iow(lp, XAE_FMI_OFFSET, reg);
456+
454457
netdev_for_each_mc_addr(ha, ndev) {
455458
if (i >= XAE_MULTICAST_CAM_TABLE_NUM)
456459
break;
@@ -469,25 +472,23 @@ static void axienet_set_multicast_list(struct net_device *ndev)
469472
axienet_iow(lp, XAE_FMI_OFFSET, reg);
470473
axienet_iow(lp, XAE_AF0_OFFSET, af0reg);
471474
axienet_iow(lp, XAE_AF1_OFFSET, af1reg);
475+
axienet_iow(lp, XAE_FFE_OFFSET, 1);
472476
i++;
473477
}
474478
} else {
475479
reg = axienet_ior(lp, XAE_FMI_OFFSET);
476480
reg &= ~XAE_FMI_PM_MASK;
477481

478482
axienet_iow(lp, XAE_FMI_OFFSET, reg);
479-
480-
for (i = 0; i < XAE_MULTICAST_CAM_TABLE_NUM; i++) {
481-
reg = axienet_ior(lp, XAE_FMI_OFFSET) & 0xFFFFFF00;
482-
reg |= i;
483-
484-
axienet_iow(lp, XAE_FMI_OFFSET, reg);
485-
axienet_iow(lp, XAE_AF0_OFFSET, 0);
486-
axienet_iow(lp, XAE_AF1_OFFSET, 0);
487-
}
488-
489483
dev_info(&ndev->dev, "Promiscuous mode disabled.\n");
490484
}
485+
486+
for (; i < XAE_MULTICAST_CAM_TABLE_NUM; i++) {
487+
reg = axienet_ior(lp, XAE_FMI_OFFSET) & 0xFFFFFF00;
488+
reg |= i;
489+
axienet_iow(lp, XAE_FMI_OFFSET, reg);
490+
axienet_iow(lp, XAE_FFE_OFFSET, 0);
491+
}
491492
}
492493

493494
/**

0 commit comments

Comments
 (0)