Module Name: src
Committed By: christos
Date: Thu Apr 17 16:22:48 UTC 2014
Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixgbe_netbsd.h
Log Message:
CID/1008347, CID/1008348, CID/1008349: overflow before widen
CID/1203198, CID/1203199: Uninitialized scalar variable
To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/ixgbe/ixgbe_netbsd.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.12 src/sys/dev/pci/ixgbe/ixgbe.c:1.13
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.12 Tue Apr 15 08:37:59 2014
+++ src/sys/dev/pci/ixgbe/ixgbe.c Thu Apr 17 12:22:48 2014
@@ -59,7 +59,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
/*$FreeBSD: src/sys/dev/ixgbe/ixgbe.c,v 1.51 2011/04/25 23:34:21 jfv Exp $*/
-/*$NetBSD: ixgbe.c,v 1.12 2014/04/15 12:37:59 hannken Exp $*/
+/*$NetBSD: ixgbe.c,v 1.13 2014/04/17 16:22:48 christos Exp $*/
#include "opt_inet.h"
@@ -1378,7 +1378,7 @@ static inline void
ixgbe_enable_queue(struct adapter *adapter, u32 vector)
{
struct ixgbe_hw *hw = &adapter->hw;
- u64 queue = (u64)(1 << vector);
+ u64 queue = (u64)(1ULL << vector);
u32 mask;
if (hw->mac.type == ixgbe_mac_82598EB) {
@@ -1398,7 +1398,7 @@ __unused static inline void
ixgbe_disable_queue(struct adapter *adapter, u32 vector)
{
struct ixgbe_hw *hw = &adapter->hw;
- u64 queue = (u64)(1 << vector);
+ u64 queue = (u64)(1ULL << vector);
u32 mask;
if (hw->mac.type == ixgbe_mac_82598EB) {
@@ -2725,6 +2725,8 @@ ixgbe_config_link(struct adapter *adapte
if ((!autoneg) && (hw->mac.ops.get_link_capabilities))
err = hw->mac.ops.get_link_capabilities(hw,
&autoneg, &negotiate);
+ else
+ negotiate = 0;
if (err)
goto out;
if (hw->mac.ops.setup_link)
@@ -4649,7 +4651,7 @@ next_desc:
** Schedule another interrupt if so.
*/
if ((staterr & IXGBE_RXD_STAT_DD) != 0) {
- ixgbe_rearm_queues(adapter, (u64)(1 << que->msix));
+ ixgbe_rearm_queues(adapter, (u64)(1ULL << que->msix));
return true;
}
@@ -5020,9 +5022,9 @@ ixgbe_handle_link(void *context)
{
struct adapter *adapter = context;
- ixgbe_check_link(&adapter->hw,
- &adapter->link_speed, &adapter->link_up, 0);
- ixgbe_update_link_status(adapter);
+ if (ixgbe_check_link(&adapter->hw,
+ &adapter->link_speed, &adapter->link_up, 0) == 0)
+ ixgbe_update_link_status(adapter);
}
/*
@@ -5067,6 +5069,8 @@ ixgbe_handle_msf(void *context)
autoneg = hw->phy.autoneg_advertised;
if ((!autoneg) && (hw->mac.ops.get_link_capabilities))
hw->mac.ops.get_link_capabilities(hw, &autoneg, &negotiate);
+ else
+ negotiate = 0;
if (hw->mac.ops.setup_link)
hw->mac.ops.setup_link(hw, autoneg, negotiate, TRUE);
return;
Index: src/sys/dev/pci/ixgbe/ixgbe_netbsd.h
diff -u src/sys/dev/pci/ixgbe/ixgbe_netbsd.h:1.1 src/sys/dev/pci/ixgbe/ixgbe_netbsd.h:1.2
--- src/sys/dev/pci/ixgbe/ixgbe_netbsd.h:1.1 Fri Aug 12 17:55:29 2011
+++ src/sys/dev/pci/ixgbe/ixgbe_netbsd.h Thu Apr 17 12:22:48 2014
@@ -1,4 +1,4 @@
-/*$NetBSD: ixgbe_netbsd.h,v 1.1 2011/08/12 21:55:29 dyoung Exp $*/
+/*$NetBSD: ixgbe_netbsd.h,v 1.2 2014/04/17 16:22:48 christos Exp $*/
/*
* Copyright (c) 2011 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -33,7 +33,6 @@
#define ETHERCAP_VLAN_HWFILTER 0
#define ETHERCAP_VLAN_HWCSUM 0
-#define IFCAP_LRO 0
#define MJUM9BYTES (9 * 1024)
#define MJUM16BYTES (16 * 1024)
#define MJUMPAGESIZE PAGE_SIZE