* Re: Optics (SFP) monitoring on ixgbe and igbe
From: Aurélien @ 2012-11-18 21:35 UTC (permalink / raw)
To: Ben Hutchings; +Cc: netdev
In-Reply-To: <1353094719.2743.21.camel@bwh-desktop.uk.solarflarecom.com>
[-- Attachment #1: Type: text/plain, Size: 1982 bytes --]
Hi Ben,
I've rewritten things according to your remarks.
On Fri, Nov 16, 2012 at 8:38 PM, Ben Hutchings
<bhutchings@solarflare.com> wrote:
>
> This is silly; log10() and <math.h> are part of standard C and -lm is
> standard on Unix. Just use <math.h> and -lm unconditionally.
Ok, I wasn't sure.
>
> Please merge this with the existing -m option and update the
> documentation to say that this covers diagnostics where available. You
> could add a long option alias like --dump-module or --module-info that
> covers the two types of information.
Done that, the current output of -m has been modified so that
everything lines up correctly.
The --module-info option alias has been added.
> All the above offsets need parentheses around their definitions.
[…]
> This is commented as an offset in the A2 'EEPROM' but the offsets
> actually used include the 0x100 offset from the start of the
> concatenated 'EEPROM'.
A new SFF_A2_BASE has been added, and the OFFSET_TO macros are now
using that, so I removed the 0x100 from all the offsets, and they are
now indeed A2-relative.
>
> Why are all the literals explicitly float and not double?
>
It was a keyboard/chair interface problem, now fixed :)
> Please follow kernel coding style for spacing. checkpatch.pl will show
> you what should be changed.
Ran a checkpatch, and fixed everything that should be fixed.
>
> This seems awfuly complicated; why not:
>
> #define OFFSET_TO_TEMP(offset) (((s16)OFFSET_TO_U16(offset)) * 10 / 256)
>
> But why round to tenths of a degree here and then round again to whole
> degrees celsius/fahrenheit when printing?
>
I did not think a simple cast would work, but it seems to give the
right value. I also implemented externally calibrated optics in this
new version, so I now do the whole formatting in the printing, and
store the raw value in the struct.
It should be better now.
Best regards,
--
Aurélien Guillaume
[-- Attachment #2: 0001-Implemented-basic-optics-diagnostics-for-SFF-8472-co.patch --]
[-- Type: application/octet-stream, Size: 21479 bytes --]
From 2b96a1a65e1c24e3c43f479719bd3e3da499656c Mon Sep 17 00:00:00 2001
From: Aurelien Guillaume <aurelien@iwi.me>
Date: Fri, 16 Nov 2012 02:50:00 +0100
Subject: [PATCH] Implemented basic optics diagnostics for SFF-8472 compliant
transceivers in ethtool.
Signed-off-by: Aurelien Guillaume <aurelien@iwi.me>
---
Makefile.am | 2 +-
ethtool.c | 17 +++-
internal.h | 3 +
sfpdiag.c | 364 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
sfpid.c | 35 +++---
5 files changed, 402 insertions(+), 19 deletions(-)
create mode 100644 sfpdiag.c
diff --git a/Makefile.am b/Makefile.am
index e33f71f..89a0d1e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,7 +9,7 @@ ethtool_SOURCES = ethtool.c ethtool-copy.h internal.h net_tstamp-copy.h \
fec_8xx.c ibm_emac.c ixgb.c ixgbe.c natsemi.c \
pcnet32.c realtek.c tg3.c marvell.c vioc.c \
smsc911x.c at76c50x-usb.c sfc.c stmmac.c \
- rxclass.c sfpid.c
+ rxclass.c sfpid.c sfpdiag.c
TESTS = test-cmdline test-features
check_PROGRAMS = test-cmdline test-features
diff --git a/ethtool.c b/ethtool.c
index 3db7fec..345c21c 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -3604,6 +3604,16 @@ static int do_getmodule(struct cmd_context *ctx)
return 1;
}
+ /*
+ * SFF-8079 EEPROM layout contains the memory available at A0 address on
+ * the PHY EEPROM.
+ * SFF-8472 defines a virtual extension of the EEPROM, where the
+ * microcontroller on the SFP/SFP+ generates a page at the A2 address,
+ * which contains data relative to optical diagnostics.
+ * The current kernel implementation returns a blob, which contains:
+ * - ETH_MODULE_SFF_8079 => The A0 page only.
+ * - ETH_MODULE_SFF_8472 => The A0 and A2 page concatenated.
+ */
if (geeprom_dump_raw) {
fwrite(eeprom->data, 1, eeprom->len, stdout);
} else {
@@ -3613,8 +3623,11 @@ static int do_getmodule(struct cmd_context *ctx)
} else if (!geeprom_dump_hex) {
switch (modinfo.type) {
case ETH_MODULE_SFF_8079:
+ sff8079_show_all(eeprom->data);
+ break;
case ETH_MODULE_SFF_8472:
sff8079_show_all(eeprom->data);
+ sff8472_show_all(eeprom->data);
break;
default:
geeprom_dump_hex = 1;
@@ -3831,8 +3844,8 @@ static const struct option {
{ "--show-priv-flags" , 1, do_gprivflags, "Query private flags" },
{ "--set-priv-flags", 1, do_sprivflags, "Set private flags",
" FLAG on|off ...\n" },
- { "-m|--dump-module-eeprom", 1, do_getmodule,
- "Qeuery/Decode Module EEPROM information",
+ { "-m|--dump-module-eeprom|--module-info", 1, do_getmodule,
+ "Query/Decode Module EEPROM information and optical diagnostics if available",
" [ raw on|off ]\n"
" [ hex on|off ]\n"
" [ offset N ]\n"
diff --git a/internal.h b/internal.h
index 4f96fd5..e977a81 100644
--- a/internal.h
+++ b/internal.h
@@ -253,4 +253,7 @@ int rxclass_rule_del(struct cmd_context *ctx, __u32 loc);
/* Module EEPROM parsing code */
void sff8079_show_all(const __u8 *id);
+/* Optics diagnostics */
+void sff8472_show_all(const __u8 *id);
+
#endif /* ETHTOOL_INTERNAL_H__ */
diff --git a/sfpdiag.c b/sfpdiag.c
new file mode 100644
index 0000000..1094bd7
--- /dev/null
+++ b/sfpdiag.c
@@ -0,0 +1,364 @@
+/*
+ * sfpdiag.c: Implements SFF-8472 optics diagnostics.
+ *
+ * Aurelien Guillaume <aurelien@iwi.me> (C) 2012
+ * This implementation is loosely based on DOM patches
+ * from Robert Olsson <robert@herjulf.se> (C) 2009
+ * and SFF-8472 specs (ftp://ftp.seagate.com/pub/sff/SFF-8472.PDF)
+ * by SFF Committee.
+ */
+
+#include <stdio.h>
+#include <math.h>
+#include "internal.h"
+
+/* Offsets in decimal, for direct comparison with the SFF specs */
+
+/* A0-based EEPROM offsets for DOM support checks */
+#define SFF_A0_DOM 92
+#define SFF_A0_OPTIONS 93
+#define SFF_A0_COMP 94
+
+/* EEPROM bit values for various registers */
+#define SFF_A0_DOM_EXTCAL (1 << 4)
+#define SFF_A0_DOM_INTCAL (1 << 5)
+#define SFF_A0_DOM_IMPL (1 << 6)
+#define SFF_A0_DOM_PWRT (1 << 3)
+
+#define SFF_A0_OPTIONS_AW (1 << 7)
+
+/*
+ * See ethtool.c comments about SFF-8472, this is the offset
+ * at which the A2 page is in the EEPROM blob returned by the
+ * kernel.
+ */
+#define SFF_A2_BASE 0x100
+
+/* A2-based offsets for DOM */
+#define SFF_A2_TEMP 96
+#define SFF_A2_TEMP_HALRM 0
+#define SFF_A2_TEMP_LALRM 2
+#define SFF_A2_TEMP_HWARN 4
+#define SFF_A2_TEMP_LWARN 6
+
+#define SFF_A2_VCC 98
+#define SFF_A2_VCC_HALRM 8
+#define SFF_A2_VCC_LALRM 10
+#define SFF_A2_VCC_HWARN 12
+#define SFF_A2_VCC_LWARN 14
+
+#define SFF_A2_BIAS 96
+#define SFF_A2_BIAS_HALRM 16
+#define SFF_A2_BIAS_LALRM 18
+#define SFF_A2_BIAS_HWARN 20
+#define SFF_A2_BIAS_LWARN 22
+
+#define SFF_A2_TX_PWR 102
+#define SFF_A2_TX_PWR_HALRM 24
+#define SFF_A2_TX_PWR_LALRM 26
+#define SFF_A2_TX_PWR_HWARN 28
+#define SFF_A2_TX_PWR_LWARN 30
+
+#define SFF_A2_RX_PWR 104
+#define SFF_A2_RX_PWR_HALRM 32
+#define SFF_A2_RX_PWR_LALRM 34
+#define SFF_A2_RX_PWR_HWARN 36
+#define SFF_A2_RX_PWR_LWARN 38
+
+#define SFF_A2_ALRM_FLG 112
+#define SFF_A2_WARN_FLG 116
+
+/* 32-bit little-endian calibration constants */
+#define SFF_A2_CAL_RXPWR4 56
+#define SFF_A2_CAL_RXPWR3 60
+#define SFF_A2_CAL_RXPWR2 64
+#define SFF_A2_CAL_RXPWR1 68
+#define SFF_A2_CAL_RXPWR0 72
+
+/* 16-bit little endian calibration constants */
+#define SFF_A2_CAL_TXI_SLP 76
+#define SFF_A2_CAL_TXI_OFF 78
+#define SFF_A2_CAL_TXPWR_SLP 80
+#define SFF_A2_CAL_TXPWR_OFF 82
+#define SFF_A2_CAL_T_SLP 84
+#define SFF_A2_CAL_T_OFF 86
+#define SFF_A2_CAL_V_SLP 88
+#define SFF_A2_CAL_V_OFF 90
+
+
+struct sff8472_diags {
+
+#define MCURR 0
+#define LWARN 1
+#define HWARN 2
+#define LALRM 3
+#define HALRM 4
+
+ /* [5] tables are current, low/high warn, low/high alarm */
+ __u8 supports_dom; /* Supports DOM */
+ __u8 supports_alarms; /* Supports alarm/warning thold */
+ __u8 calibrated_ext; /* Is externally calibrated */
+ __u16 bias_cur[5]; /* Measured bias current in 2uA units */
+ __u16 tx_power[5]; /* Measured TX Power in 0.1uW units */
+ __u16 rx_power[5]; /* Measured RX Power */
+ __u8 rx_power_type; /* 0 = OMA, 1 = Average power */
+ __s16 sfp_temp[5]; /* SFP Temp in 16-bit signed 1/256 Celcius */
+ __u16 sfp_voltage[5]; /* SFP voltage in 0.1mV units */
+
+};
+
+static struct sff8472_aw_flags {
+ const char *str; /* Human-readable string, null at the end */
+ int offset; /* A2-relative adress offset */
+ __u8 value; /* Alarm is on if (offset & value) != 0. */
+} sff8472_aw_flags[] = {
+ { "Laser bias current high alarm", SFF_A2_ALRM_FLG, (1 << 3) },
+ { "Laser bias current low alarm", SFF_A2_ALRM_FLG, (1 << 2) },
+ { "Laser bias current high warning", SFF_A2_WARN_FLG, (1 << 3) },
+ { "Laser bias current low warning", SFF_A2_WARN_FLG, (1 << 2) },
+
+ { "Laser output power high alarm", SFF_A2_ALRM_FLG, (1 << 1) },
+ { "Laser output power low alarm", SFF_A2_ALRM_FLG, (1 << 0) },
+ { "Laser output power high warning", SFF_A2_WARN_FLG, (1 << 1) },
+ { "Laser output power low warning", SFF_A2_WARN_FLG, (1 << 0) },
+
+ { "Module temperature high alarm", SFF_A2_ALRM_FLG, (1 << 7) },
+ { "Module temperature low alarm", SFF_A2_ALRM_FLG, (1 << 6) },
+ { "Module temperature high warning", SFF_A2_WARN_FLG, (1 << 7) },
+ { "Module temperature low warning", SFF_A2_WARN_FLG, (1 << 6) },
+
+ { "Module voltage high alarm", SFF_A2_ALRM_FLG, (1 << 5) },
+ { "Module voltage low alarm", SFF_A2_ALRM_FLG, (1 << 4) },
+ { "Module voltage high warning", SFF_A2_WARN_FLG, (1 << 5) },
+ { "Module voltage low warning", SFF_A2_WARN_FLG, (1 << 4) },
+
+ { "Laser rx power high alarm", SFF_A2_ALRM_FLG + 1, (1 << 7) },
+ { "Laser rx power low alarm", SFF_A2_ALRM_FLG + 1, (1 << 6) },
+ { "Laser rx power high warning", SFF_A2_WARN_FLG + 1, (1 << 7) },
+ { "Laser rx power low warning", SFF_A2_WARN_FLG + 1, (1 << 6) },
+
+ { NULL, 0, 0 },
+};
+
+static double convert_mw_to_dbm(double mw)
+{
+ return (10. * log10(mw / 1000.)) + 30.;
+}
+
+
+/* Most common case: 16-bit unsigned integer in a certain unit */
+#define A2_OFFSET_TO_U16(offset) \
+ (id[SFF_A2_BASE + (offset)] << 8 | id[SFF_A2_BASE + (offset) + 1])
+
+/* Calibration slope is a number between 0.0 included and 256.0 excluded. */
+#define A2_OFFSET_TO_SLP(offset) \
+ (id[SFF_A2_BASE + (offset)] + id[SFF_A2_BASE + (offset) + 1] / 256.)
+
+/* Calibration offset is an integer from -32768 to 32767 */
+#define A2_OFFSET_TO_OFF(offset) \
+ ((__s16)A2_OFFSET_TO_U16(offset))
+
+/* RXPWR(x) are IEEE-754 floating point numbers in big-endian format */
+#define A2_OFFSET_TO_RXPWRx(offset) \
+ (befloattoh((__u32 *)(id + SFF_A2_BASE + (offset))))
+
+/*
+ * 2-byte internal temperature conversions:
+ * First byte is a signed 8-bit integer, which is the temp decimal part
+ * Second byte are 1/256th of degree, which are added to the dec part.
+ */
+#define A2_OFFSET_TO_TEMP(offset) ((__s16)A2_OFFSET_TO_U16(offset))
+
+
+static void sff8472_dom_parse(const __u8 *id, struct sff8472_diags *sd)
+{
+
+ sd->bias_cur[MCURR] = A2_OFFSET_TO_U16(SFF_A2_BIAS);
+ sd->bias_cur[HALRM] = A2_OFFSET_TO_U16(SFF_A2_BIAS_HALRM);
+ sd->bias_cur[LALRM] = A2_OFFSET_TO_U16(SFF_A2_BIAS_LALRM);
+ sd->bias_cur[HWARN] = A2_OFFSET_TO_U16(SFF_A2_BIAS_HWARN);
+ sd->bias_cur[LWARN] = A2_OFFSET_TO_U16(SFF_A2_BIAS_LWARN);
+
+ sd->sfp_voltage[MCURR] = A2_OFFSET_TO_U16(SFF_A2_VCC);
+ sd->sfp_voltage[HALRM] = A2_OFFSET_TO_U16(SFF_A2_VCC_HALRM);
+ sd->sfp_voltage[LALRM] = A2_OFFSET_TO_U16(SFF_A2_VCC_LALRM);
+ sd->sfp_voltage[HWARN] = A2_OFFSET_TO_U16(SFF_A2_VCC_HWARN);
+ sd->sfp_voltage[LWARN] = A2_OFFSET_TO_U16(SFF_A2_VCC_LWARN);
+
+ sd->tx_power[MCURR] = A2_OFFSET_TO_U16(SFF_A2_TX_PWR);
+ sd->tx_power[HALRM] = A2_OFFSET_TO_U16(SFF_A2_TX_PWR_HALRM);
+ sd->tx_power[LALRM] = A2_OFFSET_TO_U16(SFF_A2_TX_PWR_LALRM);
+ sd->tx_power[HWARN] = A2_OFFSET_TO_U16(SFF_A2_TX_PWR_HWARN);
+ sd->tx_power[LWARN] = A2_OFFSET_TO_U16(SFF_A2_TX_PWR_LWARN);
+
+ sd->rx_power[MCURR] = A2_OFFSET_TO_U16(SFF_A2_RX_PWR);
+ sd->rx_power[HALRM] = A2_OFFSET_TO_U16(SFF_A2_RX_PWR_HALRM);
+ sd->rx_power[LALRM] = A2_OFFSET_TO_U16(SFF_A2_RX_PWR_LALRM);
+ sd->rx_power[HWARN] = A2_OFFSET_TO_U16(SFF_A2_RX_PWR_HWARN);
+ sd->rx_power[LWARN] = A2_OFFSET_TO_U16(SFF_A2_RX_PWR_LWARN);
+
+ sd->sfp_temp[MCURR] = A2_OFFSET_TO_TEMP(SFF_A2_TEMP);
+ sd->sfp_temp[HALRM] = A2_OFFSET_TO_TEMP(SFF_A2_TEMP_HALRM);
+ sd->sfp_temp[LALRM] = A2_OFFSET_TO_TEMP(SFF_A2_TEMP_LALRM);
+ sd->sfp_temp[HWARN] = A2_OFFSET_TO_TEMP(SFF_A2_TEMP_HWARN);
+ sd->sfp_temp[LWARN] = A2_OFFSET_TO_TEMP(SFF_A2_TEMP_LWARN);
+
+}
+
+/* Converts to a float from a big-endian 4-byte source buffer. */
+static float befloattoh(const __u32 *source)
+{
+ union {
+ __u32 src;
+ float dst;
+ } converter;
+
+ converter.src = be32toh(*source);
+ return converter.dst;
+}
+
+static void sff8472_calibration(const __u8 *id, struct sff8472_diags *sd)
+{
+ int i;
+ __u16 rx_reading;
+
+ /* Calibration should occur for all values (threshold and current) */
+ for (i = 0; i < sizeof(sd->bias_cur); ++i) {
+ /*
+ * Apply calibration formula 1 (Temp., Voltage, Bias, Tx Power)
+ */
+ sd->bias_cur[i] *= A2_OFFSET_TO_SLP(SFF_A2_CAL_TXI_SLP);
+ sd->tx_power[i] *= A2_OFFSET_TO_SLP(SFF_A2_CAL_TXPWR_SLP);
+ sd->sfp_voltage[i] *= A2_OFFSET_TO_SLP(SFF_A2_CAL_V_SLP);
+ sd->sfp_temp[i] *= A2_OFFSET_TO_SLP(SFF_A2_CAL_T_SLP);
+
+ sd->bias_cur[i] += A2_OFFSET_TO_OFF(SFF_A2_CAL_TXI_OFF);
+ sd->tx_power[i] += A2_OFFSET_TO_OFF(SFF_A2_CAL_TXPWR_OFF);
+ sd->sfp_voltage[i] += A2_OFFSET_TO_OFF(SFF_A2_CAL_V_OFF);
+ sd->sfp_temp[i] += A2_OFFSET_TO_OFF(SFF_A2_CAL_T_OFF);
+
+ /*
+ * Apply calibration formula 2 (Rx Power only)
+ */
+ rx_reading = sd->rx_power[i];
+ sd->rx_power[i] = A2_OFFSET_TO_RXPWRx(SFF_A2_CAL_RXPWR0);
+ sd->rx_power[i] += rx_reading *
+ A2_OFFSET_TO_RXPWRx(SFF_A2_CAL_RXPWR1);
+ sd->rx_power[i] += rx_reading *
+ A2_OFFSET_TO_RXPWRx(SFF_A2_CAL_RXPWR2);
+ sd->rx_power[i] += rx_reading *
+ A2_OFFSET_TO_RXPWRx(SFF_A2_CAL_RXPWR3);
+ }
+}
+
+static void sff8472_parse_eeprom(const __u8 *id, struct sff8472_diags *sd)
+{
+ sd->supports_dom = id[SFF_A0_DOM] & SFF_A0_DOM_IMPL;
+ sd->supports_alarms = id[SFF_A0_OPTIONS] & SFF_A0_OPTIONS_AW;
+ sd->calibrated_ext = id[SFF_A0_DOM] & SFF_A0_DOM_EXTCAL;
+ sd->rx_power_type = id[SFF_A0_DOM] & SFF_A0_DOM_PWRT;
+
+ sff8472_dom_parse(id, sd);
+
+ /*
+ * If the SFP is externally calibrated, we need to read calibration data
+ * and compensate the already stored readings.
+ */
+ if (sd->calibrated_ext)
+ sff8472_calibration(id, sd);
+}
+
+
+
+void sff8472_show_all(const __u8 *id)
+{
+ struct sff8472_diags sd;
+ char *rx_power_string = NULL;
+ int i;
+
+ sff8472_parse_eeprom(id, &sd);
+
+ if (!sd.supports_dom) {
+ printf("\t%-41s : No\n", "Optical diagnostics support");
+ return ;
+ }
+ printf("\t%-41s : Yes\n", "Optical diagnostics support");
+
+#define PRINT_BIAS(string, index) \
+ printf("\t%-41s : %.3f mA\n", (string), \
+ (double)(sd.bias_cur[(index)] / 500.));
+
+# define PRINT_xX_PWR(string, var, index) \
+ printf("\t%-41s : %.4f mW / %.2f dBm\n", (string), \
+ (double)((var)[(index)] / 10000.), \
+ convert_mw_to_dbm((double)((var)[(index)] / 10000.)));
+
+#define PRINT_TEMP(string, index) \
+ printf("\t%-41s : %.2f degrees C / %.2f degrees F\n", (string), \
+ (double)(sd.sfp_temp[(index)] / 256.), \
+ (double)(sd.sfp_temp[(index)] / 256. * 1.8 + 32.));
+
+#define PRINT_VCC(string, index) \
+ printf("\t%-41s : %.4f V\n", (string), \
+ (double)(sd.sfp_voltage[(index)] / 10000.));
+
+
+ PRINT_BIAS("Laser bias current", MCURR);
+ PRINT_xX_PWR("Laser output power", sd.tx_power, MCURR);
+
+ if (!sd.rx_power_type)
+ rx_power_string = "Receiver signal OMA";
+ else
+ rx_power_string = "Receiver signal average optical power";
+
+ PRINT_xX_PWR(rx_power_string, sd.rx_power, MCURR);
+
+ PRINT_TEMP("Module temperature", MCURR);
+ PRINT_VCC("Module voltage", MCURR);
+
+ printf("\t%-41s : %s\n", "Alarm/warning flags implemented",
+ (sd.supports_alarms ? "Yes" : "No"));
+ if (sd.supports_alarms) {
+
+ for (i = 0; sff8472_aw_flags[i].str; ++i) {
+ printf("\t%-41s : %s\n", sff8472_aw_flags[i].str,
+ id[SFF_A2_BASE + sff8472_aw_flags[i].offset]
+ & sff8472_aw_flags[i].value ? "On" : "Off");
+ }
+
+ PRINT_BIAS("Laser bias current high alarm threshold", HALRM);
+ PRINT_BIAS("Laser bias current low alarm threshold", LALRM);
+ PRINT_BIAS("Laser bias current high warning threshold", HWARN);
+ PRINT_BIAS("Laser bias current low warning threshold", LWARN);
+
+ PRINT_xX_PWR("Laser output power high alarm threshold",
+ sd.tx_power, HALRM);
+ PRINT_xX_PWR("Laser output power low alarm threshold",
+ sd.tx_power, LALRM);
+ PRINT_xX_PWR("Laser output power high warning threshold",
+ sd.tx_power, HWARN);
+ PRINT_xX_PWR("Laser output power low warning threshold",
+ sd.tx_power, LWARN);
+
+ PRINT_TEMP("Module temperature high alarm threshold", HALRM);
+ PRINT_TEMP("Module temperature low alarm threshold", LALRM);
+ PRINT_TEMP("Module temperature high warning threshold", HWARN);
+ PRINT_TEMP("Module temperature low warning threshold", LWARN);
+
+ PRINT_VCC("Module voltage high alarm threshold", HALRM);
+ PRINT_VCC("Module voltage low alarm threshold", LALRM);
+ PRINT_VCC("Module voltage high warning threshold", HWARN);
+ PRINT_VCC("Module voltage low warning threshold", LWARN);
+
+ PRINT_xX_PWR("Laser rx power high alarm threshold",
+ sd.rx_power, HALRM);
+ PRINT_xX_PWR("Laser rx power low alarm threshold",
+ sd.rx_power, LALRM);
+ PRINT_xX_PWR("Laser rx power high warning threshold",
+ sd.rx_power, HWARN);
+ PRINT_xX_PWR("Laser rx power low warning threshold",
+ sd.rx_power, LWARN);
+ }
+
+}
+
diff --git a/sfpid.c b/sfpid.c
index a4a671d..2982d0d 100644
--- a/sfpid.c
+++ b/sfpid.c
@@ -12,7 +12,7 @@
static void sff8079_show_identifier(const __u8 *id)
{
- printf("\tIdentifier : 0x%02x", id[0]);
+ printf("\t%-41s : 0x%02x", "Identifier", id[0]);
switch (id[0]) {
case 0x00:
printf(" (no module present, unknown, or unspecified)\n");
@@ -34,7 +34,7 @@ static void sff8079_show_identifier(const __u8 *id)
static void sff8079_show_ext_identifier(const __u8 *id)
{
- printf("\tExtended identifier : 0x%02x", id[1]);
+ printf("\t%-41s : 0x%02x", "Extended identifier", id[1]);
if (id[1] == 0x00)
printf(" (GBIC not specified / not MOD_DEF compliant)\n");
else if (id[1] == 0x04)
@@ -47,7 +47,7 @@ static void sff8079_show_ext_identifier(const __u8 *id)
static void sff8079_show_connector(const __u8 *id)
{
- printf("\tConnector : 0x%02x", id[2]);
+ printf("\t%-41s : 0x%02x", "Connector", id[2]);
switch (id[2]) {
case 0x00:
printf(" (unknown or unspecified)\n");
@@ -105,10 +105,12 @@ static void sff8079_show_connector(const __u8 *id)
static void sff8079_show_transceiver(const __u8 *id)
{
- static const char *pfx = "\t : =>";
+ static const char *pfx =
+ "\tTransceiver type :";
- printf("\tTransceiver codes : 0x%02x 0x%02x 0x%02x" \
+ printf("\t%-41s : 0x%02x 0x%02x 0x%02x " \
"0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
+ "Transceiver codes",
id[3], id[4], id[5], id[6],
id[7], id[8], id[9], id[10]);
/* 10G Ethernet Compliance Codes */
@@ -239,7 +241,7 @@ static void sff8079_show_transceiver(const __u8 *id)
static void sff8079_show_encoding(const __u8 *id)
{
- printf("\tEncoding : 0x%02x", id[11]);
+ printf("\t%-41s : 0x%02x", "Encoding", id[11]);
switch (id[11]) {
case 0x00:
printf(" (unspecified)\n");
@@ -270,7 +272,7 @@ static void sff8079_show_encoding(const __u8 *id)
static void sff8079_show_rate_identifier(const __u8 *id)
{
- printf("\tRate identifier : 0x%02x", id[13]);
+ printf("\t%-41s : 0x%02x", "Rate identifier", id[13]);
switch (id[13]) {
case 0x00:
printf(" (unspecified)\n");
@@ -295,14 +297,14 @@ static void sff8079_show_rate_identifier(const __u8 *id)
static void sff8079_show_oui(const __u8 *id)
{
- printf("\tVendor OUI : %02x:%02x:%02x\n",
+ printf("\t%-41s : %02x:%02x:%02x\n", "Vendor OUI",
id[37], id[38], id[39]);
}
static void sff8079_show_wavelength_or_copper_compliance(const __u8 *id)
{
if (id[8] & (1 << 2)) {
- printf("\tPassive Cu cmplnce. : 0x%02x", id[60]);
+ printf("\t%-41s : 0x%02x", "Passive copper compliance", id[60]);
switch (id[60]) {
case 0x00:
printf(" (unspecified)");
@@ -316,7 +318,7 @@ static void sff8079_show_wavelength_or_copper_compliance(const __u8 *id)
}
printf(" [SFF-8472 rev10.4 only]\n");
} else if (id[8] & (1 << 3)) {
- printf("\tActive Cu cmplnce. : 0x%02x", id[60]);
+ printf("\t%-41s : 0x%02x", "Active copper compliance", id[60]);
switch (id[60]) {
case 0x00:
printf(" (unspecified)");
@@ -333,7 +335,7 @@ static void sff8079_show_wavelength_or_copper_compliance(const __u8 *id)
}
printf(" [SFF-8472 rev10.4 only]\n");
} else {
- printf("\tLaser wavelength : %unm\n",
+ printf("\t%-41s : %unm\n", "Laser wavelength",
(id[60] << 8) | id[61]);
}
}
@@ -344,7 +346,7 @@ static void sff8079_show_value_with_unit(const __u8 *id, unsigned int reg,
{
unsigned int val = id[reg];
- printf("\t%-20s: %u%s\n", name, val * mult, unit);
+ printf("\t%-41s : %u%s\n", name, val * mult, unit);
}
static void sff8079_show_ascii(const __u8 *id, unsigned int first_reg,
@@ -352,7 +354,7 @@ static void sff8079_show_ascii(const __u8 *id, unsigned int first_reg,
{
unsigned int reg, val;
- printf("\t%-20s: ", name);
+ printf("\t%-41s : ", name);
for (reg = first_reg; reg <= last_reg; reg++) {
val = id[reg];
putchar(((val >= 32) && (val <= 126)) ? val : '_');
@@ -368,14 +370,15 @@ void sff8079_show_all(const __u8 *id)
sff8079_show_connector(id);
sff8079_show_transceiver(id);
sff8079_show_encoding(id);
- sff8079_show_value_with_unit(id, 12, "BR, Nominal", 100, "MBd");
+ sff8079_show_value_with_unit(id, 12,
+ "Nominal signalling rate", 100, "MBd");
sff8079_show_rate_identifier(id);
sff8079_show_value_with_unit(id, 14,
- "Length (SMF,km)", 1, "km");
+ "Length (SMF,km)", 1, "km");
sff8079_show_value_with_unit(id, 15, "Length (SMF)", 100, "m");
sff8079_show_value_with_unit(id, 16, "Length (50um)", 10, "m");
sff8079_show_value_with_unit(id, 17,
- "Length (62.5um)", 10, "m");
+ "Length (62.5um)", 10, "m");
sff8079_show_value_with_unit(id, 18, "Length (Copper)", 1, "m");
sff8079_show_value_with_unit(id, 19, "Length (OM3)", 10, "m");
sff8079_show_wavelength_or_copper_compliance(id);
--
1.7.0.4
^ permalink raw reply related
* Re: PROBLEM: freeze when resuming from suspend-to-ram
From: Jan Janssen @ 2012-11-18 10:28 UTC (permalink / raw)
To: Francois Romieu; +Cc: Daniele Venzano, netdev
In-Reply-To: <20121117192036.GA29018@electric-eye.fr.zoreil.com>
On Saturday 17 November 2012 20:20:36 Francois Romieu wrote:
> Jan Janssen <medhefgo@web.de> :
> [...]
>
> > I'd be glad to help you with that. The bug happens with 3.6.6 and with
> > 3.7-
> > rc6. Pick one that suits you best, I can work with both.
>
> /me slaps head.
>
> Please try the patch below against v3.7-rc6
>
> diff --git a/drivers/net/ethernet/sis/sis900.c
> b/drivers/net/ethernet/sis/sis900.c index fb9f6b3..edf5edb 100644
> --- a/drivers/net/ethernet/sis/sis900.c
> +++ b/drivers/net/ethernet/sis/sis900.c
> @@ -2479,7 +2479,7 @@ static int sis900_resume(struct pci_dev *pci_dev)
> netif_start_queue(net_dev);
>
> /* Workaround for EDB */
> - sis900_set_mode(ioaddr, HW_SPEED_10_MBPS, FDX_CAPABLE_HALF_SELECTED);
> + sis900_set_mode(sis_priv, HW_SPEED_10_MBPS, FDX_CAPABLE_HALF_SELECTED);
>
> /* Enable all known interrupts by setting the interrupt mask. */
> sw32(imr, RxSOVR | RxORN | RxERR | RxOK | TxURN | TxERR | TxIDLE);
This seems to fix it. I was able to repeatedly suspend and resume.
On my first resume try I did get a netdev watchdog timeout right after I got
back to my shell prompt, but it wasn't reproducable. So, I'm assuming it's
some unrelated rc or hardware issue. Thought I might better mention it.
Jan
^ permalink raw reply
* Re: [rfc net-next v6 2/3] virtio_net: multiqueue support
From: Michael S. Tsirkin @ 2012-11-18 9:13 UTC (permalink / raw)
To: Ben Hutchings
Cc: krkumar2, kvm, netdev, linux-kernel, virtualization, edumazet,
davem
In-Reply-To: <1353112529.2743.83.camel@bwh-desktop.uk.solarflarecom.com>
On Sat, Nov 17, 2012 at 12:35:29AM +0000, Ben Hutchings wrote:
> On Tue, 2012-11-13 at 08:40 +0200, Michael S. Tsirkin wrote:
> > On Mon, Nov 05, 2012 at 11:38:39AM +1030, Rusty Russell wrote:
> > > > @@ -924,11 +1032,10 @@ static void virtnet_get_ringparam(struct net_device *dev,
> > > > {
> > > > struct virtnet_info *vi = netdev_priv(dev);
> > > >
> > > > - ring->rx_max_pending = virtqueue_get_vring_size(vi->rvq);
> > > > - ring->tx_max_pending = virtqueue_get_vring_size(vi->svq);
> > > > + ring->rx_max_pending = virtqueue_get_vring_size(vi->rq[0].vq);
> > > > + ring->tx_max_pending = virtqueue_get_vring_size(vi->sq[0].vq);
> > > > ring->rx_pending = ring->rx_max_pending;
> > > > ring->tx_pending = ring->tx_max_pending;
> > > > -
> > > > }
> > >
> > > This assumes all vqs are the same size. I think this should probably
> > > check: for mq mode, use the first vq, otherewise use the 0th.
> >
> > For rx_pending/tx_pending I think what is required here is the
> > actual number of outstanding buffers.
> > Dave, Eric - right?
> >
> > So this should be the total over all rings and to be useful,
> > rx_max_pending/tx_max_pending should be the total too.
>
> So far as I know, all current implementations use the number of
> descriptors per ring here. virtio_net should be consistent with this.
>
> Ben.
Problem is, it could in theory be different between rings. I guess we
could use the maximum.
What's the right thing to do for rx_pending - I am guessing
we want the current outstanding packets right?
> > > For bonus points, check this assertion at probe time.
> >
> > Looks like we can easily support different queues too.
> >
>
> --
> Ben Hutchings, Staff Engineer, Solarflare
> Not speaking for my employer; that's the marketing department's job.
> They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH net-next 1/3] mlx4_en: Remove remnants of LRO support
From: Amir Vadai @ 2012-11-18 9:09 UTC (permalink / raw)
To: Amir Vadai
Cc: Ben Hutchings, David Miller, netdev, Eric Dumazet, Or Gerlitz,
Roland Dreier
In-Reply-To: <CAPcc5Pi-xO8D5ndYTo7czuOAKSSMPHzAsvy5UoQ+-j1LVtE1Bw@mail.gmail.com>
I will also look at the checks in mlx4_en_process_rx_cq() as you suggested.
Amir.
On Sun, Nov 18, 2012 at 11:03 AM, Amir Vadai <amirv@mellanox.com> wrote:
> Acked-by: Amir Vadai <amirv@mellanox.com>
>
> On Sat, Nov 17, 2012 at 12:44 AM, Ben Hutchings
> <bhutchings@solarflare.com> wrote:
>> Commit fa37a9586f92051de03a13e55e5ec3880bb6783e ('mlx4_en: Moving to
>> work with GRO') left behind the Kconfig depends/select, some dead
>> code and comments referring to LRO.
>>
>> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
>> ---
>> The check for GRO eligibility in mlx4_en_process_rx_cq() should also be
>> redundant, but I didn't touch it.
>>
>> Ben.
>>
>> drivers/net/ethernet/mellanox/mlx4/Kconfig | 3 +--
>> drivers/net/ethernet/mellanox/mlx4/en_rx.c | 9 +++------
>> drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 17 -----------------
>> 3 files changed, 4 insertions(+), 25 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/mellanox/mlx4/Kconfig b/drivers/net/ethernet/mellanox/mlx4/Kconfig
>> index 5f027f9..eb520ab 100644
>> --- a/drivers/net/ethernet/mellanox/mlx4/Kconfig
>> +++ b/drivers/net/ethernet/mellanox/mlx4/Kconfig
>> @@ -4,9 +4,8 @@
>>
>> config MLX4_EN
>> tristate "Mellanox Technologies 10Gbit Ethernet support"
>> - depends on PCI && INET
>> + depends on PCI
>> select MLX4_CORE
>> - select INET_LRO
>> ---help---
>> This driver supports Mellanox Technologies ConnectX Ethernet
>> devices.
>> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
>> index 5aba5ec..f76c967 100644
>> --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
>> +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
>> @@ -630,7 +630,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
>> if ((cqe->status & cpu_to_be16(MLX4_CQE_STATUS_IPOK)) &&
>> (cqe->checksum == cpu_to_be16(0xffff))) {
>> ring->csum_ok++;
>> - /* This packet is eligible for LRO if it is:
>> + /* This packet is eligible for GRO if it is:
>> * - DIX Ethernet (type interpretation)
>> * - TCP/IP (v4)
>> * - without IP options
>> @@ -667,7 +667,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
>> goto next;
>> }
>>
>> - /* LRO not possible, complete processing here */
>> + /* GRO not possible, complete processing here */
>> ip_summed = CHECKSUM_UNNECESSARY;
>> } else {
>> ip_summed = CHECKSUM_NONE;
>> @@ -710,11 +710,8 @@ next:
>> ++cq->mcq.cons_index;
>> index = (cq->mcq.cons_index) & ring->size_mask;
>> cqe = &cq->buf[index];
>> - if (++polled == budget) {
>> - /* We are here because we reached the NAPI budget -
>> - * flush only pending LRO sessions */
>> + if (++polled == budget)
>> goto out;
>> - }
>> }
>>
>> out:
>> diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
>> index 9d27e42..1809a8b 100644
>> --- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
>> +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
>> @@ -95,8 +95,6 @@
>> #define MLX4_EN_ALLOC_SIZE PAGE_ALIGN(16384)
>> #define MLX4_EN_ALLOC_ORDER get_order(MLX4_EN_ALLOC_SIZE)
>>
>> -#define MLX4_EN_MAX_LRO_DESCRIPTORS 32
>> -
>> /* Receive fragment sizes; we use at most 4 fragments (for 9600 byte MTU
>> * and 4K allocations) */
>> enum {
>> @@ -290,21 +288,6 @@ struct mlx4_en_rx_ring {
>> unsigned long csum_none;
>> };
>>
>> -
>> -static inline int mlx4_en_can_lro(__be16 status)
>> -{
>> - return (status & cpu_to_be16(MLX4_CQE_STATUS_IPV4 |
>> - MLX4_CQE_STATUS_IPV4F |
>> - MLX4_CQE_STATUS_IPV6 |
>> - MLX4_CQE_STATUS_IPV4OPT |
>> - MLX4_CQE_STATUS_TCP |
>> - MLX4_CQE_STATUS_UDP |
>> - MLX4_CQE_STATUS_IPOK)) ==
>> - cpu_to_be16(MLX4_CQE_STATUS_IPV4 |
>> - MLX4_CQE_STATUS_IPOK |
>> - MLX4_CQE_STATUS_TCP);
>> -}
>> -
>> struct mlx4_en_cq {
>> struct mlx4_cq mcq;
>> struct mlx4_hwq_resources wqres;
>> --
>> 1.7.7.6
>>
>>
>>
>> --
>> Ben Hutchings, Staff Engineer, Solarflare
>> Not speaking for my employer; that's the marketing department's job.
>> They asked us to note that Solarflare product names are trademarked.
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH net-next 1/3] mlx4_en: Remove remnants of LRO support
From: Amir Vadai @ 2012-11-18 9:03 UTC (permalink / raw)
To: Ben Hutchings
Cc: David Miller, netdev, Eric Dumazet, Or Gerlitz, Roland Dreier
In-Reply-To: <1353105896.2743.53.camel@bwh-desktop.uk.solarflarecom.com>
Acked-by: Amir Vadai <amirv@mellanox.com>
On Sat, Nov 17, 2012 at 12:44 AM, Ben Hutchings
<bhutchings@solarflare.com> wrote:
> Commit fa37a9586f92051de03a13e55e5ec3880bb6783e ('mlx4_en: Moving to
> work with GRO') left behind the Kconfig depends/select, some dead
> code and comments referring to LRO.
>
> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
> ---
> The check for GRO eligibility in mlx4_en_process_rx_cq() should also be
> redundant, but I didn't touch it.
>
> Ben.
>
> drivers/net/ethernet/mellanox/mlx4/Kconfig | 3 +--
> drivers/net/ethernet/mellanox/mlx4/en_rx.c | 9 +++------
> drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 17 -----------------
> 3 files changed, 4 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/Kconfig b/drivers/net/ethernet/mellanox/mlx4/Kconfig
> index 5f027f9..eb520ab 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/Kconfig
> +++ b/drivers/net/ethernet/mellanox/mlx4/Kconfig
> @@ -4,9 +4,8 @@
>
> config MLX4_EN
> tristate "Mellanox Technologies 10Gbit Ethernet support"
> - depends on PCI && INET
> + depends on PCI
> select MLX4_CORE
> - select INET_LRO
> ---help---
> This driver supports Mellanox Technologies ConnectX Ethernet
> devices.
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
> index 5aba5ec..f76c967 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
> @@ -630,7 +630,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
> if ((cqe->status & cpu_to_be16(MLX4_CQE_STATUS_IPOK)) &&
> (cqe->checksum == cpu_to_be16(0xffff))) {
> ring->csum_ok++;
> - /* This packet is eligible for LRO if it is:
> + /* This packet is eligible for GRO if it is:
> * - DIX Ethernet (type interpretation)
> * - TCP/IP (v4)
> * - without IP options
> @@ -667,7 +667,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
> goto next;
> }
>
> - /* LRO not possible, complete processing here */
> + /* GRO not possible, complete processing here */
> ip_summed = CHECKSUM_UNNECESSARY;
> } else {
> ip_summed = CHECKSUM_NONE;
> @@ -710,11 +710,8 @@ next:
> ++cq->mcq.cons_index;
> index = (cq->mcq.cons_index) & ring->size_mask;
> cqe = &cq->buf[index];
> - if (++polled == budget) {
> - /* We are here because we reached the NAPI budget -
> - * flush only pending LRO sessions */
> + if (++polled == budget)
> goto out;
> - }
> }
>
> out:
> diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
> index 9d27e42..1809a8b 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
> +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
> @@ -95,8 +95,6 @@
> #define MLX4_EN_ALLOC_SIZE PAGE_ALIGN(16384)
> #define MLX4_EN_ALLOC_ORDER get_order(MLX4_EN_ALLOC_SIZE)
>
> -#define MLX4_EN_MAX_LRO_DESCRIPTORS 32
> -
> /* Receive fragment sizes; we use at most 4 fragments (for 9600 byte MTU
> * and 4K allocations) */
> enum {
> @@ -290,21 +288,6 @@ struct mlx4_en_rx_ring {
> unsigned long csum_none;
> };
>
> -
> -static inline int mlx4_en_can_lro(__be16 status)
> -{
> - return (status & cpu_to_be16(MLX4_CQE_STATUS_IPV4 |
> - MLX4_CQE_STATUS_IPV4F |
> - MLX4_CQE_STATUS_IPV6 |
> - MLX4_CQE_STATUS_IPV4OPT |
> - MLX4_CQE_STATUS_TCP |
> - MLX4_CQE_STATUS_UDP |
> - MLX4_CQE_STATUS_IPOK)) ==
> - cpu_to_be16(MLX4_CQE_STATUS_IPV4 |
> - MLX4_CQE_STATUS_IPOK |
> - MLX4_CQE_STATUS_TCP);
> -}
> -
> struct mlx4_en_cq {
> struct mlx4_cq mcq;
> struct mlx4_hwq_resources wqres;
> --
> 1.7.7.6
>
>
>
> --
> Ben Hutchings, Staff Engineer, Solarflare
> Not speaking for my employer; that's the marketing department's job.
> They asked us to note that Solarflare product names are trademarked.
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [net-next:master 83/84] drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1551:19: sparse: incorrect type in return expression (different base types)
From: kbuild test robot @ 2012-11-18 8:43 UTC (permalink / raw)
To: Sony Chacko; +Cc: netdev
tree: git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head: 75fe83c32248d99e6d5fe64155e519b78bb90481
commit: 6d973cb163aede0b4a414abfda42d1bc35bfd7f9 [83/84] qlcnic: fix sparse warnings
sparse warnings:
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1366:27: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1366:27: expected unsigned int [unsigned] [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1366:27: got restricted __le32 [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1369:19: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1383:14: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1383:14: expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1383:14: got restricted __le32 [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1384:16: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1384:16: expected unsigned char [unsigned] [usertype] no_ops
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1384:16: got restricted __le32 [usertype] no_ops
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1394:70: sparse: incorrect type in argument 3 (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1394:70: expected unsigned int [unsigned] [usertype] data
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1394:70: got restricted __le32 [usertype] val1
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1403:65: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1408:65: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1411:54: sparse: restricted __le16 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1413:56: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1413:70: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1418:50: sparse: restricted __le16 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1426:46: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1426:46: expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1426:46: got restricted __le32 <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1428:66: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1428:66: expected restricted __le32 <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1428:66: got unsigned int [unsigned] [addressable] [usertype] data
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1432:46: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1432:46: expected unsigned int [unsigned] [addressable] [usertype] data
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1432:46: got restricted __le32 <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1434:46: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1434:46: expected unsigned int [unsigned] [addressable] [usertype] data
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1434:46: got restricted __le32 [usertype] val1
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1436:46: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1436:46: expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1436:46: got restricted __le32 <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1440:38: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1440:38: expected unsigned int [unsigned] [addressable] [usertype] data
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1440:38: got restricted __le32 <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1444:46: sparse: invalid assignment: &=
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1444:46: left side has type unsigned int
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1444:46: right side has type restricted __le32
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1445:38: sparse: invalid assignment: |=
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1445:38: left side has type unsigned int
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1445:38: right side has type restricted __le32
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1446:38: sparse: invalid assignment: +=
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1446:38: left side has type unsigned int
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1446:38: right side has type restricted __le32
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1447:66: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1447:66: expected restricted __le32 <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1447:66: got unsigned int [unsigned] [addressable] [assigned] [usertype] data
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1469:13: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1469:13: expected unsigned int [unsigned] [usertype] val
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1469:13: got restricted __le32 [usertype] val
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1470:34: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1471:42: sparse: incorrect type in argument 1 (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1471:42: expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1471:42: got restricted __le32 [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1472:41: sparse: incorrect type in argument 1 (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1472:41: expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1472:41: got restricted __le32 [usertype] read_addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1473:27: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1473:27: expected unsigned int [unsigned] [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1473:27: got restricted __le32 [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1474:27: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1474:27: expected unsigned int [unsigned] [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1474:27: got restricted __le32 [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1475:21: sparse: invalid assignment: +=
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1475:21: left side has type unsigned int
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1475:21: right side has type restricted __le32
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1477:23: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1489:14: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1489:14: expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1489:14: got restricted __le32 [usertype] read_addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1492:34: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1493:42: sparse: incorrect type in argument 1 (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1493:42: expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1493:42: got restricted __le32 [usertype] sel_addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1494:22: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1494:22: expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1494:22: got restricted __le32 [usertype] read_addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1497:35: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1497:35: expected unsigned int [unsigned] [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1497:35: got restricted __le32 [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1500:24: sparse: invalid assignment: +=
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1500:24: left side has type unsigned int
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1500:24: right side has type restricted __le16
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1502:19: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1514:45: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1515:28: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1517:27: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1517:27: expected unsigned int [unsigned] [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1517:27: got restricted __le32 [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1518:28: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1520:19: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1532:17: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1532:17: expected unsigned int [unsigned] [usertype] fl_addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1532:17: got restricted __le32 [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1533:19: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1548:27: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1548:27: expected unsigned int [unsigned] [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1548:27: got restricted __le32 [usertype] <noident>
+ drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1551:19: sparse: incorrect type in return expression (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1551:19: expected unsigned int
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1551:19: got restricted __le32 [usertype] size
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1563:13: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1563:13: expected unsigned int [unsigned] [usertype] val
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1563:13: got restricted __le16 [usertype] init_tag_val
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1565:27: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1566:41: sparse: incorrect type in argument 1 (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1566:41: expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1566:41: got restricted __le32 [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1567:41: sparse: incorrect type in argument 1 (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1567:41: expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1567:41: got restricted __le32 [usertype] ctrl_addr
+ drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1567:60: sparse: cast from restricted __le32
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1568:22: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1568:22: expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1568:22: got restricted __le32 [usertype] read_addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1572:35: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1572:35: expected unsigned int [unsigned] [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1572:35: got restricted __le32 [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1576:21: sparse: invalid assignment: +=
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1576:21: left side has type unsigned int
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1576:21: right side has type restricted __le16
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1578:18: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1591:13: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1591:13: expected unsigned int [unsigned] [usertype] val
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1591:13: got restricted __le16 [usertype] init_tag_val
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1592:21: sparse: cast from restricted __le32
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1593:19: sparse: cast from restricted __le32
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1595:27: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1596:41: sparse: incorrect type in argument 1 (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1596:41: expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1596:41: got restricted __le32 [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1597:21: sparse: cast from restricted __le32
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1598:49: sparse: incorrect type in argument 1 (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1598:49: expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1598:49: got restricted __le32 [usertype] ctrl_addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1599:47: sparse: cast from restricted __le32
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1603:48: sparse: incorrect type in argument 1 (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1603:48: expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1603:48: got restricted __le32 [usertype] ctrl_addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1617:22: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1617:22: expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1617:22: got restricted __le32 [usertype] read_addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1621:35: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1621:35: expected unsigned int [unsigned] [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1621:35: got restricted __le32 [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1625:21: sparse: invalid assignment: +=
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1625:21: left side has type unsigned int
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1625:21: right side has type restricted __le16
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1627:18: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1639:18: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1639:18: expected int [signed] reg_read
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1639:18: got restricted __le32 [usertype] size
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1640:14: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1640:14: expected unsigned int [unsigned] [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1640:14: got restricted __le32 [usertype] addr
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1673:35: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1673:35: expected unsigned int [unsigned] [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1673:35: got restricted __le32 [usertype] <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1681:19: sparse: incorrect type in return expression (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1681:19: expected unsigned int
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1681:19: got restricted __le32 [usertype] size
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1721:31: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1749:33: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1750:35: sparse: invalid assignment: +=
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1750:35: left side has type int
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1750:35: right side has type restricted __le32
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1763:20: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1763:20: expected unsigned int [unsigned] [usertype] no_entries
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1763:20: got restricted __le32 [usertype] num_entries
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1765:22: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1765:22: expected unsigned int [unsigned] [usertype] entry_offset
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1765:22: got restricted __le32 [usertype] offset
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1766:31: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1766:31: expected restricted __le32 <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1766:31: got int
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1767:31: sparse: incorrect type in assignment (different base types)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1767:31: expected restricted __le32 <noident>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1767:31: got unsigned int [unsigned] [usertype] fw_version
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1771:49: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1773:38: sparse: invalid assignment: +=
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1773:38: left side has type unsigned int
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1773:38: right side has type restricted __le32
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1779:39: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1794:28: sparse: invalid assignment: +=
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1794:28: left side has type unsigned int
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1794:28: right side has type restricted __le32
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1795:30: sparse: invalid assignment: +=
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1795:30: left side has type unsigned int
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:1795:30: right side has type restricted __le32
vim +1551 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
18f2f616 drivers/net/qlcnic/qlcnic_hw.c Anirban Chakraborty 2011-05-12 1542 for (i = 0; i < size; i++) {
18f2f616 drivers/net/qlcnic/qlcnic_hw.c Anirban Chakraborty 2011-05-12 1543 addr = fl_addr & 0xFFFF0000;
6d973cb1 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c Sony Chacko 2012-11-17 1544 qlcnic_write_dump_reg(FLASH_ROM_WINDOW, base, addr);
18f2f616 drivers/net/qlcnic/qlcnic_hw.c Anirban Chakraborty 2011-05-12 1545 addr = LSW(fl_addr) + FLASH_ROM_DATA;
6d973cb1 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c Sony Chacko 2012-11-17 1546 qlcnic_read_dump_reg(addr, base, &val);
18f2f616 drivers/net/qlcnic/qlcnic_hw.c Anirban Chakraborty 2011-05-12 1547 fl_addr += 4;
18f2f616 drivers/net/qlcnic/qlcnic_hw.c Anirban Chakraborty 2011-05-12 @1548 *buffer++ = cpu_to_le32(val);
18f2f616 drivers/net/qlcnic/qlcnic_hw.c Anirban Chakraborty 2011-05-12 1549 }
18f2f616 drivers/net/qlcnic/qlcnic_hw.c Anirban Chakraborty 2011-05-12 1550 readl(base + QLCNIC_FLASH_SEM2_ULK);
18f2f616 drivers/net/qlcnic/qlcnic_hw.c Anirban Chakraborty 2011-05-12 @1551 return rom->size;
18f2f616 drivers/net/qlcnic/qlcnic_hw.c Anirban Chakraborty 2011-05-12 1552 }
18f2f616 drivers/net/qlcnic/qlcnic_hw.c Anirban Chakraborty 2011-05-12 1553
18f2f616 drivers/net/qlcnic/qlcnic_hw.c Anirban Chakraborty 2011-05-12 1554 static u32
18f2f616 drivers/net/qlcnic/qlcnic_hw.c Anirban Chakraborty 2011-05-12 1555 qlcnic_dump_l1_cache(struct qlcnic_adapter *adapter,
18f2f616 drivers/net/qlcnic/qlcnic_hw.c Anirban Chakraborty 2011-05-12 1556 struct qlcnic_dump_entry *entry, u32 *buffer)
18f2f616 drivers/net/qlcnic/qlcnic_hw.c Anirban Chakraborty 2011-05-12 1557 {
18f2f616 drivers/net/qlcnic/qlcnic_hw.c Anirban Chakraborty 2011-05-12 1558 int i;
18f2f616 drivers/net/qlcnic/qlcnic_hw.c Anirban Chakraborty 2011-05-12 1559 u32 cnt, val, data, addr;
18f2f616 drivers/net/qlcnic/qlcnic_hw.c Anirban Chakraborty 2011-05-12 1560 void __iomem *base = adapter->ahw->pci_base0;
18f2f616 drivers/net/qlcnic/qlcnic_hw.c Anirban Chakraborty 2011-05-12 1561 struct __cache *l1 = &entry->region.cache;
18f2f616 drivers/net/qlcnic/qlcnic_hw.c Anirban Chakraborty 2011-05-12 1562
18f2f616 drivers/net/qlcnic/qlcnic_hw.c Anirban Chakraborty 2011-05-12 1563 val = l1->init_tag_val;
18f2f616 drivers/net/qlcnic/qlcnic_hw.c Anirban Chakraborty 2011-05-12 1564
18f2f616 drivers/net/qlcnic/qlcnic_hw.c Anirban Chakraborty 2011-05-12 1565 for (i = 0; i < l1->no_ops; i++) {
6d973cb1 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c Sony Chacko 2012-11-17 1566 qlcnic_write_dump_reg(l1->addr, base, val);
6d973cb1 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c Sony Chacko 2012-11-17 @1567 qlcnic_write_dump_reg(l1->ctrl_addr, base, LSW(l1->ctrl_val));
18f2f616 drivers/net/qlcnic/qlcnic_hw.c Anirban Chakraborty 2011-05-12 1568 addr = l1->read_addr;
18f2f616 drivers/net/qlcnic/qlcnic_hw.c Anirban Chakraborty 2011-05-12 1569 cnt = l1->read_addr_num;
18f2f616 drivers/net/qlcnic/qlcnic_hw.c Anirban Chakraborty 2011-05-12 1570 while (cnt) {
---
0-DAY kernel build testing backend Open Source Technology Center
Fengguang Wu, Yuanhan Liu Intel Corporation
^ permalink raw reply
* Re: [PATCH] openvswitch: Make IPv6 packet parsing dependent on IPv6 config
From: David Miller @ 2012-11-18 7:34 UTC (permalink / raw)
To: vyasevic; +Cc: netdev, jesse, dev, fengguang.wu
In-Reply-To: <1353094881-28867-1-git-send-email-vyasevic@redhat.com>
From: Vlad Yasevich <vyasevic@redhat.com>
Date: Fri, 16 Nov 2012 14:41:21 -0500
> Ok. How about this approach instead. This keeps core functions we need
> still dependent on CONFIG_NET and makes new GSO stuff depend on CONFIG_INET
> since its quite useless without CONFIG_INET anyway...
...
> Subject: [PATCH] ipv6: Preserve ipv6 functionality needed by NET
>
> Some pieces of network use core pieces of IPv6 stack. Keep
> them available while letting new GSO offload pieces depend
> on CONFIG_INET.
>
> Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
Looks good, applied, thanks Vlad.
^ permalink raw reply
* Re: [PATCH 0/2] qlcnic: fix warnings
From: David Miller @ 2012-11-18 7:32 UTC (permalink / raw)
To: sony.chacko; +Cc: netdev, Dept_NX_Linux_NIC_Driver
In-Reply-To: <1353222279-15736-1-git-send-email-sony.chacko@qlogic.com>
From: Sony Chacko <sony.chacko@qlogic.com>
Date: Sun, 18 Nov 2012 02:04:37 -0500
> From: Sony Chacko <sony.chacko@qlogic.com>
>
> Please apply to net-next.
Both applied, thanks.
^ permalink raw reply
* [PATCH 0/2] qlcnic: fix warnings
From: Sony Chacko @ 2012-11-18 7:04 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept_NX_Linux_NIC_Driver, Sony Chacko
From: Sony Chacko <sony.chacko@qlogic.com>
Please apply to net-next.
Thanks,
Sony
^ permalink raw reply
* [PATCH 1/2] qlcnic: fix compiler warnings
From: Sony Chacko @ 2012-11-18 7:04 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept_NX_Linux_NIC_Driver, Sony Chacko
In-Reply-To: <1353222279-15736-1-git-send-email-sony.chacko@qlogic.com>
From: Sony Chacko <sony.chacko@qlogic.com>
Fix the following warnings:
qlcnic_main.c: In function 'qlcnic_update_cmd_producer':
qlcnic_main.c:119:51: warning: unused parameter 'adapter' [-Wunused-parameter]
qlcnic_main.c:119: warning: unused parameter adapter
qlcnic_init.c: In function qlcnic_process_lro
qlcnic_init.c:1586: warning: unused parameter sds_ring
qlcnic_init.c: In function qlcnic_process_rcv_diag
qlcnic_init.c:1854: warning: unused parameter sds_ring
qlcnic_init.c: In function qlcnic_fetch_mac
qlcnic_init.c:1938: warning: unused parameter adapter
warning: 'pci_using_dac' may be used uninitialized in this function [-Wmaybe-uninitialized]
qlcnic_main.c:1569:10: note: 'pci_using_dac' was declared here
Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
---
drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | 5 ++---
drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c | 2 +-
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c | 2 +-
drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c | 16 ++++++----------
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 17 +++++++----------
5 files changed, 17 insertions(+), 25 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
index eaa1db9..8b3d3b3 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
@@ -1530,9 +1530,8 @@ int qlcnic_set_features(struct net_device *netdev, netdev_features_t features);
int qlcnic_config_hw_lro(struct qlcnic_adapter *adapter, int enable);
int qlcnic_config_bridged_mode(struct qlcnic_adapter *adapter, u32 enable);
int qlcnic_send_lro_cleanup(struct qlcnic_adapter *adapter);
-void qlcnic_update_cmd_producer(struct qlcnic_adapter *adapter,
- struct qlcnic_host_tx_ring *tx_ring);
-void qlcnic_fetch_mac(struct qlcnic_adapter *, u32, u32, u8, u8 *);
+void qlcnic_update_cmd_producer(struct qlcnic_host_tx_ring *);
+void qlcnic_fetch_mac(u32, u32, u8, u8 *);
void qlcnic_process_rcv_ring_diag(struct qlcnic_host_sds_ring *sds_ring);
void qlcnic_clear_lb_mode(struct qlcnic_adapter *adapter);
int qlcnic_set_lb_mode(struct qlcnic_adapter *adapter, u8 mode);
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
index 2a179d0..bbd3b30 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
@@ -671,7 +671,7 @@ int qlcnic_get_mac_address(struct qlcnic_adapter *adapter, u8 *mac)
err = cmd.rsp.cmd;
if (err == QLCNIC_RCODE_SUCCESS)
- qlcnic_fetch_mac(adapter, cmd.rsp.arg1, cmd.rsp.arg2, 0, mac);
+ qlcnic_fetch_mac(cmd.rsp.arg1, cmd.rsp.arg2, 0, mac);
else {
dev_err(&adapter->pdev->dev,
"Failed to get mac address%d\n", err);
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
index 2a0c9dc..fc308c8 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
@@ -350,7 +350,7 @@ qlcnic_send_cmd_descs(struct qlcnic_adapter *adapter,
tx_ring->producer = producer;
- qlcnic_update_cmd_producer(adapter, tx_ring);
+ qlcnic_update_cmd_producer(tx_ring);
__netif_tx_unlock_bh(tx_ring->txq);
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c
index 0bcda9c..faae9c5 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c
@@ -1583,7 +1583,6 @@ qlcnic_process_rcv(struct qlcnic_adapter *adapter,
static struct qlcnic_rx_buffer *
qlcnic_process_lro(struct qlcnic_adapter *adapter,
- struct qlcnic_host_sds_ring *sds_ring,
int ring, u64 sts_data0, u64 sts_data1)
{
struct net_device *netdev = adapter->netdev;
@@ -1698,8 +1697,8 @@ qlcnic_process_rcv_ring(struct qlcnic_host_sds_ring *sds_ring, int max)
case QLCNIC_LRO_DESC:
ring = qlcnic_get_lro_sts_type(sts_data0);
sts_data1 = le64_to_cpu(desc->status_desc_data[1]);
- rxbuf = qlcnic_process_lro(adapter, sds_ring,
- ring, sts_data0, sts_data1);
+ rxbuf = qlcnic_process_lro(adapter, ring, sts_data0,
+ sts_data1);
break;
case QLCNIC_RESPONSE_DESC:
qlcnic_handle_fw_message(desc_cnt, consumer, sds_ring);
@@ -1850,9 +1849,8 @@ static void dump_skb(struct sk_buff *skb, struct qlcnic_adapter *adapter)
}
}
-void qlcnic_process_rcv_diag(struct qlcnic_adapter *adapter,
- struct qlcnic_host_sds_ring *sds_ring,
- int ring, u64 sts_data0)
+void qlcnic_process_rcv_diag(struct qlcnic_adapter *adapter, int ring,
+ u64 sts_data0)
{
struct qlcnic_recv_context *recv_ctx = adapter->recv_ctx;
struct sk_buff *skb;
@@ -1920,7 +1918,7 @@ qlcnic_process_rcv_ring_diag(struct qlcnic_host_sds_ring *sds_ring)
break;
default:
ring = qlcnic_get_sts_type(sts_data0);
- qlcnic_process_rcv_diag(adapter, sds_ring, ring, sts_data0);
+ qlcnic_process_rcv_diag(adapter, ring, sts_data0);
break;
}
@@ -1934,9 +1932,7 @@ qlcnic_process_rcv_ring_diag(struct qlcnic_host_sds_ring *sds_ring)
writel(consumer, sds_ring->crb_sts_consumer);
}
-void
-qlcnic_fetch_mac(struct qlcnic_adapter *adapter, u32 off1, u32 off2,
- u8 alt_mac, u8 *mac)
+void qlcnic_fetch_mac(u32 off1, u32 off2, u8 alt_mac, u8 *mac)
{
u32 mac_low, mac_high;
int i;
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 24ad17e..4109a41 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -115,9 +115,7 @@ static DEFINE_PCI_DEVICE_TABLE(qlcnic_pci_tbl) = {
MODULE_DEVICE_TABLE(pci, qlcnic_pci_tbl);
-inline void
-qlcnic_update_cmd_producer(struct qlcnic_adapter *adapter,
- struct qlcnic_host_tx_ring *tx_ring)
+inline void qlcnic_update_cmd_producer(struct qlcnic_host_tx_ring *tx_ring)
{
writel(tx_ring->producer, tx_ring->crb_cmd_producer);
}
@@ -1485,8 +1483,8 @@ qlcnic_reset_context(struct qlcnic_adapter *adapter)
}
static int
-qlcnic_setup_netdev(struct qlcnic_adapter *adapter,
- struct net_device *netdev, u8 pci_using_dac)
+qlcnic_setup_netdev(struct qlcnic_adapter *adapter, struct net_device *netdev,
+ int pci_using_dac)
{
int err;
struct pci_dev *pdev = adapter->pdev;
@@ -1506,7 +1504,7 @@ qlcnic_setup_netdev(struct qlcnic_adapter *adapter,
if (adapter->capabilities & QLCNIC_FW_CAPABILITY_TSO)
netdev->hw_features |= NETIF_F_TSO | NETIF_F_TSO6;
- if (pci_using_dac)
+ if (pci_using_dac == 1)
netdev->hw_features |= NETIF_F_HIGHDMA;
netdev->vlan_features = netdev->hw_features;
@@ -1530,7 +1528,7 @@ qlcnic_setup_netdev(struct qlcnic_adapter *adapter,
return 0;
}
-static int qlcnic_set_dma_mask(struct pci_dev *pdev, u8 *pci_using_dac)
+static int qlcnic_set_dma_mask(struct pci_dev *pdev, int *pci_using_dac)
{
if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) &&
!pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)))
@@ -1564,9 +1562,8 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{
struct net_device *netdev = NULL;
struct qlcnic_adapter *adapter = NULL;
- int err;
+ int err, pci_using_dac = -1;
uint8_t revision_id;
- uint8_t pci_using_dac;
char brd_name[QLCNIC_MAX_BOARD_NAME_LEN];
err = pci_enable_device(pdev);
@@ -2337,7 +2334,7 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
adapter->stats.txbytes += skb->len;
adapter->stats.xmitcalled++;
- qlcnic_update_cmd_producer(adapter, tx_ring);
+ qlcnic_update_cmd_producer(tx_ring);
return NETDEV_TX_OK;
--
1.8.0
^ permalink raw reply related
* [PATCH 2/2] qlcnic: fix sparse warnings
From: Sony Chacko @ 2012-11-18 7:04 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept_NX_Linux_NIC_Driver, Sony Chacko
In-Reply-To: <1353222279-15736-1-git-send-email-sony.chacko@qlogic.com>
From: Sony Chacko <sony.chacko@qlogic.com>
qlcnic_hw.c:1337:17: warning: cast removes address space of expression
qlcnic_hw.c:1337:17: warning: incorrect type in argument 2 (different address spaces)
qlcnic_hw.c:1337:17: expected void volatile [noderef] <asn:2>*addr
qlcnic_hw.c:1337:17: got void *<noident>
qlcnic_hw.c:1337:17: warning: cast removes address space of expression
qlcnic_hw.c:1337:17: warning: incorrect type in argument 1 (different address spaces)
qlcnic_hw.c:1337:17: expected void const volatile [noderef] <asn:2>*addr
qlcnic_hw.c:1337:17: got void *<noident>
The above warnings are originating from the macros QLCNIC_RD_DUMP_REG and
QLCNIC_WR_DUMP_REG.
The warnings are fixed and macros are replaced with equivalent functions
in the only file from where it is called.
The following warnings are fixed by making the functions static.
qlcnic_hw.c:543:5: warning: symbol 'qlcnic_set_fw_loopback' was not declared. Should it be static?
qlcnic_init.c:1853:6: warning: symbol 'qlcnic_process_rcv_diag' was not declared. Should it be static?
Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
---
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hdr.h | 16 ----
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c | 98 +++++++++++++++---------
drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c | 4 +-
3 files changed, 65 insertions(+), 53 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hdr.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hdr.h
index 28a6b28..bd5030e 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hdr.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hdr.h
@@ -792,22 +792,6 @@ static const u32 MIU_TEST_READ_DATA[] = {
#define QLCNIC_FLASH_SEM2_ULK 0x0013C014
#define QLCNIC_FLASH_LOCK_ID 0x001B2100
-#define QLCNIC_RD_DUMP_REG(addr, bar0, data) do { \
- writel((addr & 0xFFFF0000), (void *) (bar0 + \
- QLCNIC_FW_DUMP_REG1)); \
- readl((void *) (bar0 + QLCNIC_FW_DUMP_REG1)); \
- *data = readl((void *) (bar0 + QLCNIC_FW_DUMP_REG2 + \
- LSW(addr))); \
-} while (0)
-
-#define QLCNIC_WR_DUMP_REG(addr, bar0, data) do { \
- writel((addr & 0xFFFF0000), (void *) (bar0 + \
- QLCNIC_FW_DUMP_REG1)); \
- readl((void *) (bar0 + QLCNIC_FW_DUMP_REG1)); \
- writel(data, (void *) (bar0 + QLCNIC_FW_DUMP_REG2 + LSW(addr)));\
- readl((void *) (bar0 + QLCNIC_FW_DUMP_REG2 + LSW(addr))); \
-} while (0)
-
/* PCI function operational mode */
enum {
QLCNIC_MGMT_FUNC = 0,
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
index fc308c8..bd3e766 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
@@ -266,6 +266,33 @@ static const unsigned crb_hub_agt[64] = {
0,
};
+static void qlcnic_read_dump_reg(u32 addr, void __iomem *bar0, u32 *data)
+{
+ u32 dest;
+ void __iomem *window_reg;
+
+ dest = addr & 0xFFFF0000;
+ window_reg = bar0 + QLCNIC_FW_DUMP_REG1;
+ writel(dest, window_reg);
+ readl(window_reg);
+ window_reg = bar0 + QLCNIC_FW_DUMP_REG2 + LSW(addr);
+ *data = readl(window_reg);
+}
+
+static void qlcnic_write_dump_reg(u32 addr, void __iomem *bar0, u32 data)
+{
+ u32 dest;
+ void __iomem *window_reg;
+
+ dest = addr & 0xFFFF0000;
+ window_reg = bar0 + QLCNIC_FW_DUMP_REG1;
+ writel(dest, window_reg);
+ readl(window_reg);
+ window_reg = bar0 + QLCNIC_FW_DUMP_REG2 + LSW(addr);
+ writel(data, window_reg);
+ readl(window_reg);
+}
+
/* PCI Windowing for DDR regions. */
#define QLCNIC_PCIE_SEM_TIMEOUT 10000
@@ -540,7 +567,7 @@ void qlcnic_delete_lb_filters(struct qlcnic_adapter *adapter)
}
}
-int qlcnic_set_fw_loopback(struct qlcnic_adapter *adapter, u8 flag)
+static int qlcnic_set_fw_loopback(struct qlcnic_adapter *adapter, u8 flag)
{
struct qlcnic_nic_req req;
int rv;
@@ -1334,7 +1361,7 @@ qlcnic_dump_crb(struct qlcnic_adapter *adapter, struct qlcnic_dump_entry *entry,
addr = crb->addr;
for (i = 0; i < crb->no_ops; i++) {
- QLCNIC_RD_DUMP_REG(addr, base, &data);
+ qlcnic_read_dump_reg(addr, base, &data);
*buffer++ = cpu_to_le32(addr);
*buffer++ = cpu_to_le32(data);
addr += crb->stride;
@@ -1364,25 +1391,25 @@ qlcnic_dump_ctrl(struct qlcnic_adapter *adapter,
continue;
switch (1 << k) {
case QLCNIC_DUMP_WCRB:
- QLCNIC_WR_DUMP_REG(addr, base, ctr->val1);
+ qlcnic_write_dump_reg(addr, base, ctr->val1);
break;
case QLCNIC_DUMP_RWCRB:
- QLCNIC_RD_DUMP_REG(addr, base, &data);
- QLCNIC_WR_DUMP_REG(addr, base, data);
+ qlcnic_read_dump_reg(addr, base, &data);
+ qlcnic_write_dump_reg(addr, base, data);
break;
case QLCNIC_DUMP_ANDCRB:
- QLCNIC_RD_DUMP_REG(addr, base, &data);
- QLCNIC_WR_DUMP_REG(addr, base,
- (data & ctr->val2));
+ qlcnic_read_dump_reg(addr, base, &data);
+ qlcnic_write_dump_reg(addr, base,
+ data & ctr->val2);
break;
case QLCNIC_DUMP_ORCRB:
- QLCNIC_RD_DUMP_REG(addr, base, &data);
- QLCNIC_WR_DUMP_REG(addr, base,
- (data | ctr->val3));
+ qlcnic_read_dump_reg(addr, base, &data);
+ qlcnic_write_dump_reg(addr, base,
+ data | ctr->val3);
break;
case QLCNIC_DUMP_POLLCRB:
while (timeout <= ctr->timeout) {
- QLCNIC_RD_DUMP_REG(addr, base, &data);
+ qlcnic_read_dump_reg(addr, base, &data);
if ((data & ctr->val2) == ctr->val1)
break;
msleep(1);
@@ -1397,7 +1424,7 @@ qlcnic_dump_ctrl(struct qlcnic_adapter *adapter,
case QLCNIC_DUMP_RD_SAVE:
if (ctr->index_a)
addr = t_hdr->saved_state[ctr->index_a];
- QLCNIC_RD_DUMP_REG(addr, base, &data);
+ qlcnic_read_dump_reg(addr, base, &data);
t_hdr->saved_state[ctr->index_v] = data;
break;
case QLCNIC_DUMP_WRT_SAVED:
@@ -1407,7 +1434,7 @@ qlcnic_dump_ctrl(struct qlcnic_adapter *adapter,
data = ctr->val1;
if (ctr->index_a)
addr = t_hdr->saved_state[ctr->index_a];
- QLCNIC_WR_DUMP_REG(addr, base, data);
+ qlcnic_write_dump_reg(addr, base, data);
break;
case QLCNIC_DUMP_MOD_SAVE_ST:
data = t_hdr->saved_state[ctr->index_v];
@@ -1441,8 +1468,8 @@ qlcnic_dump_mux(struct qlcnic_adapter *adapter, struct qlcnic_dump_entry *entry,
val = mux->val;
for (loop = 0; loop < mux->no_ops; loop++) {
- QLCNIC_WR_DUMP_REG(mux->addr, base, val);
- QLCNIC_RD_DUMP_REG(mux->read_addr, base, &data);
+ qlcnic_write_dump_reg(mux->addr, base, val);
+ qlcnic_read_dump_reg(mux->read_addr, base, &data);
*buffer++ = cpu_to_le32(val);
*buffer++ = cpu_to_le32(data);
val += mux->val_stride;
@@ -1463,10 +1490,10 @@ qlcnic_dump_que(struct qlcnic_adapter *adapter, struct qlcnic_dump_entry *entry,
cnt = que->read_addr_cnt;
for (loop = 0; loop < que->no_ops; loop++) {
- QLCNIC_WR_DUMP_REG(que->sel_addr, base, que_id);
+ qlcnic_write_dump_reg(que->sel_addr, base, que_id);
addr = que->read_addr;
for (i = 0; i < cnt; i++) {
- QLCNIC_RD_DUMP_REG(addr, base, &data);
+ qlcnic_read_dump_reg(addr, base, &data);
*buffer++ = cpu_to_le32(data);
addr += que->read_addr_stride;
}
@@ -1514,9 +1541,9 @@ lock_try:
writel(adapter->ahw->pci_func, (base + QLCNIC_FLASH_LOCK_ID));
for (i = 0; i < size; i++) {
addr = fl_addr & 0xFFFF0000;
- QLCNIC_WR_DUMP_REG(FLASH_ROM_WINDOW, base, addr);
+ qlcnic_write_dump_reg(FLASH_ROM_WINDOW, base, addr);
addr = LSW(fl_addr) + FLASH_ROM_DATA;
- QLCNIC_RD_DUMP_REG(addr, base, &val);
+ qlcnic_read_dump_reg(addr, base, &val);
fl_addr += 4;
*buffer++ = cpu_to_le32(val);
}
@@ -1536,12 +1563,12 @@ qlcnic_dump_l1_cache(struct qlcnic_adapter *adapter,
val = l1->init_tag_val;
for (i = 0; i < l1->no_ops; i++) {
- QLCNIC_WR_DUMP_REG(l1->addr, base, val);
- QLCNIC_WR_DUMP_REG(l1->ctrl_addr, base, LSW(l1->ctrl_val));
+ qlcnic_write_dump_reg(l1->addr, base, val);
+ qlcnic_write_dump_reg(l1->ctrl_addr, base, LSW(l1->ctrl_val));
addr = l1->read_addr;
cnt = l1->read_addr_num;
while (cnt) {
- QLCNIC_RD_DUMP_REG(addr, base, &data);
+ qlcnic_read_dump_reg(addr, base, &data);
*buffer++ = cpu_to_le32(data);
addr += l1->read_addr_stride;
cnt--;
@@ -1566,14 +1593,14 @@ qlcnic_dump_l2_cache(struct qlcnic_adapter *adapter,
poll_to = MSB(MSW(l2->ctrl_val));
for (i = 0; i < l2->no_ops; i++) {
- QLCNIC_WR_DUMP_REG(l2->addr, base, val);
+ qlcnic_write_dump_reg(l2->addr, base, val);
if (LSW(l2->ctrl_val))
- QLCNIC_WR_DUMP_REG(l2->ctrl_addr, base,
- LSW(l2->ctrl_val));
+ qlcnic_write_dump_reg(l2->ctrl_addr, base,
+ LSW(l2->ctrl_val));
if (!poll_mask)
goto skip_poll;
do {
- QLCNIC_RD_DUMP_REG(l2->ctrl_addr, base, &data);
+ qlcnic_read_dump_reg(l2->ctrl_addr, base, &data);
if (!(data & poll_mask))
break;
msleep(1);
@@ -1590,7 +1617,7 @@ skip_poll:
addr = l2->read_addr;
cnt = l2->read_addr_num;
while (cnt) {
- QLCNIC_RD_DUMP_REG(addr, base, &data);
+ qlcnic_read_dump_reg(addr, base, &data);
*buffer++ = cpu_to_le32(data);
addr += l2->read_addr_stride;
cnt--;
@@ -1622,13 +1649,13 @@ qlcnic_read_memory(struct qlcnic_adapter *adapter,
mutex_lock(&adapter->ahw->mem_lock);
while (reg_read != 0) {
- QLCNIC_WR_DUMP_REG(MIU_TEST_ADDR_LO, base, addr);
- QLCNIC_WR_DUMP_REG(MIU_TEST_ADDR_HI, base, 0);
- QLCNIC_WR_DUMP_REG(MIU_TEST_CTR, base,
- TA_CTL_ENABLE | TA_CTL_START);
+ qlcnic_write_dump_reg(MIU_TEST_ADDR_LO, base, addr);
+ qlcnic_write_dump_reg(MIU_TEST_ADDR_HI, base, 0);
+ qlcnic_write_dump_reg(MIU_TEST_CTR, base,
+ TA_CTL_ENABLE | TA_CTL_START);
for (i = 0; i < MAX_CTL_CHECK; i++) {
- QLCNIC_RD_DUMP_REG(MIU_TEST_CTR, base, &test);
+ qlcnic_read_dump_reg(MIU_TEST_CTR, base, &test);
if (!(test & TA_CTL_BUSY))
break;
}
@@ -1641,7 +1668,8 @@ qlcnic_read_memory(struct qlcnic_adapter *adapter,
}
}
for (i = 0; i < 4; i++) {
- QLCNIC_RD_DUMP_REG(MIU_TEST_READ_DATA[i], base, &data);
+ qlcnic_read_dump_reg(MIU_TEST_READ_DATA[i], base,
+ &data);
*buffer++ = cpu_to_le32(data);
}
addr += 16;
@@ -1661,7 +1689,7 @@ qlcnic_dump_nop(struct qlcnic_adapter *adapter,
return 0;
}
-struct qlcnic_dump_operations fw_dump_ops[] = {
+static const struct qlcnic_dump_operations fw_dump_ops[] = {
{ QLCNIC_DUMP_NOP, qlcnic_dump_nop },
{ QLCNIC_DUMP_READ_CRB, qlcnic_dump_crb },
{ QLCNIC_DUMP_READ_MUX, qlcnic_dump_mux },
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c
index faae9c5..a7f5bbe 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c
@@ -1849,8 +1849,8 @@ static void dump_skb(struct sk_buff *skb, struct qlcnic_adapter *adapter)
}
}
-void qlcnic_process_rcv_diag(struct qlcnic_adapter *adapter, int ring,
- u64 sts_data0)
+static void qlcnic_process_rcv_diag(struct qlcnic_adapter *adapter, int ring,
+ u64 sts_data0)
{
struct qlcnic_recv_context *recv_ctx = adapter->recv_ctx;
struct sk_buff *skb;
--
1.8.0
^ permalink raw reply related
* [PATCH RFC 2/2] ixp4xx_hss: avoid calling dma_pool_create() with NULL dev
From: Xi Wang @ 2012-11-18 6:25 UTC (permalink / raw)
To: Krzysztof Halasa; +Cc: netdev, Xi Wang, Andrew Morton
In-Reply-To: <1353219910-24690-1-git-send-email-xi.wang@gmail.com>
Use &port->netdev->dev instead of NULL since dma_pool_create() doesn't
allow NULL dev.
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
See also
https://lkml.org/lkml/2012/11/14/11
---
drivers/net/wan/ixp4xx_hss.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c
index 3f575af..e9a3da5 100644
--- a/drivers/net/wan/ixp4xx_hss.c
+++ b/drivers/net/wan/ixp4xx_hss.c
@@ -969,10 +969,12 @@ static int init_hdlc_queues(struct port *port)
{
int i;
- if (!ports_open)
- if (!(dma_pool = dma_pool_create(DRV_NAME, NULL,
- POOL_ALLOC_SIZE, 32, 0)))
+ if (!ports_open) {
+ dma_pool = dma_pool_create(DRV_NAME, &port->netdev->dev,
+ POOL_ALLOC_SIZE, 32, 0);
+ if (!dma_pool)
return -ENOMEM;
+ }
if (!(port->desc_tab = dma_pool_alloc(dma_pool, GFP_KERNEL,
&port->desc_tab_phys)))
--
1.7.10.4
^ permalink raw reply related
* [PATCH RFC 1/2] ixp4xx_eth: avoid calling dma_pool_create() with NULL dev
From: Xi Wang @ 2012-11-18 6:25 UTC (permalink / raw)
To: Krzysztof Halasa; +Cc: netdev, Xi Wang, Andrew Morton
Use &port->netdev->dev instead of NULL since dma_pool_create() doesn't
allow NULL dev.
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
See also
https://lkml.org/lkml/2012/11/14/11
---
drivers/net/ethernet/xscale/ixp4xx_eth.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c
index 98934bd..477d672 100644
--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c
+++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c
@@ -1102,10 +1102,12 @@ static int init_queues(struct port *port)
{
int i;
- if (!ports_open)
- if (!(dma_pool = dma_pool_create(DRV_NAME, NULL,
- POOL_ALLOC_SIZE, 32, 0)))
+ if (!ports_open) {
+ dma_pool = dma_pool_create(DRV_NAME, &port->netdev->dev,
+ POOL_ALLOC_SIZE, 32, 0);
+ if (!dma_pool)
return -ENOMEM;
+ }
if (!(port->desc_tab = dma_pool_alloc(dma_pool, GFP_KERNEL,
&port->desc_tab_phys)))
--
1.7.10.4
^ permalink raw reply related
* Re: [PATCH net-next 2/2] PPC: net: bpf_jit_comp: add VLAN instructions for BPF JIT
From: David Miller @ 2012-11-18 3:13 UTC (permalink / raw)
To: matt; +Cc: dxchgb, benh, netdev
In-Reply-To: <45EBCE3A-FE92-4A8D-B5D8-DED4E30DF419@ozlabs.org>
From: Matt Evans <matt@ozlabs.org>
Date: Sat, 17 Nov 2012 00:06:03 +0000
> Hi,
>
> On 08/11/2012, at 9:41 PM, Daniel Borkmann wrote:
>
>> This patch is a follow-up for patch "net: filter: add vlan tag access"
>> to support the new VLAN_TAG/VLAN_TAG_PRESENT accessors in BPF JIT.
>>
>> Signed-off-by: Daniel Borkmann <daniel.borkmann@tik.ee.ethz.ch>
>> Cc: Matt Evans <matt@ozlabs.org>
>> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> ---
>> Disclaimer: uncompiled and untested, since I don't have a PPC machine,
>> but it should (hopefully) integrate cleanly; impl. after PPC instruction
>> reference.
>
> And for this too,
>
> Acked-by: Matt Evans <matt@ozlabs.org>
>
> Sorry for the delay in reviewing this!
Applied, thanks for reviewing.
^ permalink raw reply
* Re: [PATCH net-next 1/2] PPC: net: bpf_jit_comp: add XOR instruction for BPF JIT
From: David Miller @ 2012-11-18 3:13 UTC (permalink / raw)
To: matt; +Cc: dxchgb, benh, netdev
In-Reply-To: <744A32A4-3F1F-4253-9ECB-59DBCC240847@ozlabs.org>
From: Matt Evans <matt@ozlabs.org>
Date: Sat, 17 Nov 2012 00:00:38 +0000
> Hi Daniel,
>
>
> On 08/11/2012, at 9:39 PM, Daniel Borkmann wrote:
>
>> This patch is a follow-up for patch "filter: add XOR instruction for use
>> with X/K" that implements BPF PowerPC JIT parts for the BPF XOR operation.
>>
>> Signed-off-by: Daniel Borkmann <daniel.borkmann@tik.ee.ethz.ch>
>> Cc: Matt Evans <matt@ozlabs.org>
>> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> ---
>> Disclaimer: uncompiled and untested, since I don't have a PPC machine,
>> but it should (hopefully) integrate cleanly; impl. after PPC instruction
>> reference.
>
> Unfortunately I can only compile and test this mentally, but it looks fine, instruction formats correct etc. Thanks!
>
>
> Acked-by: Matt Evans <matt@ozlabs.org>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] pch_gbe, ptp_pch: Fix the dependency direction between these drivers
From: David Miller @ 2012-11-18 3:12 UTC (permalink / raw)
To: rdunlap; +Cc: bhutchings, netdev, tshimizu818, richardcochran
In-Reply-To: <50A6F01C.4010304@xenotime.net>
From: Randy Dunlap <rdunlap@xenotime.net>
Date: Fri, 16 Nov 2012 18:02:04 -0800
> On 11/16/2012 05:43 PM, Ben Hutchings wrote:
>
>> In commit a24006ed12616bde1bbdb26868495906a212d8dc ('ptp: Enable clock
>> drivers along with associated net/PHY drivers') I wrongly made
>> PTP_1588_CLOCK_PCH depend on PCH_GBE. The dependency is really the
>> other way around. Therefore make PCH_GBE select PTP_1588_CLOCK_PCH
>> and remove the 'default y' from the latter.
>>
>> Reported-by: Randy Dunlap <rdunlap@xenotime.net>
>> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
>
>
> Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Applied, thanks everyone.
^ permalink raw reply
* Re: [net-next patch] vxlan: remove unused variable.
From: David Miller @ 2012-11-18 3:02 UTC (permalink / raw)
To: shemminger; +Cc: ramirose, netdev
In-Reply-To: <20121117095225.48bd9ab1@nehalam.linuxnetplumber.net>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Sat, 17 Nov 2012 09:52:25 -0800
> On Sat, 17 Nov 2012 16:08:07 +0200
> Rami Rosen <ramirose@gmail.com> wrote:
>
>> This patch removes addrexceeded member from vxlan_dev struct as it is unused.
>>
>> Signed-off-by: Rami Rosen <ramirose@gmail.com>
...
> Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] sctp: use bitmap_weight
From: David Miller @ 2012-11-18 3:01 UTC (permalink / raw)
To: vyasevich; +Cc: akinobu.mita, linux-sctp, sri, netdev
In-Reply-To: <50A83DAF.8000408@gmail.com>
From: Vlad Yasevich <vyasevich@gmail.com>
Date: Sat, 17 Nov 2012 20:45:19 -0500
> On 11/17/2012 01:39 AM, Akinobu Mita wrote:
>> Use bitmap_weight to count the total number of bits set in bitmap.
>>
>> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
>> Cc: Vlad Yasevich <vyasevich@gmail.com>
>> Cc: Sridhar Samudrala <sri@us.ibm.com>
>> Cc: linux-sctp@vger.kernel.org
>> Cc: netdev@vger.kernel.org
>
> Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] sctp: use bitmap_weight
From: Vlad Yasevich @ 2012-11-18 1:45 UTC (permalink / raw)
To: Akinobu Mita; +Cc: linux-sctp, Sridhar Samudrala, netdev
In-Reply-To: <1353134389-25583-1-git-send-email-akinobu.mita@gmail.com>
On 11/17/2012 01:39 AM, Akinobu Mita wrote:
> Use bitmap_weight to count the total number of bits set in bitmap.
>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: Vlad Yasevich <vyasevich@gmail.com>
> Cc: Sridhar Samudrala <sri@us.ibm.com>
> Cc: linux-sctp@vger.kernel.org
> Cc: netdev@vger.kernel.org
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
-vlad
> ---
> net/sctp/tsnmap.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/net/sctp/tsnmap.c b/net/sctp/tsnmap.c
> index b5fb7c4..5f25e0c 100644
> --- a/net/sctp/tsnmap.c
> +++ b/net/sctp/tsnmap.c
> @@ -272,7 +272,7 @@ __u16 sctp_tsnmap_pending(struct sctp_tsnmap *map)
> __u32 max_tsn = map->max_tsn_seen;
> __u32 base_tsn = map->base_tsn;
> __u16 pending_data;
> - u32 gap, i;
> + u32 gap;
>
> pending_data = max_tsn - cum_tsn;
> gap = max_tsn - base_tsn;
> @@ -280,11 +280,7 @@ __u16 sctp_tsnmap_pending(struct sctp_tsnmap *map)
> if (gap == 0 || gap >= map->len)
> goto out;
>
> - for (i = 0; i < gap+1; i++) {
> - if (test_bit(i, map->tsn_map))
> - pending_data--;
> - }
> -
> + pending_data -= bitmap_weight(map->tsn_map, gap + 1);
> out:
> return pending_data;
> }
>
^ permalink raw reply
* Re: [tcpdump-workers] vlan tagged packets and libpcap breakage
From: Eric W. Biederman @ 2012-11-17 23:37 UTC (permalink / raw)
To: Daniel Borkmann
Cc: Michael Richardson, tcpdump-workers, Ani Sinha, netdev,
Francesco Ruggeri
In-Reply-To: <CAD6jFUQguS0oqGuA-HDFV2gd9m_=kZAvKJJq3ymr8zWM2cePXw@mail.gmail.com>
Daniel Borkmann <danborkmann@iogearbox.net> writes:
> Speaking of netsniff-ng where we don't reconstruct VLAN headers, users
> have reported that depending on the NIC/driver resp. ethtool setting,
> they can come in stripped or not (in the pf_packet's rx_ring buffer).
> However, I assume VLAN AUXDATA is always consistent (and so the
> BPF/BPF JIT filtering).
Yes it was a mess before we added software stripping of the vlan headers
a year ago.
Eric
^ permalink raw reply
* Re: [tcpdump-workers] vlan tagged packets and libpcap breakage
From: Eric W. Biederman @ 2012-11-17 23:33 UTC (permalink / raw)
To: Michael Richardson; +Cc: tcpdump-workers, Ani Sinha, netdev, Francesco Ruggeri
In-Reply-To: <12918.1353190488@obiwan.sandelman.ca>
Michael Richardson <mcr@sandelman.ca> writes:
> Thank you for this reply.
>
>>>>>> "Eric" == Eric W Biederman <ebiederm@xmission.com> writes:
> Eric> I don't see any need to add any kernel code to allow checking
> Eric> if vlan tags are stripped. Vlan headers are stripped on all
> Eric> kernel interfaces today. Vlan headers have been stripped on
> Eric> all but a handful of software interfaces for 6+ years. For
> Eric> all kernels if the vlan header is stripped it is reported in
> Eric> the auxdata, upon packet reception. Careful code should also
> Eric> look for TP_STATUS_VLAN_VALID which allows for distinguishing
> Eric> a striped vlan header of 0 from no vlan header.
>
> I can regularly see vlan tags on raw dumps from the untagged ("eth0")
> today, running 3.2 (debian stable):
>
> obiwan-[~] mcr 4848 %sudo tcpdump -i eth0 -n -p -e | grep -i vlan
> listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
> 17:05:15.404909 38:60:77:38:e6:47 > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 46: vlan 3800, p 0, ethertype ARP, Request who-has 172.30.42.1 tell 172.30.42.11, length 28
>
> So, I'm curious about the statement that vlan tags have been stripped
> for some time, because I don't see them stripped today. My desktop has
> an Intel 82579V NIC in it...
So I just took a quick look at libpcap 1.1.1.1.
In pcap_read_packet in pcap-linux.c the code to readd the vlan header is
protected by HAVE_PACKET_AUXDATA.
In pcap_read_linux_mmap in pcap-linux.c the code to readd the vlan
header is protected by HAVE_TPACKET2.
That code is shifting the the ethernet header up 4 bytes and inserting
the vlan header in packets as we receive them.
The code is correct except for the case of packets in vlan 0. Currently
the packet reconstruction is ambiguous. The most recent kernels have
a TP_STATUS_VLAN_VALID flag that can be checked to see if the packet was
in vlan 0 or if there was no vlan at all. libpcap probably should be
taught how to handle TP_STATUS_VLAN_VALID so that it can get the vlan 0
handling correct.
> Eric> For old kernels that do not support the new extensions it is
> Eric> possible to generate code that looks at the ethernet header
> Eric> and sees if the ethertype is 0x8100 and then does things with
> Eric> it, but that will only work on a small handful of software
> Eric> only interfaces.
>
> at tcpdump.org, our concern is to release code that works on both new,
> and what for kernel.org folks would be considered "ancient" systems,
> such as Centos5/RHEL5 machines which are regularly still in production
> in the field (sadly...), but often need the latest diagnostics.
> What I hear you saying is that our existing code will work on older
> kernels, and that once we have new code to use the VLAN tag extensions,
> we should simply attempt to load it, and either it loads, or we get an
> error, and we go back to the code we had before. That's great news.
The existing code will work as well as anything if you don't have the
VLAN tag extensions. If you are not using the VLAN tag extensions there
is no reliable way to filter for vlan tagged packets in the kernel as on
most network devices (all for the last year) the vlan header has been
stripped at the time the bpf filter is run.
So yes. Just falling back to the existing code seems as good as it is
going to get. Which isn't very good but it took 5+ years before people
cared enough to get this fixed. :(
> The major concern is that if the 802.1q header is gone, although we can
> retrieve it somehow (I'm not sure how the AUXDATA is presented on the
> MMAP PF_PACKET interface...) we will have to reconstruct it in order to
> save it properly to a savefile. Many entities, including most major
> Network Telescopes (http://en.wikipedia.org/wiki/Network_telescope) use
> libpcap (and often tcpdump itself) to capture packets on probe points,
> and having good performance matters here...
Yes. I wasn't looking at the mmap path. The vlan information is
present in the tpacket2_hdr and tpacket3_hdr structures that accompany
packets read with the mmap interface. The old tpacket1_hdr doesn't
support the vlan_tci information so that won't work.
Not having the vlan header on the packet when the bpf filter is run is
justified by performance, and likewise reading vlan tagged packets to
userspace with the vlan header stripped is justified by performance.
Eric
^ permalink raw reply
* Re: [tcpdump-workers] vlan tagged packets and libpcap breakage
From: Daniel Borkmann @ 2012-11-17 23:16 UTC (permalink / raw)
To: Michael Richardson
Cc: tcpdump-workers, Eric W. Biederman, Ani Sinha, netdev,
Francesco Ruggeri
In-Reply-To: <12918.1353190488@obiwan.sandelman.ca>
On Sat, Nov 17, 2012 at 11:14 PM, Michael Richardson <mcr@sandelman.ca> wrote:
>
> Thank you for this reply.
>
>>>>>> "Eric" == Eric W Biederman <ebiederm@xmission.com> writes:
> Eric> I don't see any need to add any kernel code to allow checking
> Eric> if vlan tags are stripped. Vlan headers are stripped on all
> Eric> kernel interfaces today. Vlan headers have been stripped on
> Eric> all but a handful of software interfaces for 6+ years. For
> Eric> all kernels if the vlan header is stripped it is reported in
> Eric> the auxdata, upon packet reception. Careful code should also
> Eric> look for TP_STATUS_VLAN_VALID which allows for distinguishing
> Eric> a striped vlan header of 0 from no vlan header.
>
> I can regularly see vlan tags on raw dumps from the untagged ("eth0")
> today, running 3.2 (debian stable):
>
> obiwan-[~] mcr 4848 %sudo tcpdump -i eth0 -n -p -e | grep -i vlan
> listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
> 17:05:15.404909 38:60:77:38:e6:47 > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 46: vlan 3800, p 0, ethertype ARP, Request who-has 172.30.42.1 tell 172.30.42.11, length 28
>
> So, I'm curious about the statement that vlan tags have been stripped
> for some time, because I don't see them stripped today. My desktop has
> an Intel 82579V NIC in it...
Speaking of netsniff-ng where we don't reconstruct VLAN headers, users
have reported that depending on the NIC/driver resp. ethtool setting,
they can come in stripped or not (in the pf_packet's rx_ring buffer).
However, I assume VLAN AUXDATA is always consistent (and so the
BPF/BPF JIT filtering).
> Eric> For old kernels that do not support the new extensions it is
> Eric> possible to generate code that looks at the ethernet header
> Eric> and sees if the ethertype is 0x8100 and then does things with
> Eric> it, but that will only work on a small handful of software
> Eric> only interfaces.
>
> at tcpdump.org, our concern is to release code that works on both new,
> and what for kernel.org folks would be considered "ancient" systems,
> such as Centos5/RHEL5 machines which are regularly still in production
> in the field (sadly...), but often need the latest diagnostics.
>
> What I hear you saying is that our existing code will work on older
> kernels, and that once we have new code to use the VLAN tag extensions,
> we should simply attempt to load it, and either it loads, or we get an
> error, and we go back to the code we had before. That's great news.
Yes, this should be handled in such a way.
^ permalink raw reply
* Re: [tcpdump-workers] vlan tagged packets and libpcap breakage
From: Michael Richardson @ 2012-11-17 22:14 UTC (permalink / raw)
To: tcpdump-workers, Eric W. Biederman; +Cc: Ani Sinha, netdev, Francesco Ruggeri
In-Reply-To: <87mwyi9h1x.fsf@xmission.com>
[-- Attachment #1: Type: text/plain, Size: 3011 bytes --]
Thank you for this reply.
>>>>> "Eric" == Eric W Biederman <ebiederm@xmission.com> writes:
Eric> I don't see any need to add any kernel code to allow checking
Eric> if vlan tags are stripped. Vlan headers are stripped on all
Eric> kernel interfaces today. Vlan headers have been stripped on
Eric> all but a handful of software interfaces for 6+ years. For
Eric> all kernels if the vlan header is stripped it is reported in
Eric> the auxdata, upon packet reception. Careful code should also
Eric> look for TP_STATUS_VLAN_VALID which allows for distinguishing
Eric> a striped vlan header of 0 from no vlan header.
I can regularly see vlan tags on raw dumps from the untagged ("eth0")
today, running 3.2 (debian stable):
obiwan-[~] mcr 4848 %sudo tcpdump -i eth0 -n -p -e | grep -i vlan
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
17:05:15.404909 38:60:77:38:e6:47 > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 46: vlan 3800, p 0, ethertype ARP, Request who-has 172.30.42.1 tell 172.30.42.11, length 28
So, I'm curious about the statement that vlan tags have been stripped
for some time, because I don't see them stripped today. My desktop has
an Intel 82579V NIC in it...
Eric> For old kernels that do not support the new extensions it is
Eric> possible to generate code that looks at the ethernet header
Eric> and sees if the ethertype is 0x8100 and then does things with
Eric> it, but that will only work on a small handful of software
Eric> only interfaces.
at tcpdump.org, our concern is to release code that works on both new,
and what for kernel.org folks would be considered "ancient" systems,
such as Centos5/RHEL5 machines which are regularly still in production
in the field (sadly...), but often need the latest diagnostics.
What I hear you saying is that our existing code will work on older
kernels, and that once we have new code to use the VLAN tag extensions,
we should simply attempt to load it, and either it loads, or we get an
error, and we go back to the code we had before. That's great news.
The major concern is that if the 802.1q header is gone, although we can
retrieve it somehow (I'm not sure how the AUXDATA is presented on the
MMAP PF_PACKET interface...) we will have to reconstruct it in order to
save it properly to a savefile. Many entities, including most major
Network Telescopes (http://en.wikipedia.org/wiki/Network_telescope) use
libpcap (and often tcpdump itself) to capture packets on probe points,
and having good performance matters here...
--
] He who is tired of Weird Al is tired of life! | firewalls [
] Michael Richardson, Sandelman Software Works, Ottawa, ON |net architect[
] mcr@sandelman.ottawa.on.ca http://www.sandelman.ottawa.on.ca/ |device driver[
Kyoto Plus: watch the video <http://www.youtube.com/watch?v=kzx1ycLXQSE>
then sign the petition.
[-- Attachment #2: Type: application/pgp-signature, Size: 307 bytes --]
^ permalink raw reply
* Re: [PATCH v2 net-next] sockopt: Change getsockopt() of SO_BINDTODEVICE to return an interface name
From: Brian Haley @ 2012-11-17 21:58 UTC (permalink / raw)
To: Pavel Emelyanov; +Cc: David Miller, Eric Dumazet, netdev@vger.kernel.org
In-Reply-To: <50A71B50.3030603@parallels.com>
On 11/17/2012 12:06 AM, Pavel Emelyanov wrote:
>> @@ -4165,6 +4180,8 @@ static int dev_ifname(struct net *net, struct ifreq __user
>> *arg)
>>
>> strcpy(ifr.ifr_name, dev->name);
>> rcu_read_unlock();
>> + if (read_seqretry(&devnet_rename_seq, seq))
>> + goto retry;
>
> I believe it makes sense to make the seqcount protection as a separate patch
> with description of what may happen.
I asked about that before and Dave said he "wanted all the races resolved". At
best I could make this a series...
>> +retry:
>> + seq = read_seqbegin(&devnet_rename_seq);
>> + rcu_read_lock();
>> + dev = dev_get_by_index_rcu(net, sk->sk_bound_dev_if);
>
> The sk->sk_bound_dev_if might have changed to 0 while we did read_seqretry (or
> did the len check above, but the race window is smaller) and this code will
> report -ENODEV instead of zero lenght.
If there are two threads twiddling with the same socket like this the
application is broken in my mind.
-Brian
^ permalink raw reply
* RE:
From: UNITED NATION @ 2012-11-17 13:14 UTC (permalink / raw)
To: netdev
Contact Jacek Slotala of Bank Zachodni WBK Poland via his email address : 1744837202@qq.com for your UN Compensation draft worth $550,000.00
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox