critical fixes
Subsystems (2)
cover critical fixes
Hi
I am sending three patches, to fix some critical issues.
1) Skip memory initialization during driver load. Device may not come up, if memory is reset.
2) Fix promisc mode, kernel crashes with this bug. Drain rx queue before changing mode.
3) Fix bonding mode TLB/ALB, correct mac address need to communicate to device.
-Amit Salecha
PATCH 1/3 netxen: fix memory initialization
Avoid resetting memory during initialization, skip this memory block during driver probe.
--- drivers/net/netxen/netxen_nic_init.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/net/netxen/netxen_nic_init.c +2 -0
@@ -544,6 +544,8 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose)continue ;if (off == (ROMUSB_GLB +0x1c ))/* MS clock */ continue ; +if ((off &0x0ff00000 ) ==NETXEN_CRB_DDR_NET ) +continue ;if (off == (NETXEN_CRB_PEG_NET_1 +0x18 )) buf[i].data =0x1020 ;/* skip the function enable register */
Signature · 1 line
1.6.0.2
PATCH 2/3 netxen: fix promisc for NX2031.
In reply to Amit Kumar SalechaFrom: Narender Kumar <[email protected]>
Kernel crashes, if promisc mode set without disabling rx queue. Before changing mode in NX2031 chip, wait till rx queue drains.
--- drivers/net/netxen/netxen_nic_hdr.h | 2 + drivers/net/netxen/netxen_nic_hw.c | 49 +++++++++++++++++++++++++++-------- 2 files changed, 40 insertions(+), 11 deletions(-)
drivers/net/netxen/netxen_nic_hdr.h +2 -0
@@ -545,6 +545,8 @@ enum {#define NETXEN_NIU_TEST_MUX_CTL (NETXEN_CRB_NIU + 0x00094)#define NETXEN_NIU_XG_PAUSE_CTL (NETXEN_CRB_NIU + 0x00098)#define NETXEN_NIU_XG_PAUSE_LEVEL (NETXEN_CRB_NIU + 0x000dc) +#define NETXEN_NIU_FRAME_COUNT_SELECT (NETXEN_CRB_NIU + 0x000ac) +#define NETXEN_NIU_FRAME_COUNT (NETXEN_CRB_NIU + 0x000b0)#define NETXEN_NIU_XG_SEL (NETXEN_CRB_NIU + 0x00128)#define NETXEN_NIU_GB_PAUSE_CTL (NETXEN_CRB_NIU + 0x0030c)
drivers/net/netxen/netxen_nic_hw.c +38 -11
62 lines not on this page · raw message
Signature · 1 line
1.6.0.2
PATCH 3/3 netxen : fix BOND_MODE_TLB/ALB mode.
In reply to Amit Kumar SalechaFrom: Narender Kumar <[email protected]>
o In case of bonding mode BOND_MODE_TLB and BOND_MODE_ALB, mac addr can swap of new_active && old_active slave.
o In set_mac, store mac addr in device private structure for future use.
--- drivers/net/netxen/netxen_nic.h | 2 ++ drivers/net/netxen/netxen_nic_hw.c | 6 +++--- drivers/net/netxen/netxen_nic_main.c | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/netxen/netxen_nic.h +2 -0
@@ -1163,6 +1163,8 @@ struct netxen_adapter {u32 int_vec_bit;u32 heartbit; +u8 mac_addr[ETH_ALEN ]; +struct netxen_adapter_stats stats;struct netxen_recv_context recv_ctx;
drivers/net/netxen/netxen_nic_hw.c +3 -3
@@ -463,7 +463,7 @@ netxen_nic_enable_mcast_filter(struct netxen_adapter *adapter) {u32 val =0 ;u16 port = adapter->physical_port; -u8 *addr = adapter->netdev->dev_addr; +u8 *addr = adapter->mac_addr;if (adapter->mc_enabled)return 0 ;
@@ -492,7 +492,7 @@ netxen_nic_disable_mcast_filter(struct netxen_adapter *adapter) {u32 val =0 ;u16 port = adapter->physical_port; -u8 *addr = adapter->netdev->dev_addr; +u8 *addr = adapter->mac_addr;if (!adapter->mc_enabled)return 0 ;
@@ -687,7 +687,7 @@ void netxen_p3_nic_set_multi(struct net_device *netdev)list_splice_tail_init (&adapter->mac_list, &del_list); -nx_p3_nic_add_mac (adapter, netdev->dev_addr, &del_list); +nx_p3_nic_add_mac (adapter, adapter->mac_addr, &del_list);nx_p3_nic_add_mac (adapter, bcast_addr, &del_list);if (netdev->flags &IFF_PROMISC ) {
drivers/net/netxen/netxen_nic_main.c +3 -1
@@ -437,6 +437,7 @@ netxen_read_mac_addr(struct netxen_adapter *adapter) netdev->dev_addr[i] = *(p +5 - i);memcpy (netdev->perm_addr, netdev->dev_addr, netdev->addr_len); +memcpy (adapter->mac_addr, netdev->dev_addr, netdev->addr_len);/* set station address */
@@ -459,6 +460,7 @@ int netxen_nic_set_mac(struct net_device *netdev, void *p)netxen_napi_disable (adapter); } +memcpy (adapter->mac_addr, addr->sa_data, netdev->addr_len);memcpy (netdev->dev_addr, addr->sa_data, netdev->addr_len); adapter->macaddr_set (adapter, addr->sa_data);
@@ -956,7 +958,7 @@ netxen_nic_up(struct netxen_adapter *adapter, struct net_device *netdev)return err; }if (NX_IS_REVISION_P2 (adapter->ahw.revision_id)) - adapter->macaddr_set (adapter, netdev->dev_addr); + adapter->macaddr_set (adapter, adapter->mac_addr); adapter->set_multi (netdev); adapter->set_mtu (adapter, netdev->mtu);
Signature · 1 line
1.6.0.2
David Miller
maintainerRe: [net-2.6 PATCH 3/3] netxen : fix BOND_MODE_TLB/ALB mode.
From: Amit Kumar Salecha <[email protected]>
Date: Fri, 20 Nov 2009 17:09:34 -0800
drivers/net/netxen/netxen_nic_main.c netxen_read_mac_addr(struct netxen_adapter *adapter) · line 443
Quoted 8 lines
drivers/net/netxen/netxen_nic_main.c +1
-0@@ -437,6 +437,7 @@ netxen_read_mac_addr(struct netxen_adapter *adapter) netdev->dev_addr[i] = *(p +5 - i);memcpy (netdev->perm_addr, netdev->dev_addr, netdev->addr_len); +memcpy (adapter->mac_addr, netdev->dev_addr, netdev->addr_len);/* set station address */
I don't think this is correct.
You have to maintain a valid netdev->perm_addr even if you don't use that value later on internally. This is how the permanent, probed, MAC address of the card is made available to the user.
Second of all, it is not clear at all why you need to maintain this value internally. Why does it not work to simply use netdev->dev_addr?
Whatever the reason, you need to explain the details of this in your commit message.