* [PATCH 2.6.36] vlan: Avoid hwaccel vlan packets when vid not used
From: Eric Dumazet @ 2010-12-01 10:55 UTC (permalink / raw)
To: Michael Leun, David Miller
Cc: Ben Greear, linux-kernel, netdev, Jesse Gross, stable
In-Reply-To: <20101201111716.424fb771@xenia.leun.net>
Le mercredi 01 décembre 2010 à 11:17 +0100, Michael Leun a écrit :
> Yup, from what I've tested this works (and tcpdump sees broadcast
> packets even for vlans not configured at the moment including vlan tag
> - yipee!).
>
Thanks Michael !
Here is the revised patch again then for stable team, via David Miller
agreement.
[PATCH v2 2.6.36] vlan: Avoid hwaccel vlan packets when vid not used.
Normally hardware accelerated vlan packets are quickly dropped if
there is no corresponding vlan device configured. The one exception
is promiscuous mode, where we allow all of these packets through so
they can be picked up by tcpdump. However, this behavior causes a
crash if we actually try to receive these packets. This fixes that
crash by ignoring packets with vids not corresponding to a configured
device in the vlan hwaccel routines and then dropping them before they
get to consumers in the network stack.
Reported-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Tested-by: Michael Leun <lkml20101129@newton.leun.net>
---
v2: survives to tcpdump :)
net/core/dev.c | 10 ++++++++++
net/8021q/vlan_core.c | 3 +++
2 files changed, 13 insertions(+)
--- linux-2.6.36/net/core/dev.c.orig
+++ linux-2.6.36/net/core/dev.c
@@ -2891,6 +2891,15 @@
ncls:
#endif
+ /* If we got this far with a hardware accelerated VLAN tag, it means
+ * that we were put in promiscuous mode but nobody is interested in
+ * this vid. Drop the packet now to prevent it from getting propagated
+ * to other parts of the stack that won't know how to deal with packets
+ * tagged in this manner.
+ */
+ if (unlikely(vlan_tx_tag_present(skb)))
+ goto bypass;
+
/* Handle special case of bridge or macvlan */
rx_handler = rcu_dereference(skb->dev->rx_handler);
if (rx_handler) {
@@ -2927,6 +2936,7 @@
}
}
+bypass:
if (pt_prev) {
ret = pt_prev->func(skb, skb->dev, pt_prev, orig_dev);
} else {
--- linux-2.6.36/net/8021q/vlan_core.c.orig
+++ linux-2.6.36/net/8021q/vlan_core.c
@@ -43,6 +43,9 @@
struct net_device *dev = skb->dev;
struct vlan_rx_stats *rx_stats;
+ if (unlikely(!is_vlan_dev(dev)))
+ return 0;
+
skb->dev = vlan_dev_info(dev)->real_dev;
netif_nit_deliver(skb);
^ permalink raw reply
* [PATCH net-next-2.6 1/3] be2net: Fix be_dev_family_check() return value check
From: Sathya Perla @ 2010-12-01 11:02 UTC (permalink / raw)
To: netdev
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
drivers/net/benet/be_main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 102567e..ca4bf9b 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -2899,7 +2899,7 @@ static int __devinit be_probe(struct pci_dev *pdev,
pci_set_drvdata(pdev, adapter);
status = be_dev_family_check(adapter);
- if (!status)
+ if (status)
goto free_netdev;
adapter->netdev = netdev;
--
1.6.5.2
^ permalink raw reply related
* [PATCH net-next-2.6 2/3] be2net: FW init cmd fix for lancer
From: Sathya Perla @ 2010-12-01 11:03 UTC (permalink / raw)
To: netdev
Lancer can use the same pattern as BE to indicate a driver load
to the FW.
Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
drivers/net/benet/be_cmds.c | 27 ++++++++-------------------
1 files changed, 8 insertions(+), 19 deletions(-)
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index 3865b2b..31c5ddc 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -470,25 +470,14 @@ int be_cmd_fw_init(struct be_adapter *adapter)
spin_lock(&adapter->mbox_lock);
wrb = (u8 *)wrb_from_mbox(adapter);
- if (lancer_chip(adapter)) {
- *wrb++ = 0xFF;
- *wrb++ = 0x34;
- *wrb++ = 0x12;
- *wrb++ = 0xFF;
- *wrb++ = 0xFF;
- *wrb++ = 0x78;
- *wrb++ = 0x56;
- *wrb = 0xFF;
- } else {
- *wrb++ = 0xFF;
- *wrb++ = 0x12;
- *wrb++ = 0x34;
- *wrb++ = 0xFF;
- *wrb++ = 0xFF;
- *wrb++ = 0x56;
- *wrb++ = 0x78;
- *wrb = 0xFF;
- }
+ *wrb++ = 0xFF;
+ *wrb++ = 0x12;
+ *wrb++ = 0x34;
+ *wrb++ = 0xFF;
+ *wrb++ = 0xFF;
+ *wrb++ = 0x56;
+ *wrb++ = 0x78;
+ *wrb = 0xFF;
status = be_mbox_notify_wait(adapter);
--
1.6.5.2
^ permalink raw reply related
* [PATCH net-next-2.6 3/3] be2net: Handle out of buffer completions for lancer
From: Sathya Perla @ 2010-12-01 11:04 UTC (permalink / raw)
To: netdev
If Lancer chip does not have posted RX buffers, it posts an RX completion entry
with the same frag_index as the last valid completion. The Error bit is also
set. In BE, a flush completion is indicated with a zero value for num_rcvd in
the completion.
Such completions don't carry any data and are not processed.
This patch refactors code to handle both cases with the same code.
Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
drivers/net/benet/be.h | 4 ++-
drivers/net/benet/be_main.c | 55 +++++++++++++++++++++++++++---------------
2 files changed, 38 insertions(+), 21 deletions(-)
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h
index b61a1df..9cab323 100644
--- a/drivers/net/benet/be.h
+++ b/drivers/net/benet/be.h
@@ -220,7 +220,9 @@ struct be_rx_obj {
struct be_rx_stats stats;
u8 rss_id;
bool rx_post_starved; /* Zero rx frags have been posted to BE */
- u32 cache_line_barrier[16];
+ u16 last_frag_index;
+ u16 rsvd;
+ u32 cache_line_barrier[15];
};
struct be_vf_cfg {
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index ca4bf9b..114a2d4 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -911,11 +911,17 @@ static void be_rx_compl_discard(struct be_adapter *adapter,
rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp);
num_rcvd = AMAP_GET_BITS(struct amap_eth_rx_compl, numfrags, rxcp);
- for (i = 0; i < num_rcvd; i++) {
- page_info = get_rx_page_info(adapter, rxo, rxq_idx);
- put_page(page_info->page);
- memset(page_info, 0, sizeof(*page_info));
- index_inc(&rxq_idx, rxq->len);
+ /* Skip out-of-buffer compl(lancer) or flush compl(BE) */
+ if (likely(rxq_idx != rxo->last_frag_index && num_rcvd != 0)) {
+
+ rxo->last_frag_index = rxq_idx;
+
+ for (i = 0; i < num_rcvd; i++) {
+ page_info = get_rx_page_info(adapter, rxo, rxq_idx);
+ put_page(page_info->page);
+ memset(page_info, 0, sizeof(*page_info));
+ index_inc(&rxq_idx, rxq->len);
+ }
}
}
@@ -1016,9 +1022,6 @@ static void be_rx_compl_process(struct be_adapter *adapter,
u8 vtm;
num_rcvd = AMAP_GET_BITS(struct amap_eth_rx_compl, numfrags, rxcp);
- /* Is it a flush compl that has no data */
- if (unlikely(num_rcvd == 0))
- return;
skb = netdev_alloc_skb_ip_align(adapter->netdev, BE_HDR_LEN);
if (unlikely(!skb)) {
@@ -1075,10 +1078,6 @@ static void be_rx_compl_process_gro(struct be_adapter *adapter,
u8 pkt_type;
num_rcvd = AMAP_GET_BITS(struct amap_eth_rx_compl, numfrags, rxcp);
- /* Is it a flush compl that has no data */
- if (unlikely(num_rcvd == 0))
- return;
-
pkt_size = AMAP_GET_BITS(struct amap_eth_rx_compl, pktsize, rxcp);
vlanf = AMAP_GET_BITS(struct amap_eth_rx_compl, vtp, rxcp);
rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp);
@@ -1349,7 +1348,7 @@ static void be_rx_q_clean(struct be_adapter *adapter, struct be_rx_obj *rxo)
while ((rxcp = be_rx_compl_get(rxo)) != NULL) {
be_rx_compl_discard(adapter, rxo, rxcp);
be_rx_compl_reset(rxcp);
- be_cq_notify(adapter, rx_cq->id, true, 1);
+ be_cq_notify(adapter, rx_cq->id, false, 1);
}
/* Then free posted rx buffer that were not used */
@@ -1576,6 +1575,9 @@ static int be_rx_queues_create(struct be_adapter *adapter)
adapter->big_page_size = (1 << get_order(rx_frag_size)) * PAGE_SIZE;
for_all_rx_queues(adapter, rxo, i) {
rxo->adapter = adapter;
+ /* Init last_frag_index so that the frag index in the first
+ * completion will never match */
+ rxo->last_frag_index = 0xffff;
rxo->rx_eq.max_eqd = BE_MAX_EQD;
rxo->rx_eq.enable_aic = true;
@@ -1697,10 +1699,9 @@ static irqreturn_t be_msix_tx_mcc(int irq, void *dev)
return IRQ_HANDLED;
}
-static inline bool do_gro(struct be_adapter *adapter, struct be_rx_obj *rxo,
- struct be_eth_rx_compl *rxcp)
+static inline bool do_gro(struct be_rx_obj *rxo,
+ struct be_eth_rx_compl *rxcp, u8 err)
{
- int err = AMAP_GET_BITS(struct amap_eth_rx_compl, err, rxcp);
int tcp_frame = AMAP_GET_BITS(struct amap_eth_rx_compl, tcpf, rxcp);
if (err)
@@ -1717,6 +1718,8 @@ static int be_poll_rx(struct napi_struct *napi, int budget)
struct be_queue_info *rx_cq = &rxo->cq;
struct be_eth_rx_compl *rxcp;
u32 work_done;
+ u16 frag_index, num_rcvd;
+ u8 err;
rxo->stats.rx_polls++;
for (work_done = 0; work_done < budget; work_done++) {
@@ -1724,10 +1727,22 @@ static int be_poll_rx(struct napi_struct *napi, int budget)
if (!rxcp)
break;
- if (do_gro(adapter, rxo, rxcp))
- be_rx_compl_process_gro(adapter, rxo, rxcp);
- else
- be_rx_compl_process(adapter, rxo, rxcp);
+ err = AMAP_GET_BITS(struct amap_eth_rx_compl, err, rxcp);
+ frag_index = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx,
+ rxcp);
+ num_rcvd = AMAP_GET_BITS(struct amap_eth_rx_compl, numfrags,
+ rxcp);
+
+ /* Skip out-of-buffer compl(lancer) or flush compl(BE) */
+ if (likely(frag_index != rxo->last_frag_index &&
+ num_rcvd != 0)) {
+ rxo->last_frag_index = frag_index;
+
+ if (do_gro(rxo, rxcp, err))
+ be_rx_compl_process_gro(adapter, rxo, rxcp);
+ else
+ be_rx_compl_process(adapter, rxo, rxcp);
+ }
be_rx_compl_reset(rxcp);
}
--
1.6.5.2
^ permalink raw reply related
* [Patch] net: kill an RCU warning in inet_fill_link_af()
From: Amerigo Wang @ 2010-12-01 11:14 UTC (permalink / raw)
To: linux-kernel
Cc: WANG Cong, David S. Miller, Alexey Kuznetsov, Pekka Savola (ipv6),
James Morris, Hideaki YOSHIFUJI, Patrick McHardy, netdev
From: WANG Cong <amwang@redhat.com>
The latest net-next-2.6 triggers an RCU warning during boot,
lockdep complains that in inet_fill_link_af() we call rcu_dereference_check()
without rcu_read_lock() protection.
This patch fixes it by replacing __in_dev_get_rcu() with in_dev_get().
Signed-off-by: WANG Cong <amwang@redhat.com>
---
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index d9f71ba..73baed8 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1258,31 +1258,36 @@ errout:
static size_t inet_get_link_af_size(const struct net_device *dev)
{
- struct in_device *in_dev = __in_dev_get_rcu(dev);
+ struct in_device *in_dev = in_dev_get(dev);
if (!in_dev)
return 0;
+ in_dev_put(in_dev);
return nla_total_size(IPV4_DEVCONF_MAX * 4); /* IFLA_INET_CONF */
}
static int inet_fill_link_af(struct sk_buff *skb, const struct net_device *dev)
{
- struct in_device *in_dev = __in_dev_get_rcu(dev);
+ struct in_device *in_dev = in_dev_get(dev);
struct nlattr *nla;
- int i;
+ int i, ret = 0;
if (!in_dev)
return -ENODATA;
nla = nla_reserve(skb, IFLA_INET_CONF, IPV4_DEVCONF_MAX * 4);
- if (nla == NULL)
- return -EMSGSIZE;
+ if (nla == NULL) {
+ ret = -EMSGSIZE;
+ goto out;
+ }
for (i = 0; i < IPV4_DEVCONF_MAX; i++)
((u32 *) nla_data(nla))[i] = in_dev->cnf.data[i];
- return 0;
+out:
+ in_dev_put(in_dev);
+ return ret;
}
static const struct nla_policy inet_af_policy[IFLA_INET_MAX+1] = {
@@ -1293,11 +1298,14 @@ static int inet_validate_link_af(const struct net_device *dev,
const struct nlattr *nla)
{
struct nlattr *a, *tb[IFLA_INET_MAX+1];
+ struct in_device *in_dev = in_dev_get(dev);
int err, rem;
- if (dev && !__in_dev_get_rcu(dev))
+ if (dev && !in_dev)
return -EAFNOSUPPORT;
+ in_dev_put(in_dev);
+
err = nla_parse_nested(tb, IFLA_INET_MAX, nla, inet_af_policy);
if (err < 0)
return err;
@@ -1319,7 +1327,7 @@ static int inet_validate_link_af(const struct net_device *dev,
static int inet_set_link_af(struct net_device *dev, const struct nlattr *nla)
{
- struct in_device *in_dev = __in_dev_get_rcu(dev);
+ struct in_device *in_dev = in_dev_get(dev);
struct nlattr *a, *tb[IFLA_INET_MAX+1];
int rem;
@@ -1334,6 +1342,7 @@ static int inet_set_link_af(struct net_device *dev, const struct nlattr *nla)
ipv4_devconf_set(in_dev, nla_type(a), nla_get_u32(a));
}
+ in_dev_put(in_dev);
return 0;
}
^ permalink raw reply related
* Re: [Patch] bonding: clean up netpoll code
From: Cong Wang @ 2010-12-01 11:15 UTC (permalink / raw)
To: Herbert Xu
Cc: Eric Dumazet, linux-kernel, Jiri Pirko, Neil Horman, netdev,
David S. Miller, Eric W. Biederman, bonding-devel, Jay Vosburgh,
Stephen Hemminger
In-Reply-To: <20101201090621.GA11366@gondor.apana.org.au>
On 12/01/10 17:06, Herbert Xu wrote:
> On Wed, Dec 01, 2010 at 04:26:47PM +0800, Cong Wang wrote:
>>
>> Is this necessary?
>> It is just replacing checking IFF_IN_NETPOLL with netpoll_tx_running(),
>> you might need to take a look at the bridge code.
>
> I agree with Eric. The patch does look pretty scary right now.
>
> Each patch should do one thing and one thing only.
>
Ok, I will separate that part out.
Thanks!
^ permalink raw reply
* Re: [Patch] net: kill an RCU warning in inet_fill_link_af()
From: Eric Dumazet @ 2010-12-01 11:21 UTC (permalink / raw)
To: Amerigo Wang
Cc: linux-kernel, David S. Miller, Alexey Kuznetsov,
Pekka Savola (ipv6), James Morris, Hideaki YOSHIFUJI,
Patrick McHardy, netdev
In-Reply-To: <1291202063-6239-1-git-send-email-amwang@redhat.com>
Le mercredi 01 décembre 2010 à 19:14 +0800, Amerigo Wang a écrit :
> From: WANG Cong <amwang@redhat.com>
>
> The latest net-next-2.6 triggers an RCU warning during boot,
> lockdep complains that in inet_fill_link_af() we call rcu_dereference_check()
> without rcu_read_lock() protection.
>
> This patch fixes it by replacing __in_dev_get_rcu() with in_dev_get().
>
> Signed-off-by: WANG Cong <amwang@redhat.com>
>
Sorry patch is not the right fix. Please take a look at commit 95ae6b22
We are working hard to remove all the not needed get()/put(), not to add
new ones ;)
> ---
> diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
> index d9f71ba..73baed8 100644
> --- a/net/ipv4/devinet.c
> +++ b/net/ipv4/devinet.c
> @@ -1258,31 +1258,36 @@ errout:
>
> static size_t inet_get_link_af_size(const struct net_device *dev)
> {
> - struct in_device *in_dev = __in_dev_get_rcu(dev);
> + struct in_device *in_dev = in_dev_get(dev);
>
> if (!in_dev)
> return 0;
>
> + in_dev_put(in_dev);
> return nla_total_size(IPV4_DEVCONF_MAX * 4); /* IFLA_INET_CONF */
> }
>
In this function why should we even take a reference, just to check if
pointer exists ?
If RTNL is held (I believe so), just use __in_dev_get_rtnl()
> static int inet_fill_link_af(struct sk_buff *skb, const struct net_device *dev)
> {
> - struct in_device *in_dev = __in_dev_get_rcu(dev);
> + struct in_device *in_dev = in_dev_get(dev);
> struct nlattr *nla;
> - int i;
> + int i, ret = 0;
>
> if (!in_dev)
> return -ENODATA;
>
> nla = nla_reserve(skb, IFLA_INET_CONF, IPV4_DEVCONF_MAX * 4);
> - if (nla == NULL)
> - return -EMSGSIZE;
> + if (nla == NULL) {
> + ret = -EMSGSIZE;
> + goto out;
> + }
>
> for (i = 0; i < IPV4_DEVCONF_MAX; i++)
> ((u32 *) nla_data(nla))[i] = in_dev->cnf.data[i];
>
> - return 0;
> +out:
> + in_dev_put(in_dev);
> + return ret;
> }
In this function we hold RTNL...
Please use __in_dev_get_rtnl()
>
> static const struct nla_policy inet_af_policy[IFLA_INET_MAX+1] = {
> @@ -1293,11 +1298,14 @@ static int inet_validate_link_af(const struct net_device *dev,
> const struct nlattr *nla)
> {
> struct nlattr *a, *tb[IFLA_INET_MAX+1];
> + struct in_device *in_dev = in_dev_get(dev);
> int err, rem;
>
> - if (dev && !__in_dev_get_rcu(dev))
> + if (dev && !in_dev)
> return -EAFNOSUPPORT;
>
> + in_dev_put(in_dev);
> +
> err = nla_parse_nested(tb, IFLA_INET_MAX, nla, inet_af_policy);
> if (err < 0)
> return err;
> @@ -1319,7 +1327,7 @@ static int inet_validate_link_af(const struct net_device *dev,
>
> static int inet_set_link_af(struct net_device *dev, const struct nlattr *nla)
> {
> - struct in_device *in_dev = __in_dev_get_rcu(dev);
> + struct in_device *in_dev = in_dev_get(dev);
> struct nlattr *a, *tb[IFLA_INET_MAX+1];
> int rem;
>
> @@ -1334,6 +1342,7 @@ static int inet_set_link_af(struct net_device *dev, const struct nlattr *nla)
> ipv4_devconf_set(in_dev, nla_type(a), nla_get_u32(a));
> }
>
> + in_dev_put(in_dev);
> return 0;
> }
Same here. RTNL is held. Please use __in_dev_get_rtnl()
^ permalink raw reply
* [PATCH net-next-2.6] : __in_dev_get_rtnl() can use rtnl_dereference()
From: Eric Dumazet @ 2010-12-01 11:37 UTC (permalink / raw)
To: Amerigo Wang
Cc: linux-kernel, David S. Miller, Alexey Kuznetsov,
Pekka Savola (ipv6), James Morris, Hideaki YOSHIFUJI,
Patrick McHardy, netdev
In-Reply-To: <1291202476.2856.584.camel@edumazet-laptop>
Le mercredi 01 décembre 2010 à 12:21 +0100, Eric Dumazet a écrit :
> Same here. RTNL is held. Please use __in_dev_get_rtnl()
By the way we can use rtnl_dereference() in __in_dev_get_rtnl()
[PATCH net-next-2.6] : __in_dev_get_rtnl() can use rtnl_dereference()
If caller holds RTNL, we dont need a memory barrier
(smp_read_barrier_depends) included in rcu_dereference().
Just use rtnl_dereference() to properly document the assertions.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
include/linux/inetdevice.h | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index 2b86eaf..ae8fdc5 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -222,7 +222,7 @@ static inline struct in_device *in_dev_get(const struct net_device *dev)
static inline struct in_device *__in_dev_get_rtnl(const struct net_device *dev)
{
- return rcu_dereference_check(dev->ip_ptr, lockdep_rtnl_is_held());
+ return rtnl_dereference(dev->ip_ptr);
}
extern void in_dev_finish_destroy(struct in_device *idev);
^ permalink raw reply related
* [PATCH v2 1/2] af_packet: use vmalloc_to_page() instead for the addresss returned by vmalloc()
From: Changli Gao @ 2010-12-01 12:52 UTC (permalink / raw)
To: David S. Miller
Cc: Eric Dumazet, Jiri Pirko, Neil Horman, netdev, Changli Gao
The following commit causes the pgv->buffer may point to the memory
returned by vmalloc(). And we can't use virt_to_page() for the vmalloc
address.
This patch introduces a new inline function pgv_to_page(), which calls
vmalloc_to_page() for the vmalloc address, and virt_to_page() for the
__get_free_pages address.
We used to increase page pointer to get the next page at the next page
address, after Neil's patch, it is wrong, as the physical address may
be not continuous. This patch also fixes this issue.
commit 0e3125c755445664f00ad036e4fc2cd32fd52877
Author: Neil Horman <nhorman@tuxdriver.com>
Date: Tue Nov 16 10:26:47 2010 -0800
packet: Enhance AF_PACKET implementation to not require high order contiguous memory allocation (v4)
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
---
v2: fix the page incremental issue
net/packet/af_packet.c | 36 +++++++++++++++++++-----------------
1 file changed, 19 insertions(+), 17 deletions(-)
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 422705d..26fbeb1 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -224,6 +224,13 @@ struct packet_skb_cb {
#define PACKET_SKB_CB(__skb) ((struct packet_skb_cb *)((__skb)->cb))
+static inline struct page *pgv_to_page(void *addr)
+{
+ if (is_vmalloc_addr(addr))
+ return vmalloc_to_page(addr);
+ return virt_to_page(addr);
+}
+
static void __packet_set_status(struct packet_sock *po, void *frame, int status)
{
union {
@@ -236,11 +243,11 @@ static void __packet_set_status(struct packet_sock *po, void *frame, int status)
switch (po->tp_version) {
case TPACKET_V1:
h.h1->tp_status = status;
- flush_dcache_page(virt_to_page(&h.h1->tp_status));
+ flush_dcache_page(pgv_to_page(&h.h1->tp_status));
break;
case TPACKET_V2:
h.h2->tp_status = status;
- flush_dcache_page(virt_to_page(&h.h2->tp_status));
+ flush_dcache_page(pgv_to_page(&h.h2->tp_status));
break;
default:
pr_err("TPACKET version not supported\n");
@@ -263,10 +270,10 @@ static int __packet_get_status(struct packet_sock *po, void *frame)
h.raw = frame;
switch (po->tp_version) {
case TPACKET_V1:
- flush_dcache_page(virt_to_page(&h.h1->tp_status));
+ flush_dcache_page(pgv_to_page(&h.h1->tp_status));
return h.h1->tp_status;
case TPACKET_V2:
- flush_dcache_page(virt_to_page(&h.h2->tp_status));
+ flush_dcache_page(pgv_to_page(&h.h2->tp_status));
return h.h2->tp_status;
default:
pr_err("TPACKET version not supported\n");
@@ -800,15 +807,11 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
__packet_set_status(po, h.raw, status);
smp_mb();
{
- struct page *p_start, *p_end;
- u8 *h_end = h.raw + macoff + snaplen - 1;
-
- p_start = virt_to_page(h.raw);
- p_end = virt_to_page(h_end);
- while (p_start <= p_end) {
- flush_dcache_page(p_start);
- p_start++;
- }
+ u8 *start, *end;
+
+ end = (u8 *)PAGE_ALIGN((unsigned long)h.raw + macoff + snaplen);
+ for (start = h.raw; start < end; start += PAGE_SIZE)
+ flush_dcache_page(pgv_to_page(start));
}
sk->sk_data_ready(sk, 0);
@@ -915,7 +918,6 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,
}
err = -EFAULT;
- page = virt_to_page(data);
offset = offset_in_page(data);
len_max = PAGE_SIZE - offset;
len = ((to_write > len_max) ? len_max : to_write);
@@ -934,11 +936,11 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,
return -EFAULT;
}
+ page = pgv_to_page(data);
+ data += len;
flush_dcache_page(page);
get_page(page);
- skb_fill_page_desc(skb,
- nr_frags,
- page++, offset, len);
+ skb_fill_page_desc(skb, nr_frags, page, offset, len);
to_write -= len;
offset = 0;
len_max = PAGE_SIZE;
^ permalink raw reply related
* [PATCH v2 2/2] af_packet: remove pgv.flags
From: Changli Gao @ 2010-12-01 12:52 UTC (permalink / raw)
To: David S. Miller
Cc: Eric Dumazet, Jiri Pirko, Neil Horman, netdev, Changli Gao
As we can check if an address is vmalloc address with is_vmalloc_addr(),
we remove pgv.flags. Then we may get more pg_vecs.
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
---
v2: keep struct pgv
net/packet/af_packet.c | 20 +++++---------------
1 file changed, 5 insertions(+), 15 deletions(-)
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 26fbeb1..a11c731 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -167,7 +167,6 @@ static int packet_set_ring(struct sock *sk, struct tpacket_req *req,
#define PGV_FROM_VMALLOC 1
struct pgv {
char *buffer;
- unsigned char flags;
};
struct packet_ring_buffer {
@@ -2342,7 +2341,7 @@ static void free_pg_vec(struct pgv *pg_vec, unsigned int order,
for (i = 0; i < len; i++) {
if (likely(pg_vec[i].buffer)) {
- if (pg_vec[i].flags & PGV_FROM_VMALLOC)
+ if (is_vmalloc_addr(pg_vec[i].buffer))
vfree(pg_vec[i].buffer);
else
free_pages((unsigned long)pg_vec[i].buffer,
@@ -2353,8 +2352,7 @@ static void free_pg_vec(struct pgv *pg_vec, unsigned int order,
kfree(pg_vec);
}
-static inline char *alloc_one_pg_vec_page(unsigned long order,
- unsigned char *flags)
+static inline char *alloc_one_pg_vec_page(unsigned long order)
{
char *buffer = NULL;
gfp_t gfp_flags = GFP_KERNEL | __GFP_COMP |
@@ -2368,7 +2366,6 @@ static inline char *alloc_one_pg_vec_page(unsigned long order,
/*
* __get_free_pages failed, fall back to vmalloc
*/
- *flags |= PGV_FROM_VMALLOC;
buffer = vzalloc((1 << order) * PAGE_SIZE);
if (buffer)
@@ -2377,7 +2374,6 @@ static inline char *alloc_one_pg_vec_page(unsigned long order,
/*
* vmalloc failed, lets dig into swap here
*/
- *flags = 0;
gfp_flags &= ~__GFP_NORETRY;
buffer = (char *)__get_free_pages(gfp_flags, order);
if (buffer)
@@ -2400,8 +2396,7 @@ static struct pgv *alloc_pg_vec(struct tpacket_req *req, int order)
goto out;
for (i = 0; i < block_nr; i++) {
- pg_vec[i].buffer = alloc_one_pg_vec_page(order,
- &pg_vec[i].flags);
+ pg_vec[i].buffer = alloc_one_pg_vec_page(order);
if (unlikely(!pg_vec[i].buffer))
goto out_free_pgvec;
}
@@ -2585,13 +2580,8 @@ static int packet_mmap(struct file *file, struct socket *sock,
void *kaddr = rb->pg_vec[i].buffer;
int pg_num;
- for (pg_num = 0; pg_num < rb->pg_vec_pages;
- pg_num++) {
- if (rb->pg_vec[i].flags & PGV_FROM_VMALLOC)
- page = vmalloc_to_page(kaddr);
- else
- page = virt_to_page(kaddr);
-
+ for (pg_num = 0; pg_num < rb->pg_vec_pages; pg_num++) {
+ page = pgv_to_page(kaddr);
err = vm_insert_page(vma, start, page);
if (unlikely(err))
goto out;
^ permalink raw reply related
* Re: [PATCH 1/2] af_packet: use vmalloc_to_page() instead for the addresss returned by vmalloc()
From: Changli Gao @ 2010-12-01 13:05 UTC (permalink / raw)
To: Neil Horman; +Cc: Eric Dumazet, David S. Miller, Jiri Pirko, netdev
In-Reply-To: <20101130143720.GA6017@hmsreliant.think-freely.org>
On Tue, Nov 30, 2010 at 10:37 PM, Neil Horman <nhorman@tuxdriver.com> wrote:
> Off the top of my head, I would think that pgv_to_page could be prototyped such
> that it could accept addr, offset and struct page ** arguments. That way we can
> track the current page that we're mapped to, lowering the number of calls to
> vmalloc_to_page, and we can still use an increment like we do above (as long as
> its wrapped in a subsequent call to pgv_to_page)
I'll try to optimize pgv_to_page() after this patch series merged. I
am planning to call vmalloc_to_page() previously, and cache its result
in a per pgv array for future use. Thanks.
--
Regards,
Changli Gao(xiaosuo@gmail.com)
^ permalink raw reply
* Re: [PATCH 1/2] af_packet: use vmalloc_to_page() instead for the addresss returned by vmalloc()
From: Eric Dumazet @ 2010-12-01 13:38 UTC (permalink / raw)
To: Changli Gao; +Cc: Neil Horman, David S. Miller, Jiri Pirko, netdev
In-Reply-To: <AANLkTim7SSRMkhc_eMz+Bk12kAwfG==j-dH4NOPu-uS2@mail.gmail.com>
Le mercredi 01 décembre 2010 à 21:05 +0800, Changli Gao a écrit :
> On Tue, Nov 30, 2010 at 10:37 PM, Neil Horman <nhorman@tuxdriver.com> wrote:
> > Off the top of my head, I would think that pgv_to_page could be prototyped such
> > that it could accept addr, offset and struct page ** arguments. That way we can
> > track the current page that we're mapped to, lowering the number of calls to
> > vmalloc_to_page, and we can still use an increment like we do above (as long as
> > its wrapped in a subsequent call to pgv_to_page)
>
> I'll try to optimize pgv_to_page() after this patch series merged. I
> am planning to call vmalloc_to_page() previously, and cache its result
> in a per pgv array for future use. Thanks.
>
>
Hmm... fact is flush_dcache_page() is void on some arches.
Maybe the only thing to do is avoid pgv_to_page() calls if
ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE is 0
The ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE symbol was introduced to avoid
pointless empty cache-thrashing loops on architectures for which
flush_dcache_page() is a no-op. Every architecture was provided with this
flush pages on architectires where ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE is
equal 1 or do nothing otherwise.
^ permalink raw reply
* Re: [PATCH 1/2] af_packet: use vmalloc_to_page() instead for the addresss returned by vmalloc()
From: Eric Dumazet @ 2010-12-01 13:43 UTC (permalink / raw)
To: Changli Gao; +Cc: Neil Horman, David S. Miller, Jiri Pirko, netdev
In-Reply-To: <1291210691.2856.740.camel@edumazet-laptop>
Le mercredi 01 décembre 2010 à 14:38 +0100, Eric Dumazet a écrit :
> Le mercredi 01 décembre 2010 à 21:05 +0800, Changli Gao a écrit :
> > On Tue, Nov 30, 2010 at 10:37 PM, Neil Horman <nhorman@tuxdriver.com> wrote:
> > > Off the top of my head, I would think that pgv_to_page could be prototyped such
> > > that it could accept addr, offset and struct page ** arguments. That way we can
> > > track the current page that we're mapped to, lowering the number of calls to
> > > vmalloc_to_page, and we can still use an increment like we do above (as long as
> > > its wrapped in a subsequent call to pgv_to_page)
> >
> > I'll try to optimize pgv_to_page() after this patch series merged. I
> > am planning to call vmalloc_to_page() previously, and cache its result
> > in a per pgv array for future use. Thanks.
> >
> >
>
> Hmm... fact is flush_dcache_page() is void on some arches.
>
> Maybe the only thing to do is avoid pgv_to_page() calls if
> ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE is 0
>
> The ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE symbol was introduced to avoid
> pointless empty cache-thrashing loops on architectures for which
> flush_dcache_page() is a no-op. Every architecture was provided with this
> flush pages on architectires where ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE is
> equal 1 or do nothing otherwise.
>
>
I guess using __pure attribute on pgv_to_page() should be enough ;)
static inline __pure struct page *pgv_to_page(void *addr)
{
if (is_vmalloc_addr(addr))
return vmalloc_to_page(addr);
return virt_to_page(addr);
}
Compiler then should optimize away
flush_dcache_page(pgv_to_page(addr));
But the pgv_to_page() done in packet_sendmsg() will stay, of course.
^ permalink raw reply
* Re: [PATCH v2] add netdev led trigger
From: Andi Kleen @ 2010-12-01 14:03 UTC (permalink / raw)
To: Andi Kleen, linux-kernel, linux-doc, Richard Purdie, Randy Dunlap,
netdev
In-Reply-To: <20101201000300.GJ21496@localhost>
On Tue, Nov 30, 2010 at 07:03:00PM -0500, Eric Cooper wrote:
> On Mon, Nov 29, 2010 at 11:15:51AM +0100, Andi Kleen wrote:
> > Using the device name as an identifier is not reliable, they may not
> > be unique.
>
> I'm confused about this -- how else can the user specify the desired network
> interface?
For presenting the user the name is probably still the best, but internally
better use the interface index.
>
> > rwlocks are deprecated.
>
> In favor of what? Should I use a spinlock?
spinlocks or mutexes.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
^ permalink raw reply
* Re: [PATCH 1/2] af_packet: use vmalloc_to_page() instead for the addresss returned by vmalloc()
From: Changli Gao @ 2010-12-01 14:16 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Neil Horman, David S. Miller, Jiri Pirko, netdev
In-Reply-To: <1291210691.2856.740.camel@edumazet-laptop>
On Wed, Dec 1, 2010 at 9:38 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Le mercredi 01 décembre 2010 à 21:05 +0800, Changli Gao a écrit :
>> On Tue, Nov 30, 2010 at 10:37 PM, Neil Horman <nhorman@tuxdriver.com> wrote:
>> > Off the top of my head, I would think that pgv_to_page could be prototyped such
>> > that it could accept addr, offset and struct page ** arguments. That way we can
>> > track the current page that we're mapped to, lowering the number of calls to
>> > vmalloc_to_page, and we can still use an increment like we do above (as long as
>> > its wrapped in a subsequent call to pgv_to_page)
>>
>> I'll try to optimize pgv_to_page() after this patch series merged. I
>> am planning to call vmalloc_to_page() previously, and cache its result
>> in a per pgv array for future use. Thanks.
>>
>>
>
> Hmm... fact is flush_dcache_page() is void on some arches.
>
> Maybe the only thing to do is avoid pgv_to_page() calls if
> ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE is 0
>
Even then, tpacket_fill_skb() is called for every skb, and
pgv_to_page() is used in it. We have to optimize pgv_to_page().
Thanks.
--
Regards,
Changli Gao(xiaosuo@gmail.com)
^ permalink raw reply
* Re: [PATCH v2] Net-ethtool : Allow ethtool to set interface in loopback mode.
From: Ben Hutchings @ 2010-12-01 14:54 UTC (permalink / raw)
To: Mahesh Bandewar; +Cc: David Miller, linux-netdev, laurent chavey
In-Reply-To: <AANLkTimJJzQ6f06CoWJuofwS0m2Bn3gAcfWTOEiYyjEZ@mail.gmail.com>
On Tue, 2010-11-30 at 15:57 -0800, Mahesh Bandewar wrote:
> This patch enables ethtool to set the loopback mode on a given
> interface. By configuring the interface in loopback mode in conjunction
> with a policy route / rule, a userland application can stress the egress /
> ingress path exposing the flows of the change in progress and potentially
> help developer(s) understand the impact of those changes without even
> sending a packet out on the network.
[...]
> --- a/include/linux/ethtool.h
> +++ b/include/linux/ethtool.h
> @@ -616,6 +616,17 @@ void ethtool_ntuple_flush(struct net_device *dev);
> * Should validate the magic field. Don't need to check len for zero
> * or wraparound. Update len to the amount written. Returns an error
> * or zero.
> + *
> + * get_loopback:
> + * set_loopback:
> + These are the driver specific get / set methods to report / enable-
> + disable loopback mode. The idea is to stress test the ingress / egress
> + paths by enabling this mode. There are multiple places this could be
> + done and choice of place will most likely be affected by the device
> + capabilities. So as a guiding principle; select a place to implement
> + loopback mode as close to the host as possible. This would maximize the
> + soft-path length and maintain parity in terms of comparison with differe
> + set of drivers.
[...]
I know this is nitpicking, but the comment should have asterisks (*)
repeated down the left edge. Also, a typo: "differe" should be
"different".
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
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 1/2] af_packet: use vmalloc_to_page() instead for the addresss returned by vmalloc()
From: Eric Dumazet @ 2010-12-01 15:13 UTC (permalink / raw)
To: Changli Gao; +Cc: Neil Horman, David S. Miller, Jiri Pirko, netdev
In-Reply-To: <AANLkTinViD=WpwUFUDF6mKbc-Cap_Tg=SXwOjVQ=5u4B@mail.gmail.com>
Le mercredi 01 décembre 2010 à 22:16 +0800, Changli Gao a écrit :
> Even then, tpacket_fill_skb() is called for every skb, and
> pgv_to_page() is used in it. We have to optimize pgv_to_page().
With the __pure trick I gave, pgv_to_page() is _not_ called for the
typical use case of af_packet : packet sniffing.
Compiler is able to remove the call completely, since
static inline void flush_dcache_page(struct page *page) { }
The only remaining pgv_to_page() call is the one done in mmap packet
send, since we have to do :
page = pgv_to_page(data);
get_page(page);
I personally dont use this path, its known to be buggy...
Optimize if you want, but make all this
ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE conditional.
Its not needed to maintain an array of 'struct page *' if its not needed
at all.
# vi +2448 block/blk-core.c
#if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
/**
* rq_flush_dcache_pages - Helper function to flush all pages in a request
* @rq: the request to be flushed
*
* Description:
* Flush all pages in @rq.
*/
void rq_flush_dcache_pages(struct request *rq)
{
struct req_iterator iter;
struct bio_vec *bvec;
rq_for_each_segment(bvec, rq, iter)
flush_dcache_page(bvec->bv_page);
}
EXPORT_SYMBOL_GPL(rq_flush_dcache_pages);
#endif
^ permalink raw reply
* Re: [Patch] net: kill an RCU warning in inet_fill_link_af()
From: Eric Dumazet @ 2010-12-01 16:03 UTC (permalink / raw)
To: Amerigo Wang
Cc: linux-kernel, David S. Miller, Alexey Kuznetsov,
Pekka Savola (ipv6), James Morris, Hideaki YOSHIFUJI,
Patrick McHardy, netdev, Thomas Graf
In-Reply-To: <1291202063-6239-1-git-send-email-amwang@redhat.com>
Le mercredi 01 décembre 2010 à 19:14 +0800, Amerigo Wang a écrit :
> From: WANG Cong <amwang@redhat.com>
>
> The latest net-next-2.6 triggers an RCU warning during boot,
> lockdep complains that in inet_fill_link_af() we call rcu_dereference_check()
> without rcu_read_lock() protection.
>
> This patch fixes it by replacing __in_dev_get_rcu() with in_dev_get().
Here is a better version, thanks a lot for your report and initial
patch.
[PATCH net-next-2.6] net: kill an RCU warning in inet_fill_link_af()
commits 9f0f7272 (ipv4: AF_INET link address family) and cf7afbfeb8c
(rtnl: make link af-specific updates atomic) used incorrect
__in_dev_get_rcu() in RTNL protected contexts, triggering PROVE_RCU
warnings.
Switch to __in_dev_get_rtnl(), wich is more appropriate, since we hold
RTNL.
Based on a report and initial patch from Amerigo Wang.
Reported-by: Amerigo Wang <amwang@redhat.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Thomas Graf <tgraf@infradead.org>
---
net/ipv4/devinet.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index d9f71ba..3b06770 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1258,7 +1258,7 @@ errout:
static size_t inet_get_link_af_size(const struct net_device *dev)
{
- struct in_device *in_dev = __in_dev_get_rcu(dev);
+ struct in_device *in_dev = __in_dev_get_rtnl(dev);
if (!in_dev)
return 0;
@@ -1268,7 +1268,7 @@ static size_t inet_get_link_af_size(const struct net_device *dev)
static int inet_fill_link_af(struct sk_buff *skb, const struct net_device *dev)
{
- struct in_device *in_dev = __in_dev_get_rcu(dev);
+ struct in_device *in_dev = __in_dev_get_rtnl(dev);
struct nlattr *nla;
int i;
@@ -1295,7 +1295,7 @@ static int inet_validate_link_af(const struct net_device *dev,
struct nlattr *a, *tb[IFLA_INET_MAX+1];
int err, rem;
- if (dev && !__in_dev_get_rcu(dev))
+ if (dev && !__in_dev_get_rtnl(dev))
return -EAFNOSUPPORT;
err = nla_parse_nested(tb, IFLA_INET_MAX, nla, inet_af_policy);
@@ -1319,7 +1319,7 @@ static int inet_validate_link_af(const struct net_device *dev,
static int inet_set_link_af(struct net_device *dev, const struct nlattr *nla)
{
- struct in_device *in_dev = __in_dev_get_rcu(dev);
+ struct in_device *in_dev = __in_dev_get_rtnl(dev);
struct nlattr *a, *tb[IFLA_INET_MAX+1];
int rem;
^ permalink raw reply related
* Re: [Patch] bonding: clean up netpoll code
From: Stephen Hemminger @ 2010-12-01 16:14 UTC (permalink / raw)
To: Amerigo Wang
Cc: linux-kernel, Jiri Pirko, Neil Horman, netdev, David S. Miller,
Eric W. Biederman, Herbert Xu, bonding-devel, Jay Vosburgh
In-Reply-To: <20101201075043.5741.29172.sendpatchset@localhost.localdomain>
On Wed, 1 Dec 2010 02:45:45 -0500
Amerigo Wang <amwang@redhat.com> wrote:
> + if ((slave_dev->npinfo = bond_netpoll_info(bond))) {
Split assignment and conditional into two lines
--
^ permalink raw reply
* Re: [PATCH] net/r8169: Remove the firmware of RTL8111D
From: Stefan Lippers-Hollmann @ 2010-12-01 16:36 UTC (permalink / raw)
To: Francois Romieu; +Cc: Hayes Wang, netdev, linux-kernel, Ben Hutchings
In-Reply-To: <20101201080732.GA3234@electric-eye.fr.zoreil.com>
Hi
On Wednesday 01 December 2010, Francois Romieu wrote:
> Hayes Wang <hayeswang@realtek.com> :
> > Remove the firmware of RTL8111D from the kernel.
> > The binary file of firmware would be moved to linux-firmware repository.
>
> The driver can not simply go along when request_firmware fails. Though Ben's
> code did not take care of it, the driver should imho propagate some return
> code. Ben ?
[...]
At least for RTL8111D-1 (rtl8168d_1_hw_phy_config(), phy_reg_init_2[])
a missing firmware update doesn't seem to be fatal
http://bugs.debian.org/561309#45
I'm running that card (onboard of the Intel D945GSEJT mainboard), with
rtl8168d_1_hw_phy_config()/ phy_reg_init_2[] stripped out, without any
noticable issues for about a year as always-on home server and good
GBit/s performance.
[ 3.861378] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
[ 3.861462] r8169 0000:01:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[ 3.861575] r8169 0000:01:00.0: setting latency timer to 64
[ 3.861703] r8169 0000:01:00.0: irq 45 for MSI/MSI-X
[ 3.865188] r8169 0000:01:00.0: eth0: RTL8168d/8111d at 0xf8406000, 00:1c:c0:ee:22:88, XID 081000c0 IRQ 45
using Debian's firmware removal patch and without the required firmware
image being present
[ 3.870663] eth0: unable to apply firmware patch
[ 16.364231] r8169 0000:01:00.0: eth0: link up
[ 26.562069] eth0: no IPv6 routers present
Debian has been shipping (unstable and a little later squeeze, the
upcoming stable) kernels with this firmware stripped out since late
december 2009.
Therefore I'd think it's safe to just make some noise about missing
firmware images and not cease operations completely for this chipset.
Regards
Stefan Lippers-Hollmann
^ permalink raw reply
* Re: [PATCH] net/r8169: Remove the firmware of RTL8111D
From: Ben Hutchings @ 2010-12-01 17:05 UTC (permalink / raw)
To: Stefan Lippers-Hollmann; +Cc: Francois Romieu, Hayes Wang, netdev, linux-kernel
In-Reply-To: <201012011736.59625.s.L-H@gmx.de>
On Wed, Dec 01, 2010 at 05:36:55PM +0100, Stefan Lippers-Hollmann wrote:
> Hi
>
> On Wednesday 01 December 2010, Francois Romieu wrote:
> > Hayes Wang <hayeswang@realtek.com> :
> > > Remove the firmware of RTL8111D from the kernel.
> > > The binary file of firmware would be moved to linux-firmware repository.
> >
> > The driver can not simply go along when request_firmware fails. Though Ben's
> > code did not take care of it, the driver should imho propagate some return
> > code. Ben ?
> [...]
>
> At least for RTL8111D-1 (rtl8168d_1_hw_phy_config(), phy_reg_init_2[])
> a missing firmware update doesn't seem to be fatal
> http://bugs.debian.org/561309#45
[...]
Yes. Though it does clearly affect operation with some combinations of
cable and link partner. There was a recent bug report on this, though
I can't find it now.
Ben.
--
Ben Hutchings
We get into the habit of living before acquiring the habit of thinking.
- Albert Camus
^ permalink raw reply
* Re: [Patch] net: kill an RCU warning in inet_fill_link_af()
From: Thomas Graf @ 2010-12-01 17:18 UTC (permalink / raw)
To: Eric Dumazet
Cc: Amerigo Wang, linux-kernel, David S. Miller, Alexey Kuznetsov,
Pekka Savola (ipv6), James Morris, Hideaki YOSHIFUJI,
Patrick McHardy, netdev
In-Reply-To: <1291219386.2856.924.camel@edumazet-laptop>
On Wed, Dec 01, 2010 at 05:03:06PM +0100, Eric Dumazet wrote:
> [PATCH net-next-2.6] net: kill an RCU warning in inet_fill_link_af()
>
> commits 9f0f7272 (ipv4: AF_INET link address family) and cf7afbfeb8c
> (rtnl: make link af-specific updates atomic) used incorrect
> __in_dev_get_rcu() in RTNL protected contexts, triggering PROVE_RCU
> warnings.
>
> Switch to __in_dev_get_rtnl(), wich is more appropriate, since we hold
> RTNL.
>
> Based on a report and initial patch from Amerigo Wang.
RTNL is not held while dumping, it is only held for get and set, but we
still hold rcu readlocks while dumping so there should be no asserts
triggered. Thanks for fixing this.
^ permalink raw reply
* Re: multi bpf filter will impact performance?
From: Hagen Paul Pfeifer @ 2010-12-01 17:22 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Changli Gao, Rui, netdev
In-Reply-To: <1291192967.2856.492.camel@edumazet-laptop>
On Wed, 01 Dec 2010 09:42:47 +0100, Eric Dumazet wrote:
> IMHO, a better pcap optimizer would be the first step.
+1
Optimizing complex filter rules is step one in the process of optimizing
the packet processing. A JIT compiler like FreeBSD provides cannot polish a
(pcap)turd. I thought Patrick was working on a generic filter mechanism for
netfilter!? ... ;)
Hagen
^ permalink raw reply
* Re: [Patch] net: kill an RCU warning in inet_fill_link_af()
From: Eric Dumazet @ 2010-12-01 17:31 UTC (permalink / raw)
To: Thomas Graf
Cc: Amerigo Wang, linux-kernel, David S. Miller, Alexey Kuznetsov,
Pekka Savola (ipv6), James Morris, Hideaki YOSHIFUJI,
Patrick McHardy, netdev
In-Reply-To: <20101201171801.GA22009@canuck.infradead.org>
Le mercredi 01 décembre 2010 à 12:18 -0500, Thomas Graf a écrit :
> On Wed, Dec 01, 2010 at 05:03:06PM +0100, Eric Dumazet wrote:
> > [PATCH net-next-2.6] net: kill an RCU warning in inet_fill_link_af()
> >
> > commits 9f0f7272 (ipv4: AF_INET link address family) and cf7afbfeb8c
> > (rtnl: make link af-specific updates atomic) used incorrect
> > __in_dev_get_rcu() in RTNL protected contexts, triggering PROVE_RCU
> > warnings.
> >
> > Switch to __in_dev_get_rtnl(), wich is more appropriate, since we hold
> > RTNL.
> >
> > Based on a report and initial patch from Amerigo Wang.
>
> RTNL is not held while dumping, it is only held for get and set, but we
> still hold rcu readlocks while dumping so there should be no asserts
> triggered. Thanks for fixing this.
Are you sure RTNL is not held while dumping ?
Patrick did the change to hold RTNL while dumping too, 3.5 years ago.
Check commits 6313c1e0992fea, 1c2d670f3660e9103 ([RTNETLINK]: Hold
rtnl_mutex during netlink dump callbacks)
If this was the case (not holding RTNL), we should use
rcu_dereference(), not rtnl_dereference()
^ permalink raw reply
* RE: [PATCH 1/2] ixgb: Don't check for vlan group on transmit.
From: Duyck, Alexander H @ 2010-12-01 17:40 UTC (permalink / raw)
To: Jesse Gross
Cc: Kirsher, Jeffrey T, David Miller, netdev@vger.kernel.org,
Brandeburg, Jesse
In-Reply-To: <AANLkTik43SPbQiTxOQPTsUq9hu7h3EgbZ1cvxh=nsFPM@mail.gmail.com>
>-----Original Message-----
>From: Jesse Gross [mailto:jesse@nicira.com]
>Sent: Tuesday, November 30, 2010 2:34 PM
>To: Duyck, Alexander H
>Cc: Kirsher, Jeffrey T; David Miller; netdev@vger.kernel.org;
>Brandeburg, Jesse
>Subject: Re: [PATCH 1/2] ixgb: Don't check for vlan group on transmit.
>
>On Mon, Nov 8, 2010 at 11:59 AM, Jesse Gross <jesse@nicira.com> wrote:
>> On Fri, Nov 5, 2010 at 3:30 PM, Duyck, Alexander H
>>> The quick fix for your patch is to move the addition of
>VLAN_TAG_SIZE to the max_frame in igb_change_mtu instead of in the
>set_rlpml call. Otherwise I will see about submitting an updated
>patch in the next few days.
>>
>> I happy to let you take care of it - obviously you know the
>> driver/hardware much better than I.
>
>Alex, did you get a chance to take a look at this? I was hoping to
>get the fix for this (and also the patch mentioned originally in this
>message for ixgb) into 2.6.37. I can also respin it along the lines
>that you suggested if that would help.
I did, and we are currently testing the patch I have generated. Once it passes testing Jeff will submit it to netdev.
Thanks,
Alex
^ 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