* [PATCH net-next] ixgbe: return error in set_rar when index out of range
@ 2010-05-18 15:34 Shirley Ma
2010-05-19 0:19 ` Jeff Kirsher
0 siblings, 1 reply; 2+ messages in thread
From: Shirley Ma @ 2010-05-18 15:34 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: e1000-devel, netdev, davem, kvm
Return -1 when set_rar index is out of range
Signed-off-by: Shirley Ma <xma@us.ibm.com>
---
drivers/net/ixgbe/ixgbe_common.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_common.c
b/drivers/net/ixgbe/ixgbe_common.c
index 1159d91..77b3cf4 100644
--- a/drivers/net/ixgbe/ixgbe_common.c
+++ b/drivers/net/ixgbe/ixgbe_common.c
@@ -1188,6 +1188,7 @@ s32 ixgbe_set_rar_generic(struct ixgbe_hw *hw, u32
index, u8 *addr, u32 vmdq,
IXGBE_WRITE_REG(hw, IXGBE_RAH(index), rar_high);
} else {
hw_dbg(hw, "RAR index %d is out of range.\n", index);
+ return -1;
}
return 0;
------------------------------------------------------------------------------
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] ixgbe: return error in set_rar when index out of range
2010-05-18 15:34 [PATCH net-next] ixgbe: return error in set_rar when index out of range Shirley Ma
@ 2010-05-19 0:19 ` Jeff Kirsher
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Kirsher @ 2010-05-19 0:19 UTC (permalink / raw)
To: Shirley Ma; +Cc: davem, kvm, netdev, e1000-devel
On Tue, May 18, 2010 at 08:34, Shirley Ma <mashirle@us.ibm.com> wrote:
> Return -1 when set_rar index is out of range
>
> Signed-off-by: Shirley Ma <xma@us.ibm.com>
> ---
>
> drivers/net/ixgbe/ixgbe_common.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
I think this should use IXGBE_ERR_<blah> instead and there is another
spot where this could be used. Instead I propose this patch
instead...
ixgbe: return IXGBE_ERR_RAR_INDEX when out of range
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Based on patch from Shirley Ma <xma@us.ibm.com>
Return IXGBE_ERR_RAR_INDEX when RAR index is out of range, instead of
returning IXGBE_SUCCESS.
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Acked-by: Don Skidmore <donald.c.skidmore@intel.com>
---
drivers/net/ixgbe/ixgbe_common.c | 2 ++
drivers/net/ixgbe/ixgbe_type.h | 1 +
2 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_common.c b/drivers/net/ixgbe/ixgbe_common.c
index 1159d91..9595b1b 100644
--- a/drivers/net/ixgbe/ixgbe_common.c
+++ b/drivers/net/ixgbe/ixgbe_common.c
@@ -1188,6 +1188,7 @@ s32 ixgbe_set_rar_generic(struct ixgbe_hw *hw,
u32 index, u8 *addr, u32 vmdq,
IXGBE_WRITE_REG(hw, IXGBE_RAH(index), rar_high);
} else {
hw_dbg(hw, "RAR index %d is out of range.\n", index);
+ return IXGBE_ERR_RAR_INDEX;
}
return 0;
@@ -1219,6 +1220,7 @@ s32 ixgbe_clear_rar_generic(struct ixgbe_hw *hw,
u32 index)
IXGBE_WRITE_REG(hw, IXGBE_RAH(index), rar_high);
} else {
hw_dbg(hw, "RAR index %d is out of range.\n", index);
+ return IXGBE_ERR_RAR_INDEX;
}
/* clear VMDq pool/queue selection for this RAR */
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h
index bd69196..37d2807 100644
--- a/drivers/net/ixgbe/ixgbe_type.h
+++ b/drivers/net/ixgbe/ixgbe_type.h
@@ -2600,6 +2600,7 @@ struct ixgbe_info {
#define IXGBE_ERR_FDIR_REINIT_FAILED -23
#define IXGBE_ERR_EEPROM_VERSION -24
#define IXGBE_ERR_NO_SPACE -25
+#define IXGBE_ERR_RAR_INDEX -26
#define IXGBE_NOT_IMPLEMENTED 0x7FFFFFFF
#endif /* _IXGBE_TYPE_H_ */
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-05-19 0:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-18 15:34 [PATCH net-next] ixgbe: return error in set_rar when index out of range Shirley Ma
2010-05-19 0:19 ` Jeff Kirsher
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).