From 38a8fc0fcf86f131f8bddf3787f9dfa7325bd981 Mon Sep 17 00:00:00 2001 From: Divy Le Ray Date: Sat, 13 Feb 2010 09:44:30 +0000 Subject: cxgb3: FIx VLAN over Jumbo frames The mac is expected to auto-inflate the Maximum Frame size for VLAN tagged frames. It however does not work with jumbo frames. Work around the bug adding 4 to the Maximum Frame for MTUs greater than 1536. Signed-off-by: Divy Le Ray Signed-off-by: David S. Miller --- drivers/net/cxgb3/xgmac.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/net/cxgb3/xgmac.c') diff --git a/drivers/net/cxgb3/xgmac.c b/drivers/net/cxgb3/xgmac.c index 0109ee4..0c08de5 100644 --- a/drivers/net/cxgb3/xgmac.c +++ b/drivers/net/cxgb3/xgmac.c @@ -353,6 +353,9 @@ int t3_mac_set_mtu(struct cmac *mac, unsigned int mtu) * packet size register includes header, but not FCS. */ mtu += 14; + if (mtu > 1536) + mtu += 4; + if (mtu > MAX_FRAME_SIZE - 4) return -EINVAL; t3_write_reg(adap, A_XGM_RX_MAX_PKT_SIZE + mac->offset, mtu); -- cgit v1.1 From 0988d26978561d568efed45cc5576d85ea7b609d Mon Sep 17 00:00:00 2001 From: Jiri Pirko Date: Wed, 17 Feb 2010 12:27:14 +0000 Subject: cxgb3: convert to use netdev_for_each_addr Removed whole t3_rx_mode structure and appropriate helpers cause they are no longer needed. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller --- drivers/net/cxgb3/xgmac.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'drivers/net/cxgb3/xgmac.c') diff --git a/drivers/net/cxgb3/xgmac.c b/drivers/net/cxgb3/xgmac.c index 0c08de5..c142a21 100644 --- a/drivers/net/cxgb3/xgmac.c +++ b/drivers/net/cxgb3/xgmac.c @@ -297,29 +297,30 @@ static int hash_hw_addr(const u8 * addr) return hash; } -int t3_mac_set_rx_mode(struct cmac *mac, struct t3_rx_mode *rm) +int t3_mac_set_rx_mode(struct cmac *mac, struct net_device *dev) { u32 val, hash_lo, hash_hi; struct adapter *adap = mac->adapter; unsigned int oft = mac->offset; val = t3_read_reg(adap, A_XGM_RX_CFG + oft) & ~F_COPYALLFRAMES; - if (rm->dev->flags & IFF_PROMISC) + if (dev->flags & IFF_PROMISC) val |= F_COPYALLFRAMES; t3_write_reg(adap, A_XGM_RX_CFG + oft, val); - if (rm->dev->flags & IFF_ALLMULTI) + if (dev->flags & IFF_ALLMULTI) hash_lo = hash_hi = 0xffffffff; else { - u8 *addr; + struct dev_mc_list *dmi; int exact_addr_idx = mac->nucast; hash_lo = hash_hi = 0; - while ((addr = t3_get_next_mcaddr(rm))) + netdev_for_each_mc_addr(dmi, dev) if (exact_addr_idx < EXACT_ADDR_FILTERS) - set_addr_filter(mac, exact_addr_idx++, addr); + set_addr_filter(mac, exact_addr_idx++, + dmi->dmi_addr); else { - int hash = hash_hw_addr(addr); + int hash = hash_hw_addr(dmi->dmi_addr); if (hash < 32) hash_lo |= (1 << hash); -- cgit v1.1