* [PATCH] ptp_pch: eliminate a number of sparse warnings
From: kpark3469 @ 2013-03-27 4:45 UTC (permalink / raw)
To: richardcochran; +Cc: keun-o.park, netdev, kpark3469
From: Sahara <keun-o.park@windriver.com>
This fixes a number of sparse warnings like:
warning: incorrect type in argument 2 (different address spaces)
expected void volatile [noderef] <asn:2>*addr
got unsigned int *<noident>
warning: Using plain integer as NULL pointer
Additionally this fixes a warning from checkpatch.pl like:
WARNING: sizeof pch_param.station should be sizeof(pch_param.station)
Signed-off-by: Sahara <keun-o.park@windriver.com>
---
drivers/ptp/ptp_pch.c | 27 ++++++++++++++-------------
1 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/drivers/ptp/ptp_pch.c b/drivers/ptp/ptp_pch.c
index 1367655..d1adb19 100644
--- a/drivers/ptp/ptp_pch.c
+++ b/drivers/ptp/ptp_pch.c
@@ -118,7 +118,7 @@ struct pch_ts_regs {
* struct pch_dev - Driver private data
*/
struct pch_dev {
- struct pch_ts_regs *regs;
+ struct pch_ts_regs __iomem *regs;
struct ptp_clock *ptp_clock;
struct ptp_clock_info caps;
int exts0_enabled;
@@ -154,7 +154,7 @@ static inline void pch_eth_enable_set(struct pch_dev *chip)
iowrite32(val, (&chip->regs->ts_sel));
}
-static u64 pch_systime_read(struct pch_ts_regs *regs)
+static u64 pch_systime_read(struct pch_ts_regs __iomem *regs)
{
u64 ns;
u32 lo, hi;
@@ -169,7 +169,7 @@ static u64 pch_systime_read(struct pch_ts_regs *regs)
return ns;
}
-static void pch_systime_write(struct pch_ts_regs *regs, u64 ns)
+static void pch_systime_write(struct pch_ts_regs __iomem *regs, u64 ns)
{
u32 hi, lo;
@@ -315,7 +315,7 @@ int pch_set_station_address(u8 *addr, struct pci_dev *pdev)
struct pch_dev *chip = pci_get_drvdata(pdev);
/* Verify the parameter */
- if ((chip->regs == 0) || addr == (u8 *)NULL) {
+ if ((chip->regs == NULL) || addr == (u8 *)NULL) {
dev_err(&pdev->dev,
"invalid params returning PCH_INVALIDPARAM\n");
return PCH_INVALIDPARAM;
@@ -361,7 +361,7 @@ EXPORT_SYMBOL(pch_set_station_address);
static irqreturn_t isr(int irq, void *priv)
{
struct pch_dev *pch_dev = priv;
- struct pch_ts_regs *regs = pch_dev->regs;
+ struct pch_ts_regs __iomem *regs = pch_dev->regs;
struct ptp_clock_event event;
u32 ack = 0, lo, hi, val;
@@ -415,7 +415,7 @@ static int ptp_pch_adjfreq(struct ptp_clock_info *ptp, s32 ppb)
u32 diff, addend;
int neg_adj = 0;
struct pch_dev *pch_dev = container_of(ptp, struct pch_dev, caps);
- struct pch_ts_regs *regs = pch_dev->regs;
+ struct pch_ts_regs __iomem *regs = pch_dev->regs;
if (ppb < 0) {
neg_adj = 1;
@@ -438,7 +438,7 @@ static int ptp_pch_adjtime(struct ptp_clock_info *ptp, s64 delta)
s64 now;
unsigned long flags;
struct pch_dev *pch_dev = container_of(ptp, struct pch_dev, caps);
- struct pch_ts_regs *regs = pch_dev->regs;
+ struct pch_ts_regs __iomem *regs = pch_dev->regs;
spin_lock_irqsave(&pch_dev->register_lock, flags);
now = pch_systime_read(regs);
@@ -455,7 +455,7 @@ static int ptp_pch_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
u32 remainder;
unsigned long flags;
struct pch_dev *pch_dev = container_of(ptp, struct pch_dev, caps);
- struct pch_ts_regs *regs = pch_dev->regs;
+ struct pch_ts_regs __iomem *regs = pch_dev->regs;
spin_lock_irqsave(&pch_dev->register_lock, flags);
ns = pch_systime_read(regs);
@@ -472,7 +472,7 @@ static int ptp_pch_settime(struct ptp_clock_info *ptp,
u64 ns;
unsigned long flags;
struct pch_dev *pch_dev = container_of(ptp, struct pch_dev, caps);
- struct pch_ts_regs *regs = pch_dev->regs;
+ struct pch_ts_regs __iomem *regs = pch_dev->regs;
ns = ts->tv_sec * 1000000000ULL;
ns += ts->tv_nsec;
@@ -567,9 +567,9 @@ static void pch_remove(struct pci_dev *pdev)
free_irq(pdev->irq, chip);
/* unmap the virtual IO memory space */
- if (chip->regs != 0) {
+ if (chip->regs != NULL) {
iounmap(chip->regs);
- chip->regs = 0;
+ chip->regs = NULL;
}
/* release the reserved IO memory space */
if (chip->mem_base != 0) {
@@ -670,7 +670,7 @@ pch_probe(struct pci_dev *pdev, const struct pci_device_id *id)
err_req_irq:
ptp_clock_unregister(chip->ptp_clock);
iounmap(chip->regs);
- chip->regs = 0;
+ chip->regs = NULL;
err_ioremap:
release_mem_region(chip->mem_base, chip->mem_size);
@@ -723,7 +723,8 @@ static s32 __init ptp_pch_init(void)
module_init(ptp_pch_init);
module_exit(ptp_pch_exit);
-module_param_string(station, pch_param.station, sizeof pch_param.station, 0444);
+module_param_string(station,
+ pch_param.station, sizeof(pch_param.station), 0444);
MODULE_PARM_DESC(station,
"IEEE 1588 station address to use - column separated hex values");
--
1.7.1
^ permalink raw reply related
* Re: [PATCH] ptp_pch: eliminate a number of sparse warnings
From: David Miller @ 2013-03-27 4:51 UTC (permalink / raw)
To: kpark3469; +Cc: richardcochran, keun-o.park, netdev
In-Reply-To: <1364359512-29228-1-git-send-email-kpark3469@gmail.com>
From: kpark3469@gmail.com
Date: Wed, 27 Mar 2013 13:45:12 +0900
> -module_param_string(station, pch_param.station, sizeof pch_param.station, 0444);
> +module_param_string(station,
> + pch_param.station, sizeof(pch_param.station), 0444);
Function arguments on the second and subsequent line of a function
call should line up with the first column after the colum of the
openning parenthesis of the first line.
Don't just use TAB characters exclusively, the above looks
incredibly ugly. Instead use the necessary combination of
TAB and space characters necessary to make the argument
line up at the correct column so it all lines up and looks
nice.
^ permalink raw reply
* Re: [PATCH net-next] VXLAN: Fix sparse warnings.
From: David Miller @ 2013-03-27 4:53 UTC (permalink / raw)
To: pshelar; +Cc: netdev, jesse, stephen
In-Reply-To: <1364322570-27179-1-git-send-email-pshelar@nicira.com>
From: Pravin B Shelar <pshelar@nicira.com>
Date: Tue, 26 Mar 2013 11:29:30 -0700
> Fixes following warning:-
> drivers/net/vxlan.c:471:35: warning: symbol 'dev' shadows an earlier one
> drivers/net/vxlan.c:433:26: originally declared here
> drivers/net/vxlan.c:794:34: warning: symbol 'vxlan' shadows an earlier one
> drivers/net/vxlan.c:757:26: originally declared here
>
> CC: Stephen Hemminger <stephen@networkplumber.org>
> Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Applied.
^ permalink raw reply
* Re: ieee802154: Source addr fix for dgram and some small at86rf230 driver enhancements
From: David Miller @ 2013-03-27 4:53 UTC (permalink / raw)
To: stefan; +Cc: netdev, linux-zigbee-devel, alan
In-Reply-To: <1364337691-20163-1-git-send-email-stefan@datenfreihafen.org>
From: Stefan Schmidt <stefan@datenfreihafen.org>
Date: Tue, 26 Mar 2013 22:41:28 +0000
> Hello.
>
> Second version. Changes since version 1:
> - Obey 80 chars rules
> - Switch logging mode to vdbg to avoid noise
> - Remove uneeded might_sleep()
>
> Thanks Alan, Werner and Alex for the feedback.
>
> I feel these are ready so I added DaveM and netdev to pick them up if they think
> the same.
All applied.
^ permalink raw reply
* Re: linux-next: manual merge of the net-next tree with Linus' tree
From: David Miller @ 2013-03-27 4:54 UTC (permalink / raw)
To: sfr; +Cc: netdev, linux-next, linux-kernel, pshelar
In-Reply-To: <20130327115743.7d6c10f1e1c67f02e9c96ff8@canb.auug.org.au>
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Wed, 27 Mar 2013 11:57:43 +1100
> Today's linux-next merge of the net-next tree got a conflict in
> include/net/ipip.h between commit 330305cc4a6b ("pv4: Fix ip-header
> identification for gso packets") from Linus' tree and commit c54419321455
> ("GRE: Refactor GRE tunneling code") from the net-next tree.
>
> I just dropped the file (as the latter change did) and can carry the fix
> as necessary (no action is required).
Thanks, I'll take care of this when I next merge.
^ permalink raw reply
* Re: [PATCH] ipv6: fix raw socket checksum for udplite
From: David Miller @ 2013-03-27 4:55 UTC (permalink / raw)
To: brian.haley; +Cc: zenczykowski, maze, netdev, edumazet, mwdalton
In-Reply-To: <515259C1.20204@hp.com>
From: Brian Haley <brian.haley@hp.com>
Date: Tue, 26 Mar 2013 22:30:25 -0400
> On 03/26/2013 06:31 PM, Maciej Żenczykowski wrote:
>> From: Maciej Żenczykowski <maze@google.com>
>>
>> Commit d3a1be9cba86 from Brian Haley in Nov 2006
>> "[IPv6]: Only modify checksum for UDP" forgot about
>> UDPLITE.
>
> I'm not sure I'd say I "forgot about" it, UDPLITE support didn't exist in Linux
> until three+ weeks after that commit.
Maciej, please fix the commit message to not blame that commit, and
resubmit, thanks.
^ permalink raw reply
* Re: [PATCH net-next 0/2] 6lowpan: fix minor issues introduced with the previous patch set
From: David Miller @ 2013-03-27 4:55 UTC (permalink / raw)
To: tony.cheneau
Cc: eric.dumazet, alan, alex.bluesman.smirnov, netdev,
linux-zigbee-devel
In-Reply-To: <1364357365-21080-1-git-send-email-tony.cheneau@amnesiak.org>
From: Tony Cheneau <tony.cheneau@amnesiak.org>
Date: Wed, 27 Mar 2013 00:09:23 -0400
> Few minor issues were reported by Alexander Aring and Sergei Shtylyov on my
> previous 6lowpan patch set (named "6lowpan: Some more bug fixes").
> Sadly, I didn't had time to address them before the code was merged into
> net-next. These two (short) patches fix them.
All applied, thanks.
^ permalink raw reply
* Re: [PATCH] ptp_pch: eliminate a number of sparse warnings
From: Keun-O Park @ 2013-03-27 4:59 UTC (permalink / raw)
To: David Miller; +Cc: richardcochran, keun-o.park, netdev
In-Reply-To: <20130327.005138.1102221495315013055.davem@davemloft.net>
On Wed, Mar 27, 2013 at 1:51 PM, David Miller <davem@davemloft.net> wrote:
> From: kpark3469@gmail.com
> Date: Wed, 27 Mar 2013 13:45:12 +0900
>
>> -module_param_string(station, pch_param.station, sizeof pch_param.station, 0444);
>> +module_param_string(station,
>> + pch_param.station, sizeof(pch_param.station), 0444);
>
> Function arguments on the second and subsequent line of a function
> call should line up with the first column after the colum of the
> openning parenthesis of the first line.
>
> Don't just use TAB characters exclusively, the above looks
> incredibly ugly. Instead use the necessary combination of
> TAB and space characters necessary to make the argument
> line up at the correct column so it all lines up and looks
> nice.
Ah.. okay. I see.
Thanks.
-- kpark
^ permalink raw reply
* [PATCH v2] ptp_pch: eliminate a number of sparse warnings
From: kpark3469 @ 2013-03-27 5:07 UTC (permalink / raw)
To: richardcochran; +Cc: keun-o.park, netdev, kpark3469, davem
From: Sahara <keun-o.park@windriver.com>
This fixes a number of sparse warnings like:
warning: incorrect type in argument 2 (different address spaces)
expected void volatile [noderef] <asn:2>*addr
got unsigned int *<noident>
warning: Using plain integer as NULL pointer
Additionally this fixes a warning from checkpatch.pl like:
WARNING: sizeof pch_param.station should be sizeof(pch_param.station)
Signed-off-by: Sahara <keun-o.park@windriver.com>
---
drivers/ptp/ptp_pch.c | 27 ++++++++++++++-------------
1 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/drivers/ptp/ptp_pch.c b/drivers/ptp/ptp_pch.c
index 1367655..6b4e3ad 100644
--- a/drivers/ptp/ptp_pch.c
+++ b/drivers/ptp/ptp_pch.c
@@ -118,7 +118,7 @@ struct pch_ts_regs {
* struct pch_dev - Driver private data
*/
struct pch_dev {
- struct pch_ts_regs *regs;
+ struct pch_ts_regs __iomem *regs;
struct ptp_clock *ptp_clock;
struct ptp_clock_info caps;
int exts0_enabled;
@@ -154,7 +154,7 @@ static inline void pch_eth_enable_set(struct pch_dev *chip)
iowrite32(val, (&chip->regs->ts_sel));
}
-static u64 pch_systime_read(struct pch_ts_regs *regs)
+static u64 pch_systime_read(struct pch_ts_regs __iomem *regs)
{
u64 ns;
u32 lo, hi;
@@ -169,7 +169,7 @@ static u64 pch_systime_read(struct pch_ts_regs *regs)
return ns;
}
-static void pch_systime_write(struct pch_ts_regs *regs, u64 ns)
+static void pch_systime_write(struct pch_ts_regs __iomem *regs, u64 ns)
{
u32 hi, lo;
@@ -315,7 +315,7 @@ int pch_set_station_address(u8 *addr, struct pci_dev *pdev)
struct pch_dev *chip = pci_get_drvdata(pdev);
/* Verify the parameter */
- if ((chip->regs == 0) || addr == (u8 *)NULL) {
+ if ((chip->regs == NULL) || addr == (u8 *)NULL) {
dev_err(&pdev->dev,
"invalid params returning PCH_INVALIDPARAM\n");
return PCH_INVALIDPARAM;
@@ -361,7 +361,7 @@ EXPORT_SYMBOL(pch_set_station_address);
static irqreturn_t isr(int irq, void *priv)
{
struct pch_dev *pch_dev = priv;
- struct pch_ts_regs *regs = pch_dev->regs;
+ struct pch_ts_regs __iomem *regs = pch_dev->regs;
struct ptp_clock_event event;
u32 ack = 0, lo, hi, val;
@@ -415,7 +415,7 @@ static int ptp_pch_adjfreq(struct ptp_clock_info *ptp, s32 ppb)
u32 diff, addend;
int neg_adj = 0;
struct pch_dev *pch_dev = container_of(ptp, struct pch_dev, caps);
- struct pch_ts_regs *regs = pch_dev->regs;
+ struct pch_ts_regs __iomem *regs = pch_dev->regs;
if (ppb < 0) {
neg_adj = 1;
@@ -438,7 +438,7 @@ static int ptp_pch_adjtime(struct ptp_clock_info *ptp, s64 delta)
s64 now;
unsigned long flags;
struct pch_dev *pch_dev = container_of(ptp, struct pch_dev, caps);
- struct pch_ts_regs *regs = pch_dev->regs;
+ struct pch_ts_regs __iomem *regs = pch_dev->regs;
spin_lock_irqsave(&pch_dev->register_lock, flags);
now = pch_systime_read(regs);
@@ -455,7 +455,7 @@ static int ptp_pch_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
u32 remainder;
unsigned long flags;
struct pch_dev *pch_dev = container_of(ptp, struct pch_dev, caps);
- struct pch_ts_regs *regs = pch_dev->regs;
+ struct pch_ts_regs __iomem *regs = pch_dev->regs;
spin_lock_irqsave(&pch_dev->register_lock, flags);
ns = pch_systime_read(regs);
@@ -472,7 +472,7 @@ static int ptp_pch_settime(struct ptp_clock_info *ptp,
u64 ns;
unsigned long flags;
struct pch_dev *pch_dev = container_of(ptp, struct pch_dev, caps);
- struct pch_ts_regs *regs = pch_dev->regs;
+ struct pch_ts_regs __iomem *regs = pch_dev->regs;
ns = ts->tv_sec * 1000000000ULL;
ns += ts->tv_nsec;
@@ -567,9 +567,9 @@ static void pch_remove(struct pci_dev *pdev)
free_irq(pdev->irq, chip);
/* unmap the virtual IO memory space */
- if (chip->regs != 0) {
+ if (chip->regs != NULL) {
iounmap(chip->regs);
- chip->regs = 0;
+ chip->regs = NULL;
}
/* release the reserved IO memory space */
if (chip->mem_base != 0) {
@@ -670,7 +670,7 @@ pch_probe(struct pci_dev *pdev, const struct pci_device_id *id)
err_req_irq:
ptp_clock_unregister(chip->ptp_clock);
iounmap(chip->regs);
- chip->regs = 0;
+ chip->regs = NULL;
err_ioremap:
release_mem_region(chip->mem_base, chip->mem_size);
@@ -723,7 +723,8 @@ static s32 __init ptp_pch_init(void)
module_init(ptp_pch_init);
module_exit(ptp_pch_exit);
-module_param_string(station, pch_param.station, sizeof pch_param.station, 0444);
+module_param_string(station,
+ pch_param.station, sizeof(pch_param.station), 0444);
MODULE_PARM_DESC(station,
"IEEE 1588 station address to use - column separated hex values");
--
1.7.1
^ permalink raw reply related
* [PATCH 1/1] ethernet: dm9000 driver: davicom: upgrade driver
From: Joseph CHANG @ 2013-03-27 6:42 UTC (permalink / raw)
To: David S. Miller, Bill Pemberton, Matthew Leach,
Greg Kroah-Hartman, Joseph CHANG, Jiri Pirko, netdev
Cc: linux-kernel, Joseph CHANG
Fixing bug for DM9000B which is a DSP revision!
Had tested to Davicom DM9000 series include DM9000E(analog),
DM9000A(analog), DM9000B(dsp) and DM9000C(dsp) in X86 and
ARM Embedded Linux these years.
Signed-off-by: Joseph CHANG <josright123@gmail.com>
---
drivers/net/ethernet/davicom/dm9000.c | 12 ++++++++++--
drivers/net/ethernet/davicom/dm9000.h | 11 ++++++++++-
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c
index 8cdf025..252f1da 100644
--- a/drivers/net/ethernet/davicom/dm9000.c
+++ b/drivers/net/ethernet/davicom/dm9000.c
@@ -47,7 +47,7 @@
#define DM9000_PHY 0x40 /* PHY address 0x01 */
#define CARDNAME "dm9000"
-#define DRV_VERSION "1.31"
+#define DRV_VERSION "1.39"
/*
* Transmit timeout, default 5 seconds.
@@ -795,6 +795,8 @@ dm9000_init_dm9000(struct net_device *dev)
iow(db, DM9000_GPCR, GPCR_GEP_CNTL); /* Let GPIO0 output */
+ dm9000_phy_write(dev, 0, MII_BMCR, BMCR_RESET); /* PHY RESET */
+
ncr = (db->flags & DM9000_PLATF_EXT_PHY) ? NCR_EXT_PHY : 0;
/* if wol is needed, then always set NCR_WAKEEN otherwise we end
@@ -830,6 +832,8 @@ dm9000_init_dm9000(struct net_device *dev)
db->tx_pkt_cnt = 0;
db->queue_pkt_len = 0;
dev->trans_start = jiffies;
+
+ dm9000_phy_write(dev, 0, MII_DM_DSPCR, DSPCR_INIT_PARAM); /* Init */
}
/* Our watchdog timed out. Called by the networking layer */
@@ -1502,7 +1506,11 @@ dm9000_probe(struct platform_device *pdev)
db->flags |= DM9000_PLATF_SIMPLE_PHY;
#endif
- dm9000_reset(db);
+ /* Fixing bug on dm9000_probe, takeover dm9000_reset(db),
+ * Need 'NCR_MAC_LBK' bit to indeed stable our DM9000 fifo
+ * while probe stage */
+
+ iow(db, DM9000_NCR, NCR_MAC_LBK | NCR_RST);
/* try multiple times, DM9000 sometimes gets the read wrong */
for (i = 0; i < 8; i++) {
diff --git a/drivers/net/ethernet/davicom/dm9000.h b/drivers/net/ethernet/davicom/dm9000.h
index 55688bd..9ce058a 100644
--- a/drivers/net/ethernet/davicom/dm9000.h
+++ b/drivers/net/ethernet/davicom/dm9000.h
@@ -69,7 +69,9 @@
#define NCR_WAKEEN (1<<6)
#define NCR_FCOL (1<<4)
#define NCR_FDX (1<<3)
-#define NCR_LBK (3<<1)
+
+#define NCR_RESERVED (3<<1)
+#define NCR_MAC_LBK (1<<1)
#define NCR_RST (1<<0)
#define NSR_SPEED (1<<7)
@@ -167,5 +169,12 @@
#define ISR_LNKCHNG (1<<5)
#define ISR_UNDERRUN (1<<4)
+/* Davicom MII registers.
+ */
+
+#define MII_DM_DSPCR 0x1b /* DSP Control Register */
+
+#define DSPCR_INIT_PARAM 0xE100 /* DSP init parameter */
+
#endif /* _DM9000X_H_ */
--
1.7.1
^ permalink raw reply related
* [PATCH 1/1] ethernet: dm9000 driver: davicom: upgrade driver
From: Joseph CHANG @ 2013-03-27 6:42 UTC (permalink / raw)
To: David S. Miller, Bill Pemberton, Matthew Leach,
Greg Kroah-Hartman, Joseph CHANG, Jiri Pirko, netdev
Cc: linux-kernel, Joseph CHANG
Fixing bug for DM9000B which is a DSP revision!
Had tested to Davicom DM9000 series include DM9000E(analog),
DM9000A(analog), DM9000B(dsp) and DM9000C(dsp) in X86 and
ARM Embedded Linux these years.
Signed-off-by: Joseph CHANG <josright123@gmail.com>
---
drivers/net/ethernet/davicom/dm9000.c | 12 ++++++++++--
drivers/net/ethernet/davicom/dm9000.h | 11 ++++++++++-
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c
index 8cdf025..252f1da 100644
--- a/drivers/net/ethernet/davicom/dm9000.c
+++ b/drivers/net/ethernet/davicom/dm9000.c
@@ -47,7 +47,7 @@
#define DM9000_PHY 0x40 /* PHY address 0x01 */
#define CARDNAME "dm9000"
-#define DRV_VERSION "1.31"
+#define DRV_VERSION "1.39"
/*
* Transmit timeout, default 5 seconds.
@@ -795,6 +795,8 @@ dm9000_init_dm9000(struct net_device *dev)
iow(db, DM9000_GPCR, GPCR_GEP_CNTL); /* Let GPIO0 output */
+ dm9000_phy_write(dev, 0, MII_BMCR, BMCR_RESET); /* PHY RESET */
+
ncr = (db->flags & DM9000_PLATF_EXT_PHY) ? NCR_EXT_PHY : 0;
/* if wol is needed, then always set NCR_WAKEEN otherwise we end
@@ -830,6 +832,8 @@ dm9000_init_dm9000(struct net_device *dev)
db->tx_pkt_cnt = 0;
db->queue_pkt_len = 0;
dev->trans_start = jiffies;
+
+ dm9000_phy_write(dev, 0, MII_DM_DSPCR, DSPCR_INIT_PARAM); /* Init */
}
/* Our watchdog timed out. Called by the networking layer */
@@ -1502,7 +1506,11 @@ dm9000_probe(struct platform_device *pdev)
db->flags |= DM9000_PLATF_SIMPLE_PHY;
#endif
- dm9000_reset(db);
+ /* Fixing bug on dm9000_probe, takeover dm9000_reset(db),
+ * Need 'NCR_MAC_LBK' bit to indeed stable our DM9000 fifo
+ * while probe stage */
+
+ iow(db, DM9000_NCR, NCR_MAC_LBK | NCR_RST);
/* try multiple times, DM9000 sometimes gets the read wrong */
for (i = 0; i < 8; i++) {
diff --git a/drivers/net/ethernet/davicom/dm9000.h b/drivers/net/ethernet/davicom/dm9000.h
index 55688bd..9ce058a 100644
--- a/drivers/net/ethernet/davicom/dm9000.h
+++ b/drivers/net/ethernet/davicom/dm9000.h
@@ -69,7 +69,9 @@
#define NCR_WAKEEN (1<<6)
#define NCR_FCOL (1<<4)
#define NCR_FDX (1<<3)
-#define NCR_LBK (3<<1)
+
+#define NCR_RESERVED (3<<1)
+#define NCR_MAC_LBK (1<<1)
#define NCR_RST (1<<0)
#define NSR_SPEED (1<<7)
@@ -167,5 +169,12 @@
#define ISR_LNKCHNG (1<<5)
#define ISR_UNDERRUN (1<<4)
+/* Davicom MII registers.
+ */
+
+#define MII_DM_DSPCR 0x1b /* DSP Control Register */
+
+#define DSPCR_INIT_PARAM 0xE100 /* DSP init parameter */
+
#endif /* _DM9000X_H_ */
--
1.7.1
^ permalink raw reply related
* [PATCH] af_unix: dont send SCM_CREDENTIAL when dest socket is NULL
From: dingtianhong @ 2013-03-27 7:35 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David S. Miller, Eric Dumazet, netdev, Li Zefan, Xinwei Hu
In-Reply-To: <1364305597.1716.13.camel@edumazet-glaptop>
On 2013/3/26 21:46, Eric Dumazet wrote:
> On Tue, 2013-03-26 at 19:35 +0800, dingtianhong wrote:
>
>> I think if not call scm_set_creds(), the credential would useles in recvmsg().
>> we could remove code:
>> if (check_creds) {
>> /* Never glue messages from different writers */
>> if ((UNIXCB(skb).pid != siocb->scm->pid) ||
>> (UNIXCB(skb).cred != siocb->scm->cred))
>> break;
>> } else {
>> /* Copy credentials */
>> scm_set_cred(siocb->scm, UNIXCB(skb).pid, UNIXCB(skb).cred);
>> check_creds = 1;
>> }
>
> Are you paraphrasing me or saying something different ?
>
if not call scm_set_creds(), how get credentials for receiver and distinguish different writes,
so I think scm_set_creds() is necessary here.
>
>
>
^ permalink raw reply
* [PATCH 1/3] af_key: initialize satype in key_notify_policy_flush()
From: Steffen Klassert @ 2013-03-27 7:41 UTC (permalink / raw)
To: David Miller; +Cc: Herbert Xu, Steffen Klassert, netdev
In-Reply-To: <1364370068-20025-1-git-send-email-steffen.klassert@secunet.com>
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
This field was left uninitialized. Some user daemons perform check against this
field.
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
net/key/af_key.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 9ef7985..d5a4a79 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -2694,6 +2694,7 @@ static int key_notify_policy_flush(const struct km_event *c)
hdr->sadb_msg_pid = c->portid;
hdr->sadb_msg_version = PF_KEY_V2;
hdr->sadb_msg_errno = (uint8_t) 0;
+ hdr->sadb_msg_satype = SADB_SATYPE_UNSPEC;
hdr->sadb_msg_len = (sizeof(struct sadb_msg) / sizeof(uint64_t));
pfkey_broadcast(skb_out, GFP_ATOMIC, BROADCAST_ALL, NULL, c->net);
return 0;
--
1.7.9.5
^ permalink raw reply related
* pull request (net): ipsec 2013-03-27
From: Steffen Klassert @ 2013-03-27 7:41 UTC (permalink / raw)
To: David Miller; +Cc: Herbert Xu, Steffen Klassert, netdev
1) Initialize the satype field in key_notify_policy_flush(),
this was left uninitialized. From Nicolas Dichtel.
2) The sequence number difference for replay notifications
was misscalculated on ESN sequence number wrap. We need
a separate replay notify function for esn.
3) Fix an off by one in the esn replay notify function.
From Mathias Krause.
Please pull or let me know if there are problems.
Thanks!
The following changes since commit a0b1c42951dd06ec83cc1bc2c9788131d9fefcd8:
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next (2013-02-20 18:58:50 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec.git master
for you to fetch changes up to 799ef90c55e692e096d8bd9e5871b95264b1e9ba:
xfrm: Fix esn sequence number diff calculation in xfrm_replay_notify_esn() (2013-03-25 07:25:50 +0100)
----------------------------------------------------------------
Mathias Krause (1):
xfrm: Fix esn sequence number diff calculation in xfrm_replay_notify_esn()
Nicolas Dichtel (1):
af_key: initialize satype in key_notify_policy_flush()
Steffen Klassert (1):
xfrm: Fix replay notification for esn.
net/key/af_key.c | 1 +
net/xfrm/xfrm_replay.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 66 insertions(+), 1 deletion(-)
^ permalink raw reply
* [PATCH 3/3] xfrm: Fix esn sequence number diff calculation in xfrm_replay_notify_esn()
From: Steffen Klassert @ 2013-03-27 7:41 UTC (permalink / raw)
To: David Miller; +Cc: Herbert Xu, Steffen Klassert, netdev
In-Reply-To: <1364370068-20025-1-git-send-email-steffen.klassert@secunet.com>
From: Mathias Krause <minipli@googlemail.com>
Commit 0017c0b "xfrm: Fix replay notification for esn." is off by one
for the sequence number wrapped case as UINT_MAX is 0xffffffff, not
0x100000000. ;)
Just calculate the diff like done everywhere else in the file.
Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
net/xfrm/xfrm_replay.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/net/xfrm/xfrm_replay.c b/net/xfrm/xfrm_replay.c
index a390673..8dafe6d3 100644
--- a/net/xfrm/xfrm_replay.c
+++ b/net/xfrm/xfrm_replay.c
@@ -359,14 +359,12 @@ static void xfrm_replay_notify_esn(struct xfrm_state *x, int event)
if (replay_esn->seq_hi == preplay_esn->seq_hi)
seq_diff = replay_esn->seq - preplay_esn->seq;
else
- seq_diff = UINT_MAX - preplay_esn->seq
- + replay_esn->seq;
+ seq_diff = ~preplay_esn->seq + replay_esn->seq + 1;
if (replay_esn->oseq_hi == preplay_esn->oseq_hi)
oseq_diff = replay_esn->oseq - preplay_esn->oseq;
else
- oseq_diff = UINT_MAX - preplay_esn->oseq
- + replay_esn->oseq;
+ oseq_diff = ~preplay_esn->oseq + replay_esn->oseq + 1;
if (seq_diff < x->replay_maxdiff &&
oseq_diff < x->replay_maxdiff) {
--
1.7.9.5
^ permalink raw reply related
* [PATCH 2/3] xfrm: Fix replay notification for esn.
From: Steffen Klassert @ 2013-03-27 7:41 UTC (permalink / raw)
To: David Miller; +Cc: Herbert Xu, Steffen Klassert, netdev
In-Reply-To: <1364370068-20025-1-git-send-email-steffen.klassert@secunet.com>
We may miscalculate the sequence number difference from the
last time we send a notification if a sequence number wrap
occured in the meantime. We fix this by adding a separate
replay notify function for esn. Here we take the high bits
of the sequence number into account to calculate the
difference.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
net/xfrm/xfrm_replay.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 67 insertions(+), 1 deletion(-)
diff --git a/net/xfrm/xfrm_replay.c b/net/xfrm/xfrm_replay.c
index 35754cc..a390673 100644
--- a/net/xfrm/xfrm_replay.c
+++ b/net/xfrm/xfrm_replay.c
@@ -334,6 +334,72 @@ static void xfrm_replay_notify_bmp(struct xfrm_state *x, int event)
x->xflags &= ~XFRM_TIME_DEFER;
}
+static void xfrm_replay_notify_esn(struct xfrm_state *x, int event)
+{
+ u32 seq_diff, oseq_diff;
+ struct km_event c;
+ struct xfrm_replay_state_esn *replay_esn = x->replay_esn;
+ struct xfrm_replay_state_esn *preplay_esn = x->preplay_esn;
+
+ /* we send notify messages in case
+ * 1. we updated on of the sequence numbers, and the seqno difference
+ * is at least x->replay_maxdiff, in this case we also update the
+ * timeout of our timer function
+ * 2. if x->replay_maxage has elapsed since last update,
+ * and there were changes
+ *
+ * The state structure must be locked!
+ */
+
+ switch (event) {
+ case XFRM_REPLAY_UPDATE:
+ if (!x->replay_maxdiff)
+ break;
+
+ if (replay_esn->seq_hi == preplay_esn->seq_hi)
+ seq_diff = replay_esn->seq - preplay_esn->seq;
+ else
+ seq_diff = UINT_MAX - preplay_esn->seq
+ + replay_esn->seq;
+
+ if (replay_esn->oseq_hi == preplay_esn->oseq_hi)
+ oseq_diff = replay_esn->oseq - preplay_esn->oseq;
+ else
+ oseq_diff = UINT_MAX - preplay_esn->oseq
+ + replay_esn->oseq;
+
+ if (seq_diff < x->replay_maxdiff &&
+ oseq_diff < x->replay_maxdiff) {
+
+ if (x->xflags & XFRM_TIME_DEFER)
+ event = XFRM_REPLAY_TIMEOUT;
+ else
+ return;
+ }
+
+ break;
+
+ case XFRM_REPLAY_TIMEOUT:
+ if (memcmp(x->replay_esn, x->preplay_esn,
+ xfrm_replay_state_esn_len(replay_esn)) == 0) {
+ x->xflags |= XFRM_TIME_DEFER;
+ return;
+ }
+
+ break;
+ }
+
+ memcpy(x->preplay_esn, x->replay_esn,
+ xfrm_replay_state_esn_len(replay_esn));
+ c.event = XFRM_MSG_NEWAE;
+ c.data.aevent = event;
+ km_state_notify(x, &c);
+
+ if (x->replay_maxage &&
+ !mod_timer(&x->rtimer, jiffies + x->replay_maxage))
+ x->xflags &= ~XFRM_TIME_DEFER;
+}
+
static int xfrm_replay_overflow_esn(struct xfrm_state *x, struct sk_buff *skb)
{
int err = 0;
@@ -510,7 +576,7 @@ static struct xfrm_replay xfrm_replay_esn = {
.advance = xfrm_replay_advance_esn,
.check = xfrm_replay_check_esn,
.recheck = xfrm_replay_recheck_esn,
- .notify = xfrm_replay_notify_bmp,
+ .notify = xfrm_replay_notify_esn,
.overflow = xfrm_replay_overflow_esn,
};
--
1.7.9.5
^ permalink raw reply related
* MY GOOD FRIEND!
From: Michele Roca @ 2013-03-27 8:10 UTC (permalink / raw)
I am Barrister Werner Erich Zeller; I need your sincere partnership in
transferring the sum of 15,000,000.00 EUR The details await you as you
reply!
please! Call +44 702 409 0820 (office)
--
Ich bin Barrister Werner Erich Zeller, ich brauche eure aufrichtige
Partnerschaft intransferring die Summe von 15.000.000,00 EUR auf Ihr
Bankkonto in dieser Woche für den Nutzen der beiden von uns 50% each.It
ist 100% legal, legitim und sicher! für Details, schreiben Sie mir auf
dieser meiner privaten E-Mail statt: Dies ist dringende und ernste Sie
müssen bereit sein und bereit, bevor Sie mich kontaktieren.
bitte! Rufen Sie +44 702 409 0820 (Büro)
^ permalink raw reply
* [PATCH net-next 1/3] net: core: let skb_partial_csum_set() set transport header
From: Jason Wang @ 2013-03-27 9:11 UTC (permalink / raw)
To: davem, netdev, linux-kernel; +Cc: mst, Jason Wang, Eric Dumazet
For untrusted packets with partial checksum, we need to set the transport header
for precise packet length estimation. We can just let skb_pratial_csum_set() to
do this to avoid extra call to skb_flow_dissect() and simplify the caller.
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
net/core/skbuff.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 31c6737..ba64614 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -3370,6 +3370,7 @@ bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off)
skb->ip_summed = CHECKSUM_PARTIAL;
skb->csum_start = skb_headroom(skb) + start;
skb->csum_offset = off;
+ skb_set_transport_header(skb, start);
return true;
}
EXPORT_SYMBOL_GPL(skb_partial_csum_set);
--
1.7.1
^ permalink raw reply related
* [PATCH net-next 3/3] net: switch to use skb_probe_transport_header()
From: Jason Wang @ 2013-03-27 9:11 UTC (permalink / raw)
To: davem, netdev, linux-kernel; +Cc: mst, Jason Wang, Eric Dumazet
In-Reply-To: <1364375482-7439-1-git-send-email-jasowang@redhat.com>
Switch to use the new help skb_probe_transport_header() to do the l4 header
probing for untrusted sources. For packets with partial csum, the header should
already been set by skb_partial_csum_set().
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
drivers/net/macvtap.c | 9 +--------
drivers/net/tun.c | 10 +---------
drivers/net/xen-netback/netback.c | 10 +---------
net/packet/af_packet.c | 22 +++-------------------
4 files changed, 6 insertions(+), 45 deletions(-)
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index acf6450..59e9605 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -21,7 +21,6 @@
#include <net/rtnetlink.h>
#include <net/sock.h>
#include <linux/virtio_net.h>
-#include <net/flow_keys.h>
/*
* A macvtap queue is the central object of this driver, it connects
@@ -646,7 +645,6 @@ static ssize_t macvtap_get_user(struct macvtap_queue *q, struct msghdr *m,
int vnet_hdr_len = 0;
int copylen = 0;
bool zerocopy = false;
- struct flow_keys keys;
if (q->flags & IFF_VNET_HDR) {
vnet_hdr_len = q->vnet_hdr_sz;
@@ -727,12 +725,7 @@ static ssize_t macvtap_get_user(struct macvtap_queue *q, struct msghdr *m,
goto err_kfree;
}
- if (skb->ip_summed == CHECKSUM_PARTIAL)
- skb_set_transport_header(skb, skb_checksum_start_offset(skb));
- else if (skb_flow_dissect(skb, &keys))
- skb_set_transport_header(skb, keys.thoff);
- else
- skb_set_transport_header(skb, ETH_HLEN);
+ skb_probe_transport_header(skb, ETH_HLEN);
rcu_read_lock_bh();
vlan = rcu_dereference_bh(q->vlan);
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 48cd73a..29538e6 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -70,7 +70,6 @@
#include <net/sock.h>
#include <asm/uaccess.h>
-#include <net/flow_keys.h>
/* Uncomment to enable debugging */
/* #define TUN_DEBUG 1 */
@@ -1050,7 +1049,6 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
bool zerocopy = false;
int err;
u32 rxhash;
- struct flow_keys keys;
if (!(tun->flags & TUN_NO_PI)) {
if ((len -= sizeof(pi)) > total_len)
@@ -1205,13 +1203,7 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
}
skb_reset_network_header(skb);
-
- if (skb->ip_summed == CHECKSUM_PARTIAL)
- skb_set_transport_header(skb, skb_checksum_start_offset(skb));
- else if (skb_flow_dissect(skb, &keys))
- skb_set_transport_header(skb, keys.thoff);
- else
- skb_reset_transport_header(skb);
+ skb_probe_transport_header(skb, 0);
rxhash = skb_get_rxhash(skb);
netif_rx_ni(skb);
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index fc8faa7..83905a9 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -39,7 +39,6 @@
#include <linux/udp.h>
#include <net/tcp.h>
-#include <net/flow_keys.h>
#include <xen/xen.h>
#include <xen/events.h>
@@ -1506,14 +1505,7 @@ static void xen_netbk_tx_submit(struct xen_netbk *netbk)
continue;
}
- if (!skb_transport_header_was_set(skb)) {
- struct flow_keys keys;
-
- if (skb_flow_dissect(skb, &keys))
- skb_set_transport_header(skb, keys.thoff);
- else
- skb_reset_transport_header(skb);
- }
+ skb_probe_transport_header(skb, 0);
vif->dev->stats.rx_bytes += skb->len;
vif->dev->stats.rx_packets++;
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 83fdd0a..8e4644f 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -88,7 +88,6 @@
#include <linux/virtio_net.h>
#include <linux/errqueue.h>
#include <linux/net_tstamp.h>
-#include <net/flow_keys.h>
#ifdef CONFIG_INET
#include <net/inet_common.h>
@@ -1413,7 +1412,6 @@ static int packet_sendmsg_spkt(struct kiocb *iocb, struct socket *sock,
__be16 proto = 0;
int err;
int extra_len = 0;
- struct flow_keys keys;
/*
* Get and verify the address.
@@ -1514,10 +1512,7 @@ retry:
if (unlikely(extra_len == 4))
skb->no_fcs = 1;
- if (skb_flow_dissect(skb, &keys))
- skb_set_transport_header(skb, keys.thoff);
- else
- skb_reset_transport_header(skb);
+ skb_probe_transport_header(skb, 0);
dev_queue_xmit(skb);
rcu_read_unlock();
@@ -1925,7 +1920,6 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,
struct page *page;
void *data;
int err;
- struct flow_keys keys;
ph.raw = frame;
@@ -1950,11 +1944,7 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,
skb_reserve(skb, hlen);
skb_reset_network_header(skb);
-
- if (skb_flow_dissect(skb, &keys))
- skb_set_transport_header(skb, keys.thoff);
- else
- skb_reset_transport_header(skb);
+ skb_probe_transport_header(skb, 0);
if (po->tp_tx_has_off) {
int off_min, off_max, off;
@@ -2212,7 +2202,6 @@ static int packet_snd(struct socket *sock,
unsigned short gso_type = 0;
int hlen, tlen;
int extra_len = 0;
- struct flow_keys keys;
/*
* Get and verify the address.
@@ -2365,12 +2354,7 @@ static int packet_snd(struct socket *sock,
len += vnet_hdr_len;
}
- if (skb->ip_summed == CHECKSUM_PARTIAL)
- skb_set_transport_header(skb, skb_checksum_start_offset(skb));
- else if (skb_flow_dissect(skb, &keys))
- skb_set_transport_header(skb, keys.thoff);
- else
- skb_set_transport_header(skb, reserve);
+ skb_probe_transport_header(skb, reserve);
if (unlikely(extra_len == 4))
skb->no_fcs = 1;
--
1.7.1
^ permalink raw reply related
* [PATCH net-next 2/3] net: core: introduce skb_probe_transport_header()
From: Jason Wang @ 2013-03-27 9:11 UTC (permalink / raw)
To: davem, netdev, linux-kernel; +Cc: mst, Jason Wang, Eric Dumazet
In-Reply-To: <1364375482-7439-1-git-send-email-jasowang@redhat.com>
Sometimes, we need probe and set the transport header for packets (e.g from
untrusted source). This patch introduces a new helper
skb_probe_transport_header() which tries to probe and set the l4 header through
skb_flow_dissect(), if not just set the transport header to the hint passed by
caller.
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
include/linux/skbuff.h | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 4974121..fa88b96 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -32,6 +32,7 @@
#include <linux/hrtimer.h>
#include <linux/dma-mapping.h>
#include <linux/netdev_features.h>
+#include <net/flow_keys.h>
/* Don't change this without changing skb_csum_unnecessary! */
#define CHECKSUM_NONE 0
@@ -1559,6 +1560,19 @@ static inline void skb_set_transport_header(struct sk_buff *skb,
skb->transport_header += offset;
}
+static inline void skb_probe_transport_header(struct sk_buff *skb,
+ const int offset_hint)
+{
+ struct flow_keys keys;
+
+ if (skb_transport_header_was_set(skb))
+ return;
+ else if (skb_flow_dissect(skb, &keys))
+ skb_set_transport_header(skb, keys.thoff);
+ else
+ skb_set_transport_header(skb, offset_hint);
+}
+
static inline unsigned char *skb_network_header(const struct sk_buff *skb)
{
return skb->head + skb->network_header;
--
1.7.1
^ permalink raw reply related
* [PATCH net-next] core: should call pskb_expand_head if skb header is cloned in skb_gso_segment in rx path
From: roy.qing.li @ 2013-03-27 9:34 UTC (permalink / raw)
To: netdev
From: Li RongQing <roy.qing.li@gmail.com>
12b0004d1d1 (adjust skb_gso_segment() for calling in rx path) tries to kill warnings
by checking if ip_summed is CHECK_NONE or not in rx path, since if skb_gso_segment()
is called on rx path, and ->ip_summed has different meaning.
but this maybe break skb if skb header is cloned, and not expand the header, since when
step into skb_mac_gso_segment(), which will still check ip_summed with CHECKSUM_PARTIAL,
then do gso_send_check(). and after __skb_gso_segment() in queue_gso_packets() of
openvswitch, queue_userspace_packet() still checks ip_summed with CHECKSUM_PARTIAL,
and do checksum.
so I think it is enough to ignore the warning in rx path.
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
---
net/core/dev.c | 16 +++-------------
1 file changed, 3 insertions(+), 13 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index de930b7..bf0e586 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2269,17 +2269,6 @@ struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb,
}
EXPORT_SYMBOL(skb_mac_gso_segment);
-
-/* openvswitch calls this on rx path, so we need a different check.
- */
-static inline bool skb_needs_check(struct sk_buff *skb, bool tx_path)
-{
- if (tx_path)
- return skb->ip_summed != CHECKSUM_PARTIAL;
- else
- return skb->ip_summed == CHECKSUM_NONE;
-}
-
/**
* __skb_gso_segment - Perform segmentation on skb.
* @skb: buffer to segment
@@ -2294,10 +2283,11 @@ static inline bool skb_needs_check(struct sk_buff *skb, bool tx_path)
struct sk_buff *__skb_gso_segment(struct sk_buff *skb,
netdev_features_t features, bool tx_path)
{
- if (unlikely(skb_needs_check(skb, tx_path))) {
+ if (unlikely(skb->ip_summed != CHECKSUM_PARTIAL)) {
int err;
- skb_warn_bad_offload(skb);
+ if (tx_path)
+ skb_warn_bad_offload(skb);
if (skb_header_cloned(skb) &&
(err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC)))
--
1.7.10.4
^ permalink raw reply related
* [net-next PATCH 1/1] drivers: net: ethernet: ti: sparse warning fix for ti ethernet drivers
From: Mugunthan V N @ 2013-03-27 9:58 UTC (permalink / raw)
To: netdev; +Cc: davem, linux-omap, Mugunthan V N
fix for the below sparse warnings
drivers/net/ethernet/ti/davinci_cpdma.c:182:29: warning: incorrect type in assignment (different address spaces)
drivers/net/ethernet/ti/davinci_cpdma.c:182:29: expected void [noderef] <asn:2>*iomap
drivers/net/ethernet/ti/davinci_cpdma.c:182:29: got void *cpumap
drivers/net/ethernet/ti/davinci_cpdma.c:953:27: warning: symbol 'controls' was not declared. Should it be static?
drivers/net/ethernet/ti/cpsw.c:451:6: warning: symbol 'cpsw_tx_handler' was not declared. Should it be static?
drivers/net/ethernet/ti/cpsw.c:468:6: warning: symbol 'cpsw_rx_handler' was not declared. Should it be static?
drivers/net/ethernet/ti/cpsw_ale.c:151:5: warning: symbol 'cpsw_ale_match_addr' was not declared. Should it be static?
drivers/net/ethernet/ti/cpsw_ale.c:172:5: warning: symbol 'cpsw_ale_match_vlan' was not declared. Should it be static?
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
---
drivers/net/ethernet/ti/cpsw.c | 4 ++--
drivers/net/ethernet/ti/cpsw_ale.c | 4 ++--
drivers/net/ethernet/ti/davinci_cpdma.c | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 7aebc0c..f4be85b 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -448,7 +448,7 @@ static void cpsw_intr_disable(struct cpsw_priv *priv)
return;
}
-void cpsw_tx_handler(void *token, int len, int status)
+static void cpsw_tx_handler(void *token, int len, int status)
{
struct sk_buff *skb = token;
struct net_device *ndev = skb->dev;
@@ -465,7 +465,7 @@ void cpsw_tx_handler(void *token, int len, int status)
dev_kfree_skb_any(skb);
}
-void cpsw_rx_handler(void *token, int len, int status)
+static void cpsw_rx_handler(void *token, int len, int status)
{
struct sk_buff *skb = token;
struct net_device *ndev = skb->dev;
diff --git a/drivers/net/ethernet/ti/cpsw_ale.c b/drivers/net/ethernet/ti/cpsw_ale.c
index 7fa60d6..79f0b79 100644
--- a/drivers/net/ethernet/ti/cpsw_ale.c
+++ b/drivers/net/ethernet/ti/cpsw_ale.c
@@ -148,7 +148,7 @@ static int cpsw_ale_write(struct cpsw_ale *ale, int idx, u32 *ale_entry)
return idx;
}
-int cpsw_ale_match_addr(struct cpsw_ale *ale, u8 *addr, u16 vid)
+static int cpsw_ale_match_addr(struct cpsw_ale *ale, u8 *addr, u16 vid)
{
u32 ale_entry[ALE_ENTRY_WORDS];
int type, idx;
@@ -169,7 +169,7 @@ int cpsw_ale_match_addr(struct cpsw_ale *ale, u8 *addr, u16 vid)
return -ENOENT;
}
-int cpsw_ale_match_vlan(struct cpsw_ale *ale, u16 vid)
+static int cpsw_ale_match_vlan(struct cpsw_ale *ale, u16 vid)
{
u32 ale_entry[ALE_ENTRY_WORDS];
int type, idx;
diff --git a/drivers/net/ethernet/ti/davinci_cpdma.c b/drivers/net/ethernet/ti/davinci_cpdma.c
index ee13dc7..a6f5de9 100644
--- a/drivers/net/ethernet/ti/davinci_cpdma.c
+++ b/drivers/net/ethernet/ti/davinci_cpdma.c
@@ -179,7 +179,7 @@ cpdma_desc_pool_create(struct device *dev, u32 phys, u32 hw_addr,
} else {
pool->cpumap = dma_alloc_coherent(dev, size, &pool->phys,
GFP_KERNEL);
- pool->iomap = pool->cpumap;
+ pool->iomap = (void __iomem *) pool->cpumap;
pool->hw_addr = pool->phys;
}
@@ -950,7 +950,7 @@ struct cpdma_control_info {
#define ACCESS_RW (ACCESS_RO | ACCESS_WO)
};
-struct cpdma_control_info controls[] = {
+static struct cpdma_control_info controls[] = {
[CPDMA_CMD_IDLE] = {CPDMA_DMACONTROL, 3, 1, ACCESS_WO},
[CPDMA_COPY_ERROR_FRAMES] = {CPDMA_DMACONTROL, 4, 1, ACCESS_RW},
[CPDMA_RX_OFF_LEN_UPDATE] = {CPDMA_DMACONTROL, 2, 1, ACCESS_RW},
--
1.7.9.5
^ permalink raw reply related
* [PATCH] net : Fix broken IPv6 routing table after loopback down-up
From: Balakumaran Kannan @ 2013-03-27 10:01 UTC (permalink / raw)
To: davem, kuznet, jmorris, yoshfuji, kaber
Cc: netdev, Balakumaran.Kannan, maruthi.thotad
IPv6 Routing table becomes broken once we do ifdown, ifup of the loopback(lo)
interface. After down-up, routes of other interface's IPv6 addresses through
'lo' are lost.
IPv6 addresses assigned to all interfaces are routed through 'lo' for internal
communication. Once 'lo' is down, those routing entries are removed from
routing table. But those removed entries are not being re-created properly when
'lo' is brought up. So IPv6 addresses of other interfaces becomes unreachable
from the same machine. Also this breaks communication with other machines
because of NDISC packet processing failure.
This patch fixes this issue by reading all interface's IPv6 addresses and
adding them to IPv6 routing table while bringing up 'lo'.
Patch is prepared for Linux-3.9.rc4 kernel.
Signed-off-by: Balakumaran Kannan <Balakumaran.Kannan@ap.sony.com>
Signed-off-by: Maruthi Thotad <Maruthi.Thotad@ap.sm.sony.com>
---
==Testing==
Before applying the patch:
$ route -A inet6
Kernel IPv6 routing table
Destination Next Hop Flag Met Ref Use If
2000::20/128 :: U 256 0 0 eth0
fe80::/64 :: U 256 0 0 eth0
::/0 :: !n -1 1 1 lo
::1/128 :: Un 0 1 0 lo
2000::20/128 :: Un 0 1 0 lo
fe80::xxxx:xxxx:xxxx:xxxx/128 :: Un 0 1 0 lo
ff00::/8 :: U 256 0 0 eth0
::/0 :: !n -1 1 1 lo
$ sudo ifdown lo
$ sudo ifup lo
$ route -A inet6
Kernel IPv6 routing table
Destination Next Hop Flag Met Ref Use If
2000::20/128 :: U 256 0 0 eth0
fe80::/64 :: U 256 0 0 eth0
::/0 :: !n -1 1 1 lo
::1/128 :: Un 0 1 0 lo
ff00::/8 :: U 256 0 0 eth0
::/0 :: !n -1 1 1 lo
$
After applying the patch:
$ route -A inet6
Kernel IPv6 routing
table
Destination Next Hop Flag Met Ref Use If
2000::20/128 :: U 256 0 0 eth0
fe80::/64 :: U 256 0 0 eth0
::/0 :: !n -1 1 1 lo
::1/128 :: Un 0 1 0 lo
2000::20/128 :: Un 0 1 0 lo
fe80::xxxx:xxxx:xxxx:xxxx/128 :: Un 0 1 0 lo
ff00::/8 :: U 256 0 0 eth0
::/0 :: !n -1 1 1 lo
$ sudo ifdown lo
$ sudo ifup lo
$ route -A inet6
Kernel IPv6 routing table
Destination Next Hop Flag Met Ref Use If
2000::20/128 :: U 256 0 0 eth0
fe80::/64 :: U 256 0 0 eth0
::/0 :: !n -1 1 1 lo
::1/128 :: Un 0 1 0 lo
2000::20/128 :: Un 0 1 0 lo
fe80::xxxx:xxxx:xxxx:xxxx/128 :: Un 0 1 0 lo
ff00::/8 :: U 256 0 0 eth0
::/0 :: !n -1 1 1 lo
$
---
--- linux-3.9-rc4/net/ipv6/addrconf.c.orig 2013-03-27 10:40:26.382569527 +0530
+++ linux-3.9-rc4/net/ipv6/addrconf.c 2013-03-27 10:56:45.227354856 +0530
@@ -2529,6 +2529,11 @@ static void sit_add_v4_addrs(struct inet
static void init_loopback(struct net_device *dev)
{
struct inet6_dev *idev;
+ struct net_device *sp_dev;
+ struct inet6_ifaddr *sp_ifa;
+ struct list_head *sp_ifap;
+ struct rt6_info *sp_rt;
+ int i = 1;
/* ::1 */
@@ -2540,6 +2545,27 @@ static void init_loopback(struct net_dev
}
add_addr(idev, &in6addr_loopback, 128, IFA_HOST);
+
+ while ((sp_dev = dev_get_by_index(dev_net(dev), i++))) {
+
+ if (!strcmp(sp_dev->name, dev->name)) {
+ dev_put(sp_dev);
+ continue;
+ }
+
+ idev = ipv6_find_idev(sp_dev);
+ dev_put(sp_dev);
+ if (NULL == idev)
+ continue;
+
+ list_for_each(sp_ifap, &idev->addr_list) {
+ sp_ifa = list_entry(sp_ifap, struct inet6_ifaddr,
+ if_list);
+ sp_rt = addrconf_dst_alloc(idev, &sp_ifa->addr, 0);
+ if (!IS_ERR(sp_rt))
+ ip6_ins_rt(sp_rt);
+ }
+ }
}
static void addrconf_add_linklocal(struct inet6_dev *idev, const
struct in6_addr *addr)
^ permalink raw reply
* Re: [Xen-devel] [PATCH 6/6] xen-netback: don't disconnect frontend when seeing oversize frame
From: William Dauchy @ 2013-03-27 10:03 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk
Cc: Wei Liu, netdev, annie.li, david.vrabel, Ian Campbell, xen-devel
In-Reply-To: <20130325165834.GC25740@phenom.dumpdata.com>
On Mon, Mar 25, 2013 at 5:58 PM, Konrad Rzeszutek Wilk
<konrad.wilk@oracle.com> wrote:
> CC stable@vger.kernel.org ?
I agree on that. I got several issues with the previous patch on a 3.4.x
Regards,
--
William
^ permalink raw reply
* [PATCH net-next 1/1] bnx2x: Fix AER semaphore release
From: Yuval Mintz @ 2013-03-27 9:28 UTC (permalink / raw)
To: davem, netdev; +Cc: eilong, Yuval Mintz, Ariel Elior
Commit 7fa6f34 "AER revised" erroneously inserted an error-flow
in which a semaphore is released even though the attempt to take it
has failed.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
---
Hi Dave,
Please accept this to `net-next'.
Thanks,
Yuval
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 2c6a2a6..5c5a327 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -10070,8 +10070,8 @@ static int bnx2x_prev_unload(struct bnx2x *bp)
/* If Path is marked by EEH, ignore unload status */
aer = !!(bnx2x_prev_path_get_entry(bp) &&
bnx2x_prev_path_get_entry(bp)->aer);
+ up(&bnx2x_prev_sem);
}
- up(&bnx2x_prev_sem);
if (fw == FW_MSG_CODE_DRV_UNLOAD_COMMON || aer) {
rc = bnx2x_prev_unload_common(bp);
--
1.8.1.227.g44fe835
^ permalink raw reply related
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