* Re: [PATCH 13/51] DMA-API: net: sfc/efx.c: replace dma_set_mask()+dma_set_coherent_mask() with new helper
From: Russell King - ARM Linux @ 2013-09-21 19:50 UTC (permalink / raw)
To: Ben Hutchings; +Cc: netdev, Solarflare linux maintainers
In-Reply-To: <1379685328.1681.0.camel@bwh-desktop.uk.level5networks.com>
On Fri, Sep 20, 2013 at 02:55:28PM +0100, Ben Hutchings wrote:
> Acked-by: Ben Hutchings <bhutchings@solarflare.com>
Thanks, added.
^ permalink raw reply
* Re: [PATCH 18/51] DMA-API: staging: et131x: replace dma_set_mask()+dma_set_coherent_mask() with new helper
From: Russell King - ARM Linux @ 2013-09-21 19:55 UTC (permalink / raw)
To: Ben Hutchings; +Cc: devel, netdev
In-Reply-To: <1379691728.1681.15.camel@bwh-desktop.uk.level5networks.com>
On Fri, Sep 20, 2013 at 04:42:08PM +0100, Ben Hutchings wrote:
> On Thu, 2013-09-19 at 22:43 +0100, Russell King wrote:
> > + if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) ||
> > + dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
>
> Surely we want && here.
Good catch, exactly right. Thanks for the review, here's the replacement
patch:
8<====
From: Russell King <rmk+kernel@arm.linux.org.uk>
Subject: [PATCH] DMA-API: staging: et131x: replace
dma_set_mask()+dma_set_coherent_mask() with new helper
Replace the following sequence:
dma_set_mask(dev, mask);
dma_set_coherent_mask(dev, mask);
with a call to the new helper dma_set_mask_and_coherent().
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
drivers/staging/et131x/et131x.c | 17 ++---------------
1 files changed, 2 insertions(+), 15 deletions(-)
diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c
index f73e58f..61da7ee 100644
--- a/drivers/staging/et131x/et131x.c
+++ b/drivers/staging/et131x/et131x.c
@@ -4797,21 +4797,8 @@ static int et131x_pci_setup(struct pci_dev *pdev,
pci_set_master(pdev);
/* Check the DMA addressing support of this device */
- if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(64))) {
- rc = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
- if (rc < 0) {
- dev_err(&pdev->dev,
- "Unable to obtain 64 bit DMA for consistent allocations\n");
- goto err_release_res;
- }
- } else if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) {
- rc = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
- if (rc < 0) {
- dev_err(&pdev->dev,
- "Unable to obtain 32 bit DMA for consistent allocations\n");
- goto err_release_res;
- }
- } else {
+ if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) &&
+ dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
dev_err(&pdev->dev, "No usable DMA addressing method\n");
rc = -EIO;
goto err_release_res;
--
1.7.4.4
^ permalink raw reply related
* Re: [PATCH 24/51] DMA-API: dma: pl330: add dma_set_mask_and_coherent() call
From: Russell King - ARM Linux @ 2013-09-21 20:00 UTC (permalink / raw)
To: Heiko Stübner
Cc: alsa-devel, linux-doc, linux-mmc, linux-fbdev, linux-nvme,
linux-ide, devel, linux-samsung-soc, linux-scsi, e1000-devel,
b43-dev, linux-media, devicetree, dri-devel, linux-tegra,
Dan Williams, linux-omap, linux-arm-kernel,
Solarflare linux maintainers, netdev, linux-usb, linux-wireless,
Vinod Koul, linux-crypto, uclinux-dist-devel, linuxppc-dev
In-Reply-To: <201309201926.29084.heiko@sntech.de>
On Fri, Sep 20, 2013 at 07:26:27PM +0200, Heiko Stübner wrote:
> Am Donnerstag, 19. September 2013, 23:49:01 schrieb Russell King:
> > The DMA API requires drivers to call the appropriate dma_set_mask()
> > functions before doing any DMA mapping. Add this required call to
> > the AMBA PL08x driver.
> ^--- copy and paste error - should of course be PL330
Fixed, thanks.
^ permalink raw reply
* [--signoff] Changes made for Lance.c
From: Ubuntu @ 2013-09-21 20:17 UTC (permalink / raw)
To: netdev; +Cc: dinesh
From: dinesh <dineshraju2007@gmail.com>
---
drivers/net/ethernet/amd/lance.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/amd/lance.c b/drivers/net/ethernet/amd/lance.c
index 5c72843..256f590 100644
--- a/drivers/net/ethernet/amd/lance.c
+++ b/drivers/net/ethernet/amd/lance.c
@@ -754,7 +754,7 @@ lance_open(struct net_device *dev)
int i;
if (dev->irq == 0 ||
- request_irq(dev->irq, lance_interrupt, 0, lp->name, dev)) {
+ request_irq(dev->irq, lance_interrupt, 0, dev->name, dev)) {
return -EAGAIN;
}
--
1.8.1.2
^ permalink raw reply related
* Re: [PATCH] skge: fix invalid value passed to pci_unmap_sigle
From: Sergei Shtylyov @ 2013-09-21 22:12 UTC (permalink / raw)
To: Mikulas Patocka
Cc: David Miller, netdev, Francois Romieu, Igor Gnatenko, stephen
In-Reply-To: <alpine.LRH.2.02.1309201352010.1763@file01.intranet.prod.int.rdu2.redhat.com>
Hello.
On 09/20/2013 09:53 PM, Mikulas Patocka wrote:
> In my patch c194992cbe71c20bb3623a566af8d11b0bfaa721 I didn't fix the skge
Please also specify that commit's summary in parens.
> bug correctly. The value of the new mapping (not old) was passed to
> pci_unmap_single.
> If we enable CONFIG_DMA_API_DEBUG, it results in this warning:
> WARNING: CPU: 0 PID: 0 at lib/dma-debug.c:986 check_sync+0x4c4/0x580()
> skge 0000:02:07.0: DMA-API: device driver tries to sync DMA memory it has
> not allocated [device address=0x000000023a0096c0] [size=1536 bytes]
> This patch makes the skge driver pass the correct value to
> pci_unmap_single and fixes the warning. It copies the old descriptor to
> on-stack variable "ee" and unmaps it if mapping of the new descriptor
> succeeded.
> This patch should be backported to 3.11-stable.
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> Reported-by: Francois Romieu <romieu@fr.zoreil.com>
> Tested-by: Mikulas Patocka <mpatocka@redhat.com>
WBR, Sergei
^ permalink raw reply
* [PATCH 04/19] isdn: Change variable type to bool
From: Peter Senna Tschudin @ 2013-09-21 22:27 UTC (permalink / raw)
To: mac; +Cc: isdn4linux, netdev, linux-kernel, kernel-janitors,
Peter Senna Tschudin
In-Reply-To: <1379802471-30252-1-git-send-email-peter.senna@gmail.com>
The variable noCh is only assigned the values true and false. Change
its type to bool.
The simplified semantic patch that find this problem is as
follows (http://coccinelle.lip6.fr/):
@exists@
type T;
identifier b;
@@
- T
+ bool
b = ...;
... when any
b = \(true\|false\)
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
---
drivers/isdn/hardware/eicon/message.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/isdn/hardware/eicon/message.c b/drivers/isdn/hardware/eicon/message.c
index a82e542..05d889a 100644
--- a/drivers/isdn/hardware/eicon/message.c
+++ b/drivers/isdn/hardware/eicon/message.c
@@ -1207,7 +1207,7 @@ static byte connect_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
byte m;
static byte esc_chi[35] = {0x02, 0x18, 0x01};
static byte lli[2] = {0x01, 0x00};
- byte noCh = 0;
+ bool noCh = false;
word dir = 0;
byte *p_chi = "";
--
1.8.3.1
^ permalink raw reply related
* [PATCH 08/19] net: Change variable type to bool
From: Peter Senna Tschudin @ 2013-09-21 22:27 UTC (permalink / raw)
To: jcliburn
Cc: chris.snook, jkosina, rdunlap, standby24x7, peter.senna, netdev,
linux-kernel, kernel-janitors
In-Reply-To: <1379802471-30252-1-git-send-email-peter.senna@gmail.com>
The variable ret is only assigned the values true and false.
The function atl1c_read_eeprom already returns bool. Change
ret type to bool.
The simplified semantic patch that find this problem is as
follows (http://coccinelle.lip6.fr/):
@exists@
type T;
identifier b;
@@
- T
+ bool
b = ...;
... when any
b = \(true\|false\)
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
---
drivers/net/ethernet/atheros/atl1c/atl1c_hw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_hw.c b/drivers/net/ethernet/atheros/atl1c/atl1c_hw.c
index 3ef7092..1cda49a 100644
--- a/drivers/net/ethernet/atheros/atl1c/atl1c_hw.c
+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_hw.c
@@ -153,7 +153,7 @@ static int atl1c_get_permanent_address(struct atl1c_hw *hw)
bool atl1c_read_eeprom(struct atl1c_hw *hw, u32 offset, u32 *p_value)
{
int i;
- int ret = false;
+ bool ret = false;
u32 otp_ctrl_data;
u32 control;
u32 data;
--
1.8.3.1
^ permalink raw reply related
* [PATCH 09/19] net: Change variable type to bool
From: Peter Senna Tschudin @ 2013-09-21 22:27 UTC (permalink / raw)
To: eilong; +Cc: netdev, linux-kernel, kernel-janitors, Peter Senna Tschudin
In-Reply-To: <1379802471-30252-1-git-send-email-peter.senna@gmail.com>
The variable rc is only assigned the values true and false.
The function bnx2x_prev_is_path_marked already returns bool.
Change rc type to bool.
The simplified semantic patch that find this problem is as
follows (http://coccinelle.lip6.fr/):
@exists@
type T;
identifier b;
@@
- T
+ bool
b = ...;
... when any
b = \(true\|false\)
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
---
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 fccfc1d..105cc80 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -9874,7 +9874,7 @@ static int bnx2x_prev_path_mark_eeh(struct bnx2x *bp)
static bool bnx2x_prev_is_path_marked(struct bnx2x *bp)
{
struct bnx2x_prev_path_list *tmp_list;
- int rc = false;
+ bool rc = false;
if (down_trylock(&bnx2x_prev_sem))
return false;
--
1.8.3.1
^ permalink raw reply related
* [PATCH 10/19] net: Change variable type to bool
From: Peter Senna Tschudin @ 2013-09-21 22:27 UTC (permalink / raw)
To: hykim; +Cc: netdev, linux-kernel, kernel-janitors, Peter Senna Tschudin
In-Reply-To: <1379802471-30252-1-git-send-email-peter.senna@gmail.com>
There is the rc variable on both myri10ge_ss_lock_napi and
myri10ge_ss_lock_poll functions. In both cases rc is only assigned the
values true and false. Both functions already return bool. Change rc
type to bool.
The simplified semantic patch that find this problem is as
follows (http://coccinelle.lip6.fr/):
@exists@
type T;
identifier b;
@@
- T
+ bool
b = ...;
... when any
b = \(true\|false\)
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
---
drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
index 149355b..7792264 100644
--- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
+++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
@@ -934,7 +934,7 @@ static inline void myri10ge_ss_init_lock(struct myri10ge_slice_state *ss)
static inline bool myri10ge_ss_lock_napi(struct myri10ge_slice_state *ss)
{
- int rc = true;
+ bool rc = true;
spin_lock(&ss->lock);
if ((ss->state & SLICE_LOCKED)) {
WARN_ON((ss->state & SLICE_STATE_NAPI));
@@ -957,7 +957,7 @@ static inline void myri10ge_ss_unlock_napi(struct myri10ge_slice_state *ss)
static inline bool myri10ge_ss_lock_poll(struct myri10ge_slice_state *ss)
{
- int rc = true;
+ bool rc = true;
spin_lock_bh(&ss->lock);
if ((ss->state & SLICE_LOCKED)) {
ss->state |= SLICE_STATE_POLL_YIELD;
--
1.8.3.1
^ permalink raw reply related
* [PATCH 11/19] wireless: Change variable type to bool
From: Peter Senna Tschudin @ 2013-09-21 22:27 UTC (permalink / raw)
To: bzhao
Cc: linville, linux-wireless, netdev, linux-kernel, kernel-janitors,
Peter Senna Tschudin
In-Reply-To: <1379802471-30252-1-git-send-email-peter.senna@gmail.com>
The variables cancel_scan_cmd, enable_data, hs_activate and valid are
only assigned the values true and false. Change its type to bool.
The simplified semantic patch that find this problem is as
follows (http://coccinelle.lip6.fr/):
@exists@
type T;
identifier b;
@@
- T
+ bool
b = ...;
... when any
b = \(true\|false\)
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
---
drivers/net/wireless/mwifiex/cmdevt.c | 2 +-
drivers/net/wireless/mwifiex/join.c | 2 +-
drivers/net/wireless/mwifiex/sta_cmd.c | 2 +-
drivers/net/wireless/mwifiex/wmm.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c
index 2d76147..fb3fa18 100644
--- a/drivers/net/wireless/mwifiex/cmdevt.c
+++ b/drivers/net/wireless/mwifiex/cmdevt.c
@@ -1048,7 +1048,7 @@ mwifiex_cancel_pending_ioctl(struct mwifiex_adapter *adapter)
struct cmd_ctrl_node *cmd_node = NULL, *tmp_node = NULL;
unsigned long cmd_flags;
unsigned long scan_pending_q_flags;
- uint16_t cancel_scan_cmd = false;
+ bool cancel_scan_cmd = false;
if ((adapter->curr_cmd) &&
(adapter->curr_cmd->wait_q_enabled)) {
diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c
index 9d7c0e6..717fbe2 100644
--- a/drivers/net/wireless/mwifiex/join.c
+++ b/drivers/net/wireless/mwifiex/join.c
@@ -621,7 +621,7 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv,
int ret = 0;
struct ieee_types_assoc_rsp *assoc_rsp;
struct mwifiex_bssdescriptor *bss_desc;
- u8 enable_data = true;
+ bool enable_data = true;
u16 cap_info, status_code;
assoc_rsp = (struct ieee_types_assoc_rsp *) &resp->params;
diff --git a/drivers/net/wireless/mwifiex/sta_cmd.c b/drivers/net/wireless/mwifiex/sta_cmd.c
index c0268b5..7d66018 100644
--- a/drivers/net/wireless/mwifiex/sta_cmd.c
+++ b/drivers/net/wireless/mwifiex/sta_cmd.c
@@ -327,7 +327,7 @@ mwifiex_cmd_802_11_hs_cfg(struct mwifiex_private *priv,
{
struct mwifiex_adapter *adapter = priv->adapter;
struct host_cmd_ds_802_11_hs_cfg_enh *hs_cfg = &cmd->params.opt_hs_cfg;
- u16 hs_activate = false;
+ bool hs_activate = false;
if (!hscfg_param)
/* New Activate command */
diff --git a/drivers/net/wireless/mwifiex/wmm.c b/drivers/net/wireless/mwifiex/wmm.c
index 2e8f9cd..8f8fea0 100644
--- a/drivers/net/wireless/mwifiex/wmm.c
+++ b/drivers/net/wireless/mwifiex/wmm.c
@@ -708,7 +708,7 @@ int mwifiex_ret_wmm_get_status(struct mwifiex_private *priv,
{
u8 *curr = (u8 *) &resp->params.get_wmm_status;
uint16_t resp_len = le16_to_cpu(resp->size), tlv_len;
- int valid = true;
+ bool valid = true;
struct mwifiex_ie_types_data *tlv_hdr;
struct mwifiex_ie_types_wmm_queue_status *tlv_wmm_qstatus;
--
1.8.3.1
^ permalink raw reply related
* [PATCH 12/19] wireless: Change variable type to bool
From: Peter Senna Tschudin @ 2013-09-21 22:27 UTC (permalink / raw)
To: Larry.Finger
Cc: chaoming_li, linville, linux-wireless, netdev, linux-kernel,
kernel-janitors, Peter Senna Tschudin
In-Reply-To: <1379802471-30252-1-git-send-email-peter.senna@gmail.com>
The variable continual is only assigned the values true and false.
Change its type to bool.
The simplified semantic patch that find this problem is as
follows (http://coccinelle.lip6.fr/):
@exists@
type T;
identifier b;
@@
- T
+ bool
b = ...;
... when any
b = \(true\|false\)
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
---
drivers/net/wireless/rtlwifi/efuse.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/rtlwifi/efuse.c b/drivers/net/wireless/rtlwifi/efuse.c
index 838a1ed..63d370d 100644
--- a/drivers/net/wireless/rtlwifi/efuse.c
+++ b/drivers/net/wireless/rtlwifi/efuse.c
@@ -1203,7 +1203,7 @@ static void efuse_power_switch(struct ieee80211_hw *hw, u8 write, u8 pwrstate)
static u16 efuse_get_current_size(struct ieee80211_hw *hw)
{
- int continual = true;
+ bool continual = true;
u16 efuse_addr = 0;
u8 hworden;
u8 efuse_data, word_cnts;
--
1.8.3.1
^ permalink raw reply related
* [PATCH 19/19] net: Change variable type to bool
From: Peter Senna Tschudin @ 2013-09-21 22:27 UTC (permalink / raw)
To: davem
Cc: kuznet, jmorris, kaber, netdev, linux-kernel, kernel-janitors,
Peter Senna Tschudin
In-Reply-To: <1379802471-30252-1-git-send-email-peter.senna@gmail.com>
The variable fully_acked is only assigned the values true and false.
Change its type to bool.
The simplified semantic patch that find this problem is as
follows (http://coccinelle.lip6.fr/):
@exists@
type T;
identifier b;
@@
- T
+ bool
b = ...;
... when any
b = \(true\|false\)
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
---
net/ipv4/tcp_input.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 25a89ea..fa17dce 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2970,7 +2970,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets,
const struct inet_connection_sock *icsk = inet_csk(sk);
struct sk_buff *skb;
u32 now = tcp_time_stamp;
- int fully_acked = true;
+ bool fully_acked = true;
int flag = 0;
u32 pkts_acked = 0;
u32 reord = tp->packets_out;
--
1.8.3.1
^ permalink raw reply related
* Re: [PATCH] declance: Remove `incompatible pointer type' warnings
From: Sergei Shtylyov @ 2013-09-21 22:41 UTC (permalink / raw)
To: Maciej W. Rozycki; +Cc: netdev
In-Reply-To: <alpine.LFD.2.03.1309200008060.5967@linux-mips.org>
Hello.
On 09/20/2013 03:49 AM, Maciej W. Rozycki wrote:
> Revert damage caused by 43d620c82985b19008d87a437b4cf83f356264f7:
Please also specify that commit's summary in parens. That's the only way
to uniquely identify a commit and makes life a bit easier when you browse the
commits.
> .../declance.c: In function 'cp_to_buf':
> .../declance.c:347: warning: assignment from incompatible pointer type
> .../declance.c:348: warning: assignment from incompatible pointer type
> .../declance.c: In function 'cp_from_buf':
> .../declance.c:406: warning: assignment from incompatible pointer type
> .../declance.c:407: warning: assignment from incompatible pointer type
> Also add a `const' qualifier where applicable and adjust formatting.
> Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
WBR, Sergei
^ permalink raw reply
* [PATCH ethtool] Fix iteration count in sff8472_calibration()
From: Ben Hutchings @ 2013-09-22 1:36 UTC (permalink / raw)
To: Ben Hutchings; +Cc: netdev, Aurelien Guillaume
[-- Attachment #1: Type: text/plain, Size: 962 bytes --]
We want to iterate over all elements of the various arrays of readings
(which all have the same dimensions - and maybe ought to be a single
array). Unfortunately the iteration count is sizeof(sd->bias_cur) and
bias_cur has 2-byte elements, so we iterate over twice as many
elements as are really there.
Compiler-detected, and compile-tested only.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
sfpdiag.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sfpdiag.c b/sfpdiag.c
index f67e491..04fd880 100644
--- a/sfpdiag.c
+++ b/sfpdiag.c
@@ -224,7 +224,7 @@ static void sff8472_calibration(const __u8 *id, struct sff8472_diags *sd)
__u16 rx_reading;
/* Calibration should occur for all values (threshold and current) */
- for (i = 0; i < sizeof(sd->bias_cur); ++i) {
+ for (i = 0; i < ARRAY_SIZE(sd->bias_cur); ++i) {
/*
* Apply calibration formula 1 (Temp., Voltage, Bias, Tx Power)
*/
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply related
* Re: [Xen-devel] TSQ accounting skb->truesize degrades throughput for large packets
From: Cong Wang @ 2013-09-22 2:36 UTC (permalink / raw)
To: Wei Liu; +Cc: xen-devel, Linux Kernel Network Developers, Eric Dumazet
In-Reply-To: <20130921150327.GA9078@zion.uk.xensource.com>
On Sat, Sep 21, 2013 at 11:03 PM, Wei Liu <wei.liu2@citrix.com> wrote:
> On Sat, Sep 21, 2013 at 03:00:26AM +0000, Cong Wang wrote:
>> Eric Dumazet <eric.dumazet <at> gmail.com> writes:
>>
>> >
>> > Yeah, my own test was more like the following
>> >
>> ...
>> >
>> > Note that it also seems to make Hystart happier.
>> >
>> > I will send patches when all tests are green.
>> >
>>
>> How is this going? I don't see any patch posted to netdev.
>>
>
> I'm afraid you forgot to CC any relevant people in thie email. :-)
>
I was replying via newsgroup, not mailing list. :)
Anyway, adding Eric and netdev now.
^ permalink raw reply
* Re: [Xen-devel] [PATCH net-next v2 1/2] xen-netback: add a vif-is-connected flag
From: annie li @ 2013-09-22 2:56 UTC (permalink / raw)
To: Paul Durrant; +Cc: netdev, xen-devel, Wei Liu, David Vrabel, Ian Campbell
In-Reply-To: <1379685460-25032-2-git-send-email-paul.durrant@citrix.com>
On 2013-9-20 21:57, Paul Durrant wrote:
> Having applied my patch to separate vif disconnect and free, I ran into a
> BUG when testing resume from S3 with a Windows frontend because the vif task
> pointer was not cleared by xenvif_disconnect() and so a double call to this
> function tries to stop the thread twice.
Or it is better to do more implements in windows netfront? For example,
when the windows vm hibernates, disconnect the vif as required by
netback: connect-> closing-> closed.
Thanks
Annie
> Rather than applying a point fix for that issue it seems better to introduce
> a boolean to indicate whether the vif is connected or not such that repeated
> calls to either xenvif_connect() or xenvif_disconnect() behave appropriately.
>
> Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
> Cc: David Vrabel <david.vrabel@citrix.com>
> Cc: Wei Liu <wei.liu2@citrix.com>
> Cc: Ian Campbell <ian.campbell@citrix.com>
> ---
> drivers/net/xen-netback/common.h | 1 +
> drivers/net/xen-netback/interface.c | 24 +++++++++++++-----------
> 2 files changed, 14 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
> index 5715318..860d92c 100644
> --- a/drivers/net/xen-netback/common.h
> +++ b/drivers/net/xen-netback/common.h
> @@ -169,6 +169,7 @@ struct xenvif {
>
> /* Miscellaneous private stuff. */
> struct net_device *dev;
> + bool connected;
> };
>
> static inline struct xenbus_device *xenvif_to_xenbus_device(struct xenvif *vif)
> diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
> index 01bb854..94b47f5 100644
> --- a/drivers/net/xen-netback/interface.c
> +++ b/drivers/net/xen-netback/interface.c
> @@ -366,7 +366,7 @@ int xenvif_connect(struct xenvif *vif, unsigned long tx_ring_ref,
> int err = -ENOMEM;
>
> /* Already connected through? */
> - if (vif->tx_irq)
> + if (vif->connected)
> return 0;
>
> err = xenvif_map_frontend_rings(vif, tx_ring_ref, rx_ring_ref);
> @@ -425,6 +425,7 @@ int xenvif_connect(struct xenvif *vif, unsigned long tx_ring_ref,
>
> wake_up_process(vif->task);
>
> + vif->connected = 1;
> return 0;
>
> err_rx_unbind:
> @@ -453,23 +454,24 @@ void xenvif_carrier_off(struct xenvif *vif)
>
> void xenvif_disconnect(struct xenvif *vif)
> {
> + if (!vif->connected)
> + return;
> +
> if (netif_carrier_ok(vif->dev))
> xenvif_carrier_off(vif);
>
> - if (vif->tx_irq) {
> - if (vif->tx_irq == vif->rx_irq)
> - unbind_from_irqhandler(vif->tx_irq, vif);
> - else {
> - unbind_from_irqhandler(vif->tx_irq, vif);
> - unbind_from_irqhandler(vif->rx_irq, vif);
> - }
> - vif->tx_irq = 0;
> + if (vif->tx_irq == vif->rx_irq)
> + unbind_from_irqhandler(vif->tx_irq, vif);
> + else {
> + unbind_from_irqhandler(vif->tx_irq, vif);
> + unbind_from_irqhandler(vif->rx_irq, vif);
> }
>
> - if (vif->task)
> - kthread_stop(vif->task);
> + kthread_stop(vif->task);
>
> xenvif_unmap_frontend_rings(vif);
> +
> + vif->connected = 0;
> }
>
> void xenvif_free(struct xenvif *vif)
^ permalink raw reply
* Re: [PATCH 1/2] net: phy: at803x: don't pass function pointers with &
From: Mugunthan V N @ 2013-09-22 5:59 UTC (permalink / raw)
To: Daniel Mack; +Cc: netdev, davem, ujhelyi.m, sergei.shtylyov
In-Reply-To: <1379775182-1271-1-git-send-email-zonque@gmail.com>
On Saturday 21 September 2013 08:23 PM, Daniel Mack wrote:
> Just a cosmetic cleanup.
>
> Signed-off-by: Daniel Mack <zonque@gmail.com>
Looks good to me
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
Regards
Mugunthan V N
^ permalink raw reply
* Re: [PATCH 2/2] net: phy: at803x: add suspend/resume callbacks
From: Mugunthan V N @ 2013-09-22 6:00 UTC (permalink / raw)
To: Daniel Mack, netdev; +Cc: davem, ujhelyi.m, sergei.shtylyov
In-Reply-To: <1379775182-1271-2-git-send-email-zonque@gmail.com>
On Saturday 21 September 2013 08:23 PM, Daniel Mack wrote:
> When WOL is enabled, the chip can't be put into power-down (BMCR_PDOWN)
> mode, as that will also switch off the MAC, which consequently leads to
> a link loss.
>
> Use BMCR_ISOLATE in that case, which will at least save us some
> milliamperes in comparison to normal operation mode.
>
> Signed-off-by: Daniel Mack <zonque@gmail.com>
Looks good to me
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
Regards
Mugunthan V N
^ permalink raw reply
* Re: [Xen-devel] [PATCH net-next] xen-netfront: convert to GRO API and advertise this feature
From: Jason Wang @ 2013-09-22 6:29 UTC (permalink / raw)
To: Wei Liu, netdev; +Cc: Anirban Chakraborty, Ian Campbell, xen-devel
In-Reply-To: <1379779543-27122-1-git-send-email-wei.liu2@citrix.com>
On 09/22/2013 12:05 AM, Wei Liu wrote:
> Anirban was seeing netfront received MTU size packets, which downgraded
> throughput. The following patch makes netfront use GRO API which
> improves throughput for that case.
>
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> Signed-off-by: Anirban Chakraborty <abchak@juniper.net>
> Cc: Ian Campbell <ian.campbell@citrix.com>
Maybe a dumb question: doesn't Xen depends on the driver of host card to
do GRO and pass it to netfront? What the case that netfront can receive
a MTU size packet, for a card that does not support GRO in host? Doing
GRO twice may introduce extra overheads.
Thanks
^ permalink raw reply
* Re: Re: [PATCH] USB2NET : SR9700 : One chip USB 1.1 USB2NETSR9700Device Driver Support
From: liujunliang_ljl @ 2013-09-22 7:44 UTC (permalink / raw)
To: David Miller
Cc: horms, joe, romieu, gregkh, netdev, linux-usb, linux-kernel,
sunhecheng
In-Reply-To: <20130903.222708.238851084536537650.davem@davemloft.net>
Dear Miller :
I'm sorry to trouble you that How about the process for SR9700 Device Driver release?
Thanks a lot.
2013-09-22
liujunliang_ljl
发件人: David Miller
发送时间: 2013-09-04 10:27:14
收件人: liujunliang_ljl
抄送: horms; joe; romieu; gregkh; netdev; linux-usb; linux-kernel; sunhecheng
主题: Re: [PATCH] USB2NET : SR9700 : One chip USB 1.1 USB2NETSR9700Device Driver Support
From: liujunliang_ljl@163.com
Date: Sun, 1 Sep 2013 19:38:08 +0800
> From: Liu Junliang <liujunliang_ljl@163.com>
>
> Signed-off-by: Liu Junliang <liujunliang_ljl@163.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH 1/2] remove all uses of printf's %n
From: George Spelvin @ 2013-09-22 8:09 UTC (permalink / raw)
To: jslaby, keescook, penguin-kernel
Cc: akpm, dan.carpenter, geert, JBeulich, joe, kosaki.motohiro,
linux-kernel, linux-sctp, linux, netdev, remi.denis-courmont,
viro, xemul
In-Reply-To: <201309210928.JCF90671.OtOFLFQSOJVFMH@I-love.SAKURA.ne.jp>
> If you want, we can rename seq_pad() to seq_pad_and_putc(). Also we can pass
> both the padding character (e.g. ' ') and the trailing character (e.g. '\n')
> like seq_pad_and_putc((' ' << 8) | '\n'), though I wonder someone wants to
> use '\0', '\t', '\n' etc. as the padding character...
How about let that complexity wait until it's needed? It's not like
it's that big a PITA of a patch to write, and there's a significant
chance it will *never* be needed.
^ permalink raw reply
* Re: [PATCH 1/2] remove all uses of printf's %n
From: Geert Uytterhoeven @ 2013-09-22 8:16 UTC (permalink / raw)
To: Tetsuo Handa
Cc: Kees Cook, Jiri Slaby, Al Viro, xemul, remi.denis-courmont,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-sctp,
George Spelvin, Andrew Morton, Dan Carpenter, Jan Beulich,
Joe Perches, Motohiro KOSAKI
In-Reply-To: <201309210928.JCF90671.OtOFLFQSOJVFMH@I-love.SAKURA.ne.jp>
On Sat, Sep 21, 2013 at 2:28 AM, Tetsuo Handa
<penguin-kernel@i-love.sakura.ne.jp> wrote:
> Kees Cook wrote:
>> >> - seq_printf(seq, "%*s\n", 127 - len, "");
>> >> + seq_pad(seq, '\n');
>> >
>> > Hmm, seq_pad is unintuitive. I would say it pads the string by '\n'. Of
>> > course it does not, but...
>>
>> I don't think this is a very serious problem. Currently, the padding
>> character is always ' ' for all existing callers, so it only makes
>> sense to make the trailing character an argument.
>
> If you want, we can rename seq_pad() to seq_pad_and_putc(). Also we can pass
> both the padding character (e.g. ' ') and the trailing character (e.g. '\n')
> like seq_pad_and_putc((' ' << 8) | '\n'), though I wonder someone wants to
> use '\0', '\t', '\n' etc. as the padding character...
Not those special characters. '-' could be useful for tables (doh,
text-mode graphics
log output).
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* Re: [PATCH 12/19] wireless: Change variable type to bool
From: Joe Perches @ 2013-09-22 8:22 UTC (permalink / raw)
To: Peter Senna Tschudin
Cc: Larry.Finger, chaoming_li, linville, linux-wireless, netdev,
linux-kernel, kernel-janitors
In-Reply-To: <1379802471-30252-12-git-send-email-peter.senna@gmail.com>
On Sun, 2013-09-22 at 00:27 +0200, Peter Senna Tschudin wrote:
> The variable continual is only assigned the values true and false.
> Change its type to bool.
[]
> diff --git a/drivers/net/wireless/rtlwifi/efuse.c b/drivers/net/wireless/rtlwifi/efuse.c
[]
> @@ -1203,7 +1203,7 @@ static void efuse_power_switch(struct ieee80211_hw *hw, u8 write, u8 pwrstate)
>
> static u16 efuse_get_current_size(struct ieee80211_hw *hw)
> {
> - int continual = true;
> + bool continual = true;
> u16 efuse_addr = 0;
> u8 hworden;
> u8 efuse_data, word_cnts;
Yes, this could use bool, but would probably be better
written without continual at all
as it is before this patch:
static u16 efuse_get_current_size(struct ieee80211_hw *hw)
{
int continual = true;
u16 efuse_addr = 0;
u8 hworden;
u8 efuse_data, word_cnts;
while (continual && efuse_one_byte_read(hw, efuse_addr, &efuse_data)
&& (efuse_addr < EFUSE_MAX_SIZE)) {
if (efuse_data != 0xFF) {
hworden = efuse_data & 0x0F;
word_cnts = efuse_calculate_word_cnts(hworden);
efuse_addr = efuse_addr + (word_cnts * 2) + 1;
} else {
continual = false;
}
}
return efuse_addr;
}
I think writing it without continual, which is effectively
an ersatz "break", would be better
Something like:
static u16 efuse_get_current_size(struct ieee80211_hw *hw)
{
u16 efuse_addr = 0;
u8 hworden;
u8 efuse_data, word_cnts;
while (efuse_one_byte_read(hw, efuse_addr, &efuse_data) &&
(efuse_addr < EFUSE_MAX_SIZE) {
if (efuse_data == 0xff)
break;
hworden = efuse_data & 0x0F;
word_cnts = efuse_calculate_word_cnts(hworden);
efuse_addr = efuse_addr + (word_cnts * 2) + 1;
}
return efuse_addr;
}
^ permalink raw reply
* Donation!!! Forthe purpose of confidentiality and to claim your prize, reply via this email :bayfordadrian1@gmail.com
From: Kelsey Gries @ 2013-09-22 9:59 UTC (permalink / raw)
This is a personal mail directed to you. My wife and I won 148.6m in the
Euro Millions jackpot in August 2012 and have voluntarily decided to
donate $1,000,000..00 USD to you as part of our own charity project to
improve the life of 10 lucky individuals all over the world.If you have
received this email please do not delete it and it is not by mistake
because you are one of the lucky recipients, get back to us with your
details so that we can forward it to the payout bank who will transfer
your own part of the donation to you.
You can verify this by visiting the web pages below.
http://www.guardian.co.uk/uk/2012/aug/14/british-euromillions-jackpot-winners-revealed
http://www.bbc.co.uk/news/uk-england-19254228
For the purpose of confidentiality and to claim your prize, reply via
this email :bayfordadrian1@gmail.com
Yours Sincerely,
Gillian & Adrian Bayford
^ permalink raw reply
* [PATCH] Do not drop DNATed 6to4/6rd packets
From: Catalin(ux) M. BOIE @ 2013-09-22 10:58 UTC (permalink / raw)
To: netdev; +Cc: hannes, yoshfuji, davem
In-Reply-To: <20130915131401.GA18477@order.stressinduktion.org>
From: "Catalin(ux) M. BOIE" <catab@embedromix.ro>
When a router is doing DNAT for 6to4/6rd packets the latest anti-spoofing
patch (218774dc) will drop them because the IPv6 address embedded
does not match the IPv4 destination. This patch will allow them to
pass by testing if we have an address that matches on 6to4/6rd interface.
I have been hit by this problem using Fedora and IPV6TO4_IPV4ADDR.
Also, log the dropped packets (with rate limit).
Signed-off-by: Catalin(ux) M. BOIE <catab@embedromix.ro>
---
include/net/addrconf.h | 4 +++
net/ipv6/addrconf.c | 27 ++++++++++++++++
net/ipv6/sit.c | 83 +++++++++++++++++++++++++++++++++++++++++---------
3 files changed, 99 insertions(+), 15 deletions(-)
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index fb314de..96966eb 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -67,6 +67,10 @@ int ipv6_chk_addr(struct net *net, const struct in6_addr *addr,
int ipv6_chk_home_addr(struct net *net, const struct in6_addr *addr);
#endif
+extern bool ipv6_chk_custom_prefix(const struct in6_addr *addr,
+ const unsigned int prefix_len,
+ struct net_device *dev);
+
int ipv6_chk_prefix(const struct in6_addr *addr, struct net_device *dev);
struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net,
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index d6ff126..a0c3abe 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1499,6 +1499,33 @@ static bool ipv6_chk_same_addr(struct net *net, const struct in6_addr *addr,
return false;
}
+/* Compares an address/prefix_len with addresses on device @dev.
+ * If one is found it returns true.
+ */
+bool ipv6_chk_custom_prefix(const struct in6_addr *addr,
+ const unsigned int prefix_len, struct net_device *dev)
+{
+ struct inet6_dev *idev;
+ struct inet6_ifaddr *ifa;
+ bool ret = false;
+
+ rcu_read_lock();
+ idev = __in6_dev_get(dev);
+ if (idev) {
+ read_lock_bh(&idev->lock);
+ list_for_each_entry(ifa, &idev->addr_list, if_list) {
+ ret = ipv6_prefix_equal(addr, &ifa->addr, prefix_len);
+ if (ret)
+ break;
+ }
+ read_unlock_bh(&idev->lock);
+ }
+ rcu_read_unlock();
+
+ return ret;
+}
+EXPORT_SYMBOL(ipv6_chk_custom_prefix);
+
int ipv6_chk_prefix(const struct in6_addr *addr, struct net_device *dev)
{
struct inet6_dev *idev;
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 7ee5cb9..6b2230d 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -566,6 +566,69 @@ static inline bool is_spoofed_6rd(struct ip_tunnel *tunnel, const __be32 v4addr,
return false;
}
+/* Checks if an address matches an address on the tunnel interface.
+ * Used to detect the NAT of proto 41 packets and let them pass spoofing test.
+ * Long story:
+ * This function is called after we considered the packet as spoofed
+ * in is_spoofed_6rd.
+ * We may have a router that is doing NAT for proto 41 packets
+ * for an internal station. Destination a.a.a.a/PREFIX:bbbb:bbbb
+ * will be translated to n.n.n.n/PREFIX:bbbb:bbbb. And is_spoofed_6rd
+ * function will return true, dropping the packet.
+ * But, we can still check if is spoofed against the IP
+ * addresses associated with the interface.
+ */
+static bool only_dnatted(const struct ip_tunnel *tunnel,
+ const struct in6_addr *v6dst)
+{
+ int prefix_len;
+
+#ifdef CONFIG_IPV6_SIT_6RD
+ prefix_len = tunnel->ip6rd.prefixlen + 32
+ - tunnel->ip6rd.relay_prefixlen;
+#else
+ prefix_len = 48;
+#endif
+ return ipv6_chk_custom_prefix(v6dst, prefix_len, tunnel->dev);
+}
+
+/* Returns true if a packet is spoofed
+ */
+static bool packet_is_spoofed(struct sk_buff *skb,
+ const struct iphdr *iph,
+ struct ip_tunnel *tunnel)
+{
+ const struct ipv6hdr *ipv6h = ipv6_hdr(skb);
+
+ if (tunnel->dev->priv_flags & IFF_ISATAP) {
+ if (!isatap_chksrc(skb, iph, tunnel))
+ return true;
+
+ return false;
+ }
+
+ if ((tunnel->dev->flags&IFF_POINTOPOINT))
+ return false;
+
+ if (unlikely(is_spoofed_6rd(tunnel, iph->saddr, &ipv6h->saddr))) {
+ net_warn_ratelimited("Src spoofed %pI4/%pI6c -> %pI4/%pI6c\n",
+ &iph->saddr, &ipv6h->saddr,
+ &iph->daddr, &ipv6h->daddr);
+ return true;
+ }
+
+ if (likely(!is_spoofed_6rd(tunnel, iph->daddr, &ipv6h->daddr)))
+ return false;
+
+ if (only_dnatted(tunnel, &ipv6h->daddr))
+ return false;
+
+ net_warn_ratelimited("Dst spoofed %pI4/%pI6c -> %pI4/%pI6c\n",
+ &iph->saddr, &ipv6h->saddr,
+ &iph->daddr, &ipv6h->daddr);
+ return true;
+}
+
static int ipip6_rcv(struct sk_buff *skb)
{
const struct iphdr *iph = ip_hdr(skb);
@@ -586,19 +649,9 @@ static int ipip6_rcv(struct sk_buff *skb)
IPCB(skb)->flags = 0;
skb->protocol = htons(ETH_P_IPV6);
- if (tunnel->dev->priv_flags & IFF_ISATAP) {
- if (!isatap_chksrc(skb, iph, tunnel)) {
- tunnel->dev->stats.rx_errors++;
- goto out;
- }
- } else if (!(tunnel->dev->flags&IFF_POINTOPOINT)) {
- if (is_spoofed_6rd(tunnel, iph->saddr,
- &ipv6_hdr(skb)->saddr) ||
- is_spoofed_6rd(tunnel, iph->daddr,
- &ipv6_hdr(skb)->daddr)) {
- tunnel->dev->stats.rx_errors++;
- goto out;
- }
+ if (packet_is_spoofed(skb, iph, tunnel)) {
+ tunnel->dev->stats.rx_errors++;
+ goto out;
}
__skb_tunnel_rx(skb, tunnel->dev, tunnel->net);
@@ -748,7 +801,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
neigh = dst_neigh_lookup(skb_dst(skb), &iph6->daddr);
if (neigh == NULL) {
- net_dbg_ratelimited("sit: nexthop == NULL\n");
+ net_dbg_ratelimited("nexthop == NULL\n");
goto tx_error;
}
@@ -777,7 +830,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
neigh = dst_neigh_lookup(skb_dst(skb), &iph6->daddr);
if (neigh == NULL) {
- net_dbg_ratelimited("sit: nexthop == NULL\n");
+ net_dbg_ratelimited("nexthop == NULL\n");
goto tx_error;
}
--
1.8.3.1
^ 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