* [patch 3/3] qeth: Fix scatter-gather regression
From: frank.blaschka @ 2013-03-19 6:04 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390
In-Reply-To: <20130319060441.956271217@de.ibm.com>
[-- Attachment #1: 603-qeth-scatter-gather.diff --]
[-- Type: text/plain, Size: 3723 bytes --]
From: Frank Blaschka <blaschka@linux.vnet.ibm.com>
This patch fixes a scatter-gather regression introduced with
commit 5640f768 net: use a per task frag allocator
Now the qeth driver can cope with bigger framents and split a fragment in
sub framents if required.
Signed-off-by: Frank Blaschka <blaschka@linux.vnet.ibm.com>
---
drivers/s390/net/qeth_core.h | 1
drivers/s390/net/qeth_core_main.c | 45 ++++++++++++++++++++++++++++++++------
drivers/s390/net/qeth_l3_main.c | 4 ++-
3 files changed, 42 insertions(+), 8 deletions(-)
--- a/drivers/s390/net/qeth_core.h
+++ b/drivers/s390/net/qeth_core.h
@@ -916,6 +916,7 @@ int qeth_send_control_data(struct qeth_c
void *reply_param);
int qeth_get_priority_queue(struct qeth_card *, struct sk_buff *, int, int);
int qeth_get_elements_no(struct qeth_card *, void *, struct sk_buff *, int);
+int qeth_get_elements_for_frags(struct sk_buff *);
int qeth_do_send_packet_fast(struct qeth_card *, struct qeth_qdio_out_q *,
struct sk_buff *, struct qeth_hdr *, int, int, int);
int qeth_do_send_packet(struct qeth_card *, struct qeth_qdio_out_q *,
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -3679,6 +3679,25 @@ int qeth_get_priority_queue(struct qeth_
}
EXPORT_SYMBOL_GPL(qeth_get_priority_queue);
+int qeth_get_elements_for_frags(struct sk_buff *skb)
+{
+ int cnt, length, e, elements = 0;
+ struct skb_frag_struct *frag;
+ char *data;
+
+ for (cnt = 0; cnt < skb_shinfo(skb)->nr_frags; cnt++) {
+ frag = &skb_shinfo(skb)->frags[cnt];
+ data = (char *)page_to_phys(skb_frag_page(frag)) +
+ frag->page_offset;
+ length = frag->size;
+ e = PFN_UP((unsigned long)data + length - 1) -
+ PFN_DOWN((unsigned long)data);
+ elements += e;
+ }
+ return elements;
+}
+EXPORT_SYMBOL_GPL(qeth_get_elements_for_frags);
+
int qeth_get_elements_no(struct qeth_card *card, void *hdr,
struct sk_buff *skb, int elems)
{
@@ -3686,7 +3705,8 @@ int qeth_get_elements_no(struct qeth_car
int elements_needed = PFN_UP((unsigned long)skb->data + dlen - 1) -
PFN_DOWN((unsigned long)skb->data);
- elements_needed += skb_shinfo(skb)->nr_frags;
+ elements_needed += qeth_get_elements_for_frags(skb);
+
if ((elements_needed + elems) > QETH_MAX_BUFFER_ELEMENTS(card)) {
QETH_DBF_MESSAGE(2, "Invalid size of IP packet "
"(Number=%d / Length=%d). Discarded.\n",
@@ -3771,12 +3791,23 @@ static inline void __qeth_fill_buffer(st
for (cnt = 0; cnt < skb_shinfo(skb)->nr_frags; cnt++) {
frag = &skb_shinfo(skb)->frags[cnt];
- buffer->element[element].addr = (char *)
- page_to_phys(skb_frag_page(frag))
- + frag->page_offset;
- buffer->element[element].length = frag->size;
- buffer->element[element].eflags = SBAL_EFLAGS_MIDDLE_FRAG;
- element++;
+ data = (char *)page_to_phys(skb_frag_page(frag)) +
+ frag->page_offset;
+ length = frag->size;
+ while (length > 0) {
+ length_here = PAGE_SIZE -
+ ((unsigned long) data % PAGE_SIZE);
+ if (length < length_here)
+ length_here = length;
+
+ buffer->element[element].addr = data;
+ buffer->element[element].length = length_here;
+ buffer->element[element].eflags =
+ SBAL_EFLAGS_MIDDLE_FRAG;
+ length -= length_here;
+ data += length_here;
+ element++;
+ }
}
if (buffer->element[element - 1].eflags)
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -2903,7 +2903,9 @@ static inline int qeth_l3_tso_elements(s
tcp_hdr(skb)->doff * 4;
int tcpd_len = skb->len - (tcpd - (unsigned long)skb->data);
int elements = PFN_UP(tcpd + tcpd_len - 1) - PFN_DOWN(tcpd);
- elements += skb_shinfo(skb)->nr_frags;
+
+ elements += qeth_get_elements_for_frags(skb);
+
return elements;
}
^ permalink raw reply
* [patch 0/3] s390: network bug fixes for net
From: frank.blaschka @ 2013-03-19 6:04 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390
Hi Dave,
here are 3 bug fixes for net.
shortlog:
Stefan Raspl (2)
qeth: delay feature trace
qeth: Fix invalid router settings handling
Frank Blaschka (1)
qeth: Fix scatter-gather regression
Thanks,
Frank
^ permalink raw reply
* Re: [PATCH v5] net: sh_eth: Add support of device tree probe
From: Simon Horman @ 2013-03-19 4:22 UTC (permalink / raw)
To: Nobuhiro Iwamatsu
Cc: netdev, grant.likely, kuninori.morimoto.gx, devicetree-discuss,
magnus.damm, kda, Mark Rutland
In-Reply-To: <20130305004338.GA10651@verge.net.au>
On Tue, Mar 05, 2013 at 09:43:39AM +0900, Simon Horman wrote:
> [ Cc: Mark Rutland ]
>
> On Tue, Mar 05, 2013 at 06:52:20AM +0900, Nobuhiro Iwamatsu wrote:
> > This adds support of device tree probe for Renesas sh-ether driver.
> >
> > Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
>
> Hi Iwamatsu-san,
>
> could you please address the review by
> Mark Rutland of the bindings in this patch.
> The review was made for v2 but I believe it
> is still applicable to v5.
>
> http://www.spinics.net/lists/netdev/msg226454.html
Ping.
>
> > V5: - Rewrite sh_eth_parse_dt().
> > Remove of_device_is_available() and CONFIG_OF from support OF
> > checking function and re-add empty sh_eth_parse_dt().
> > - Add CONFIG_PM to definition of dev_pm_ops.
> > - Add CONFIG_OF to definition of of_device_id.
> > V4: - Remove empty sh_eth_parse_dt().
> > V3: - Remove empty sh_eth_parse_dt().
> > V3: - Removed sentnece of "needs-init" from document.
> > V2: - Removed ether_setup().
> > - Fixed typo from "sh-etn" to "sh-eth".
> > - Removed "needs-init" and sh-eth,endian from definition of DT.
> > - Changed "sh-eth,edmac-endian" instead of "sh-eth,edmac-big-endain"
> > in definition of DT.
> > ---
> > Documentation/devicetree/bindings/net/sh_ether.txt | 39 +++++
> > drivers/net/ethernet/renesas/sh_eth.c | 164 +++++++++++++++++---
> > 2 files changed, 178 insertions(+), 25 deletions(-)
> > create mode 100644 Documentation/devicetree/bindings/net/sh_ether.txt
> >
> > diff --git a/Documentation/devicetree/bindings/net/sh_ether.txt b/Documentation/devicetree/bindings/net/sh_ether.txt
> > new file mode 100644
> > index 0000000..2deb841
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/net/sh_ether.txt
> > @@ -0,0 +1,39 @@
> > +* Renesas Electronics SuperH EMAC
> > +
> > +This file provides information, what the device node
> > +for the sh_eth interface contains.
> > +
> > +Required properties:
> > +- compatible: "renesas,sh-eth";
> > +- interrupt-parent: The phandle for the interrupt controller that
> > + services interrupts for this device.
> > +- reg: Offset and length of the register set for the
> > + device.
> > +- interrupts: Interrupt mapping for the sh_eth interrupt
> > + sources (vector id).
> > +- phy-mode: String, operation mode of the PHY interface.
> > +- sh-eth,register-type: String, register type of sh_eth.
> > + Please select "gigabit", "fast-sh4" or
> > + "fast-sh3-sh2".
> > +- sh-eth,phy-id: PHY id.
> > +
> > +Optional properties:
> > +- local-mac-address: 6 bytes, mac address
> > +- sh-eth,no-ether-link: Set link control by software. When device does
> > + not support ether-link, set.
> > +- sh-eth,ether-link-active-low: Set link check method.
> > + When detection of link is treated as active-low,
> > + set.
> > +- sh-eth,edmac-big-endian: Set big endian for sh_eth dmac.
> > + It work as little endian when this is not set.
> > +
> > +Example (armadillo800eva):
> > + sh-eth@e9a00000 {
> > + compatible = "renesas,sh-eth";
> > + interrupt-parent = <&intca>;
> > + reg = <0xe9a00000 0x800>, <0xe9a01800 0x800>;
> > + interrupts = <0x500>;
> > + phy-mode = "mii";
> > + sh-eth,register-type = "gigabit";
> > + sh-eth,phy-id = <0>;
> > + };
> > diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
> > index 3d70586..a97d208 100644
> > --- a/drivers/net/ethernet/renesas/sh_eth.c
> > +++ b/drivers/net/ethernet/renesas/sh_eth.c
> > @@ -1,7 +1,7 @@
> > /*
> > * SuperH Ethernet device driver
> > *
> > - * Copyright (C) 2006-2012 Nobuhiro Iwamatsu
> > + * Copyright (C) 2006-2013 Nobuhiro Iwamatsu
> > * Copyright (C) 2008-2012 Renesas Solutions Corp.
> > *
> > * This program is free software; you can redistribute it and/or modify it
> > @@ -31,6 +31,12 @@
> > #include <linux/platform_device.h>
> > #include <linux/mdio-bitbang.h>
> > #include <linux/netdevice.h>
> > +#include <linux/of.h>
> > +#include <linux/of_device.h>
> > +#include <linux/of_platform.h>
> > +#include <linux/of_address.h>
> > +#include <linux/of_irq.h>
> > +#include <linux/of_net.h>
> > #include <linux/phy.h>
> > #include <linux/cache.h>
> > #include <linux/io.h>
> > @@ -2347,26 +2353,109 @@ static const struct net_device_ops sh_eth_netdev_ops = {
> > .ndo_change_mtu = eth_change_mtu,
> > };
> >
> > +#ifdef CONFIG_OF
> > +static int
> > +sh_eth_of_get_register_type(struct device_node *np)
> > +{
> > + const char *of_str;
> > + int ret = of_property_read_string(np, "sh-eth,register-type", &of_str);
> > + if (ret)
> > + return ret;
> > +
> > + if (of_str && !strcmp(of_str, "gigabit"))
> > + return SH_ETH_REG_GIGABIT;
> > +
> > + else if (of_str && !strcmp(of_str, "fast-sh4"))
> > + return SH_ETH_REG_FAST_SH4;
> > + else if (of_str && !strcmp(of_str, "fast-sh3-sh2"))
> > + return SH_ETH_REG_FAST_SH3_SH2;
> > + else
> > + return -EINVAL;
> > +}
> > +
> > +static struct sh_eth_plat_data *
> > +sh_eth_parse_dt(struct device *dev, struct net_device *ndev,
> > + struct device_node *np)
> > +{
> > + int ret;
> > + struct sh_eth_plat_data *pdata;
> > +
> > + pdata = devm_kzalloc(dev, sizeof(struct sh_eth_plat_data),
> > + GFP_KERNEL);
> > + if (!pdata) {
> > + dev_err(dev, "%s: failed to allocate config data\n", __func__);
> > + return NULL;
> > + }
> > +
> > + pdata->phy_interface = of_get_phy_mode(np);
> > +
> > + of_property_read_u32(np, "sh-eth,phy-id", &pdata->phy);
> > +
> > + if (of_find_property(np, "sh-eth,edmac-big-endian", NULL))
> > + pdata->edmac_endian = EDMAC_BIG_ENDIAN;
> > + else
> > + pdata->edmac_endian = EDMAC_LITTLE_ENDIAN;
> > +
> > + if (of_find_property(np, "sh-eth,no-ether-link", NULL))
> > + pdata->no_ether_link = 1;
> > + else
> > + pdata->no_ether_link = 0;
> > +
> > + if (of_find_property(np, "sh-eth,ether-link-active-low", NULL))
> > + pdata->ether_link_active_low = 1;
> > + else
> > + pdata->ether_link_active_low = 0;
> > +
> > + ret = sh_eth_of_get_register_type(np);
> > + if (ret < 0)
> > + goto error;
> > + pdata->register_type = ret;
> > +
> > +#ifdef CONFIG_OF_NET
> > + if (!is_valid_ether_addr(ndev->dev_addr)) {
> > + const char *macaddr = of_get_mac_address(np);
> > + if (macaddr)
> > + memcpy(pdata->mac_addr, macaddr, ETH_ALEN);
> > + }
> > +#endif
> > +
> > + return pdata;
> > +
> > +error:
> > + devm_kfree(dev, pdata);
> > + return NULL;
> > +}
> > +#else
> > +static inline struct sh_eth_plat_data *
> > +sh_eth_parse_dt(struct device *dev, struct net_device *ndev,
> > + struct device_node *np)
> > +{
> > + return NULL;
> > +}
> > +#endif
> > +
> > static int sh_eth_drv_probe(struct platform_device *pdev)
> > {
> > - int ret, devno = 0;
> > + int ret = 0, devno = 0;
> > struct resource *res;
> > struct net_device *ndev = NULL;
> > struct sh_eth_private *mdp = NULL;
> > struct sh_eth_plat_data *pd;
> > + struct device_node *np = pdev->dev.of_node;
> >
> > + ndev = alloc_etherdev(sizeof(struct sh_eth_private));
> > + if (!ndev) {
> > + ret = -ENOMEM;
> > + goto out;
> > + }
> > +
> > + mdp = netdev_priv(ndev);
> > /* get base addr */
> > res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > if (unlikely(res == NULL)) {
> > dev_err(&pdev->dev, "invalid resource\n");
> > ret = -EINVAL;
> > - goto out;
> > - }
> > -
> > - ndev = alloc_etherdev(sizeof(struct sh_eth_private));
> > - if (!ndev) {
> > - ret = -ENOMEM;
> > - goto out;
> > + goto out_release;
> > }
> >
> > /* The sh Ether-specific entries in the device structure. */
> > @@ -2383,14 +2472,6 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
> > }
> > ndev->irq = ret;
> >
> > - SET_NETDEV_DEV(ndev, &pdev->dev);
> > -
> > - /* Fill in the fields of the device structure with ethernet values. */
> > - ether_setup(ndev);
> > -
> > - mdp = netdev_priv(ndev);
> > - mdp->num_tx_ring = TX_RING_SIZE;
> > - mdp->num_rx_ring = RX_RING_SIZE;
> > mdp->addr = ioremap(res->start, resource_size(res));
> > if (mdp->addr == NULL) {
> > ret = -ENOMEM;
> > @@ -2398,12 +2479,33 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
> > goto out_release;
> > }
> >
> > + if (np) {
> > + pd = sh_eth_parse_dt(&pdev->dev, ndev, np);
> > + if (pdev->dev.platform_data && pd) {
> > + struct sh_eth_plat_data *tmp =
> > + pdev->dev.platform_data;
> > + pd->set_mdio_gate = tmp->set_mdio_gate;
> > + pd->needs_init = tmp->needs_init;
> > + }
> > + } else
> > + pd = pdev->dev.platform_data;
> > +
> > + if (!pd) {
> > + dev_err(&pdev->dev, "no setup data defined\n");
> > + ret = -EINVAL;
> > + goto out_release;
> > + }
> > +
> > + SET_NETDEV_DEV(ndev, &pdev->dev);
> > +
> > + mdp->num_tx_ring = TX_RING_SIZE;
> > + mdp->num_rx_ring = RX_RING_SIZE;
> > +
> > spin_lock_init(&mdp->lock);
> > mdp->pdev = pdev;
> > pm_runtime_enable(&pdev->dev);
> > pm_runtime_resume(&pdev->dev);
> >
> > - pd = (struct sh_eth_plat_data *)(pdev->dev.platform_data);
> > /* get PHY ID */
> > mdp->phy_id = pd->phy;
> > mdp->phy_interface = pd->phy_interface;
> > @@ -2412,6 +2514,8 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
> > mdp->no_ether_link = pd->no_ether_link;
> > mdp->ether_link_active_low = pd->ether_link_active_low;
> > mdp->reg_offset = sh_eth_get_register_offset(pd->register_type);
> > + /* read and set MAC address */
> > + read_mac_address(ndev, pd->mac_addr);
> >
> > /* set cpu data */
> > #if defined(SH_ETH_HAS_BOTH_MODULES)
> > @@ -2429,20 +2533,16 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
> > /* debug message level */
> > mdp->msg_enable = SH_ETH_DEF_MSG_ENABLE;
> >
> > - /* read and set MAC address */
> > - read_mac_address(ndev, pd->mac_addr);
> > -
> > /* ioremap the TSU registers */
> > if (mdp->cd->tsu) {
> > struct resource *rtsu;
> > rtsu = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> > if (!rtsu) {
> > dev_err(&pdev->dev, "Not found TSU resource\n");
> > - ret = -ENODEV;
> > goto out_release;
> > }
> > mdp->tsu_addr = ioremap(rtsu->start,
> > - resource_size(rtsu));
> > + resource_size(rtsu));
> > mdp->port = devno % 2;
> > ndev->features = NETIF_F_HW_VLAN_FILTER;
> > }
> > @@ -2509,6 +2609,7 @@ static int sh_eth_drv_remove(struct platform_device *pdev)
> > return 0;
> > }
> >
> > +#ifdef CONFIG_PM
> > static int sh_eth_runtime_nop(struct device *dev)
> > {
> > /*
> > @@ -2522,17 +2623,30 @@ static int sh_eth_runtime_nop(struct device *dev)
> > return 0;
> > }
> >
> > -static struct dev_pm_ops sh_eth_dev_pm_ops = {
> > +static const struct dev_pm_ops sh_eth_dev_pm_ops = {
> > .runtime_suspend = sh_eth_runtime_nop,
> > .runtime_resume = sh_eth_runtime_nop,
> > };
> > +#define SH_ETH_PM_OPS (&sh_eth_dev_pm_ops)
> > +#else
> > +#define SH_ETH_PM_OPS NULL
> > +#endif
> > +
> > +#ifdef CONFIG_OF
> > +static const struct of_device_id sh_eth_match[] = {
> > + { .compatible = "renesas,sh-eth", },
> > + {},
> > +};
> > +MODULE_DEVICE_TABLE(of, sh_eth_match);
> > +#endif
> >
> > static struct platform_driver sh_eth_driver = {
> > .probe = sh_eth_drv_probe,
> > .remove = sh_eth_drv_remove,
> > .driver = {
> > .name = CARDNAME,
> > - .pm = &sh_eth_dev_pm_ops,
> > + .pm = SH_ETH_PM_OPS,
> > + .of_match_table = of_match_ptr(sh_eth_match),
> > },
> > };
> >
> > --
> > 1.7.10.4
> >
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply
* Re: [PATCH v2 net-next 1/5] GRE: Refactor GRE tunneling code.
From: Pravin Shelar @ 2013-03-19 3:11 UTC (permalink / raw)
To: David Miller; +Cc: stephen, netdev, jesse
In-Reply-To: <20130318.153319.206719819832403477.davem@davemloft.net>
On Mon, Mar 18, 2013 at 12:33 PM, David Miller <davem@davemloft.net> wrote:
> From: Stephen Hemminger <stephen@networkplumber.org>
> Date: Mon, 18 Mar 2013 12:24:09 -0700
>
>> On Mon, 18 Mar 2013 11:13:25 -0700
>> Pravin B Shelar <pshelar@nicira.com> wrote:
>>
>>> diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig
>>> index 7944df7..2073226 100644
>>> --- a/net/ipv4/Kconfig
>>> +++ b/net/ipv4/Kconfig
>>> @@ -186,9 +186,14 @@ config NET_IPGRE_DEMUX
>>> This is helper module to demultiplex GRE packets on GRE version field criteria.
>>> Required by ip_gre and pptp modules.
>>>
>>> +config NET_IP_TUNNEL
>>> + tristate
>>> + default n
>>> +
>>
>> Won't this break existing kernel config's, shouldn't this default y?
>
> Or "m". But indeed, it should be made to automatically work for
> existing configs.
ok,
I will post updated patch.
Thanks.
^ permalink raw reply
* RE: [Xen-devel] [PATCH 1/4] xen-netfront: remove unused variable `extra'
From: James Harper @ 2013-03-19 3:02 UTC (permalink / raw)
To: annie li, Ian Campbell
Cc: netdev@vger.kernel.org, konrad.wilk@oracle.com, Wei Liu,
xen-devel@lists.xen.org
In-Reply-To: <5147CFD2.8040803@oracle.com>
>
> On 2013-3-18 20:14, Ian Campbell wrote:
> > On Mon, 2013-03-18 at 12:04 +0000, Wei Liu wrote:
> >> On Mon, 2013-03-18 at 11:42 +0000, Ian Campbell wrote:
> >>> On Mon, 2013-03-18 at 10:35 +0000, Wei Liu wrote:
> >>>
> >>> I think a few more words are needed here since from the code you are
> >>> removing it seems very much like gso is used for something. If you have
> >>> a proof that the "extra = gso" case is never hit then please explain it.
> >>> Perhaps a reference to the removal of the last user?
> >>>
> >>> Or maybe it is the case that it should be used and the bug is that it
> >>> isn't?
> >>>
> >> Looks like the latter one. 'extra' field should be used to get hold of
> >> the last extra info in the ring. ;-)
> >>
> >> But, the only extra info in upstream kernel is
> XEN_NETIF_EXTRA_TYPE_GSO,
> >> so there's really no other extra info in the ring at that point. Could
> >> it be possible that it is something from classic Xen kernel?
> > The classic kernel netfront has exactly the same code it seems and
> > netif_extra_type_gso is the only one I've ever heard of.
> >
> > Maybe this extra thing is just redundant unless/until a second extra
> > comes along.
>
> In our windows pv driver, we do not process this for GSO in tx path
> either. Maybe we ignored processing for some special GSO?
>
> BTW, what is XEN_NETIF_EXTRA_FLAG_MORE actually for? Backend only
> processes it in xen_netback_tx_build_gops, but netfront xmit path does
> not really set this flag. I did process it in rx path of my windows pv
> driver(linux netfront did that too), but it seems unnecessary since
> netback does not set this flag at all.
>
This flag is set to say if there is another 'extra' ring entry. From netif.h:
/*
* This is the 'wire' format for packets:
* Request 1: netif_tx_request -- NETTXF_* (any flags)
* [Request 2: netif_tx_extra] (only if request 1 has NETTXF_extra_info)
* [Request 3: netif_tx_extra] (only if request 2 has XEN_NETIF_EXTRA_MORE)
* Request 4: netif_tx_request -- NETTXF_more_data
* Request 5: netif_tx_request -- NETTXF_more_data
* ...
* Request N: netif_tx_request -- 0
*/
I think the only extra type is GSO so you'll probably never see it, but that's what it's for.
James
^ permalink raw reply
* Re: [PATCH] s3c-adc-battery: Fix possible NULL pointer dereference
From: Anton Vorontsov @ 2013-03-19 2:43 UTC (permalink / raw)
To: Syam Sidhardhan; +Cc: netdev, linux-kernel, dwmw2
In-Reply-To: <1361747005-29306-1-git-send-email-s.syam@samsung.com>
On Mon, Feb 25, 2013 at 04:33:25AM +0530, Syam Sidhardhan wrote:
> Check for (bat == NULL) has to be done before accessing bat
>
> Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
> ---
Applied, thanks!
> drivers/power/s3c_adc_battery.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/power/s3c_adc_battery.c b/drivers/power/s3c_adc_battery.c
> index d2ca989..5948ce0 100644
> --- a/drivers/power/s3c_adc_battery.c
> +++ b/drivers/power/s3c_adc_battery.c
> @@ -145,14 +145,17 @@ static int s3c_adc_bat_get_property(struct power_supply *psy,
>
> int new_level;
> int full_volt;
> - const struct s3c_adc_bat_thresh *lut = bat->pdata->lut_noac;
> - unsigned int lut_size = bat->pdata->lut_noac_cnt;
> + const struct s3c_adc_bat_thresh *lut;
> + unsigned int lut_size;
>
> if (!bat) {
> dev_err(psy->dev, "no battery infos ?!\n");
> return -EINVAL;
> }
>
> + lut = bat->pdata->lut_noac;
> + lut_size = bat->pdata->lut_noac_cnt;
> +
> if (bat->volt_value < 0 || bat->cur_value < 0 ||
> jiffies_to_msecs(jiffies - bat->timestamp) >
> BAT_POLL_INTERVAL) {
> --
> 1.7.9.5
^ permalink raw reply
* Re: [PATCH 1/4] xen-netfront: remove unused variable `extra'
From: annie li @ 2013-03-19 2:39 UTC (permalink / raw)
To: Ian Campbell
Cc: Wei Liu, netdev@vger.kernel.org, xen-devel@lists.xen.org,
konrad.wilk@oracle.com
In-Reply-To: <1363608860.30193.39.camel@zakaz.uk.xensource.com>
On 2013-3-18 20:14, Ian Campbell wrote:
> On Mon, 2013-03-18 at 12:04 +0000, Wei Liu wrote:
>> On Mon, 2013-03-18 at 11:42 +0000, Ian Campbell wrote:
>>> On Mon, 2013-03-18 at 10:35 +0000, Wei Liu wrote:
>>>
>>> I think a few more words are needed here since from the code you are
>>> removing it seems very much like gso is used for something. If you have
>>> a proof that the "extra = gso" case is never hit then please explain it.
>>> Perhaps a reference to the removal of the last user?
>>>
>>> Or maybe it is the case that it should be used and the bug is that it
>>> isn't?
>>>
>> Looks like the latter one. 'extra' field should be used to get hold of
>> the last extra info in the ring. ;-)
>>
>> But, the only extra info in upstream kernel is XEN_NETIF_EXTRA_TYPE_GSO,
>> so there's really no other extra info in the ring at that point. Could
>> it be possible that it is something from classic Xen kernel?
> The classic kernel netfront has exactly the same code it seems and
> netif_extra_type_gso is the only one I've ever heard of.
>
> Maybe this extra thing is just redundant unless/until a second extra
> comes along.
In our windows pv driver, we do not process this for GSO in tx path
either. Maybe we ignored processing for some special GSO?
BTW, what is XEN_NETIF_EXTRA_FLAG_MORE actually for? Backend only
processes it in xen_netback_tx_build_gops, but netfront xmit path does
not really set this flag. I did process it in rx path of my windows pv
driver(linux netfront did that too), but it seems unnecessary since
netback does not set this flag at all.
Thanks
Annie
^ permalink raw reply
* How to assign sockaddr_nl->nl_groups when using connector
From: vaughan @ 2013-03-19 2:15 UTC (permalink / raw)
To: zbr; +Cc: netdev, KY Srinivasan, devel@linuxdriverproject.org
Hi Evgeniy,
I am not quite sure how to assign nl_groups when using connector. You
Documentation/connector/connector.txt don't explain it very clearly. I
thought it's a bitmask representing only 32 groups.
If I just want to subscribe only one group such as CN_KVP_IDX, what
shall I do? Which one below is correct?
a) l_local.nl_groups = CN_KVP_IDX;
Or
b) l_local.nl_groups = 1 << (CN_KVP_IDX -1)
and bind with bind(s, (struct sockaddr *)&l_local, sizeof(struct
sockaddr_nl)).
I ran your example in Documentation/connector/. 'l_local.nl_groups = -1'
in ucon.c seems subscribe all channels, because if I start cgred
service, ucon will receive messages with idx=1.
And it seems setsockopt is not needed now, for it is done by
netlink_autobind? You even comment it out using '#if 0' in
Documentation/connector/ucon.c.
Could you do me a favor to check
http://driverdev.linuxdriverproject.org/pipermail/devel/2013-March/036306.html
to see if my understanding is correct or not? Thanks.
--
Regards,
Vaughan
^ permalink raw reply
* [PATCH 2/2] ipvs: remove extra rcu lock
From: Simon Horman @ 2013-03-19 1:41 UTC (permalink / raw)
To: Pablo Neira Ayuso
Cc: lvs-devel, netdev, netfilter-devel, Wensong Zhang,
Julian Anastasov, Simon Horman
In-Reply-To: <1363657273-5835-1-git-send-email-horms@verge.net.au>
From: Julian Anastasov <ja@ssi.bg>
In 3.7 we added code that uses ipv4_update_pmtu but after commit
c5ae7d4192 (ipv4: must use rcu protection while calling fib_lookup)
the RCU lock is not needed.
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
net/netfilter/ipvs/ip_vs_core.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index 18b4bc5..61f49d2 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -1394,10 +1394,8 @@ ip_vs_in_icmp(struct sk_buff *skb, int *related, unsigned int hooknum)
skb_reset_network_header(skb);
IP_VS_DBG(12, "ICMP for IPIP %pI4->%pI4: mtu=%u\n",
&ip_hdr(skb)->saddr, &ip_hdr(skb)->daddr, mtu);
- rcu_read_lock();
ipv4_update_pmtu(skb, dev_net(skb->dev),
mtu, 0, 0, 0, 0);
- rcu_read_unlock();
/* Client uses PMTUD? */
if (!(cih->frag_off & htons(IP_DF)))
goto ignore_ipip;
--
1.7.10.4
^ permalink raw reply related
* [PATCH 1/2] ipvs: add backup_only flag to avoid loops
From: Simon Horman @ 2013-03-19 1:41 UTC (permalink / raw)
To: Pablo Neira Ayuso
Cc: lvs-devel, netdev, netfilter-devel, Wensong Zhang,
Julian Anastasov, Simon Horman
In-Reply-To: <1363657273-5835-1-git-send-email-horms@verge.net.au>
From: Julian Anastasov <ja@ssi.bg>
Dmitry Akindinov is reporting for a problem where SYNs are looping
between the master and backup server when the backup server is used as
real server in DR mode and has IPVS rules to function as director.
Even when the backup function is enabled we continue to forward
traffic and schedule new connections when the current master is using
the backup server as real server. While this is not a problem for NAT,
for DR and TUN method the backup server can not determine if a request
comes from client or from director.
To avoid such loops add new sysctl flag backup_only. It can be needed
for DR/TUN setups that do not need backup and director function at the
same time. When the backup function is enabled we stop any forwarding
and pass the traffic to the local stack (real server mode). The flag
disables the director function when the backup function is enabled.
For setups that enable backup function for some virtual services and
director function for other virtual services there should be another
more complex solution to support DR/TUN mode, may be to assign
per-virtual service syncid value, so that we can differentiate the
requests.
Reported-by: Dmitry Akindinov <dimak@stalker.com>
Tested-by: German Myzovsky <lawyer@sipnet.ru>
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
Documentation/networking/ipvs-sysctl.txt | 7 +++++++
include/net/ip_vs.h | 12 ++++++++++++
net/netfilter/ipvs/ip_vs_core.c | 12 ++++++++----
net/netfilter/ipvs/ip_vs_ctl.c | 7 +++++++
4 files changed, 34 insertions(+), 4 deletions(-)
diff --git a/Documentation/networking/ipvs-sysctl.txt b/Documentation/networking/ipvs-sysctl.txt
index f2a2488..9573d0c 100644
--- a/Documentation/networking/ipvs-sysctl.txt
+++ b/Documentation/networking/ipvs-sysctl.txt
@@ -15,6 +15,13 @@ amemthresh - INTEGER
enabled and the variable is automatically set to 2, otherwise
the strategy is disabled and the variable is set to 1.
+backup_only - BOOLEAN
+ 0 - disabled (default)
+ not 0 - enabled
+
+ If set, disable the director function while the server is
+ in backup mode to avoid packet loops for DR/TUN methods.
+
conntrack - BOOLEAN
0 - disabled (default)
not 0 - enabled
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 68c69d5..fce8e6b 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -976,6 +976,7 @@ struct netns_ipvs {
int sysctl_sync_retries;
int sysctl_nat_icmp_send;
int sysctl_pmtu_disc;
+ int sysctl_backup_only;
/* ip_vs_lblc */
int sysctl_lblc_expiration;
@@ -1067,6 +1068,12 @@ static inline int sysctl_pmtu_disc(struct netns_ipvs *ipvs)
return ipvs->sysctl_pmtu_disc;
}
+static inline int sysctl_backup_only(struct netns_ipvs *ipvs)
+{
+ return ipvs->sync_state & IP_VS_STATE_BACKUP &&
+ ipvs->sysctl_backup_only;
+}
+
#else
static inline int sysctl_sync_threshold(struct netns_ipvs *ipvs)
@@ -1114,6 +1121,11 @@ static inline int sysctl_pmtu_disc(struct netns_ipvs *ipvs)
return 1;
}
+static inline int sysctl_backup_only(struct netns_ipvs *ipvs)
+{
+ return 0;
+}
+
#endif
/*
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index 47edf5a..18b4bc5 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -1577,7 +1577,8 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int af)
}
/* ipvs enabled in this netns ? */
net = skb_net(skb);
- if (!net_ipvs(net)->enable)
+ ipvs = net_ipvs(net);
+ if (unlikely(sysctl_backup_only(ipvs) || !ipvs->enable))
return NF_ACCEPT;
ip_vs_fill_iph_skb(af, skb, &iph);
@@ -1654,7 +1655,6 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int af)
}
IP_VS_DBG_PKT(11, af, pp, skb, 0, "Incoming packet");
- ipvs = net_ipvs(net);
/* Check the server status */
if (cp->dest && !(cp->dest->flags & IP_VS_DEST_F_AVAILABLE)) {
/* the destination server is not available */
@@ -1815,13 +1815,15 @@ ip_vs_forward_icmp(unsigned int hooknum, struct sk_buff *skb,
{
int r;
struct net *net;
+ struct netns_ipvs *ipvs;
if (ip_hdr(skb)->protocol != IPPROTO_ICMP)
return NF_ACCEPT;
/* ipvs enabled in this netns ? */
net = skb_net(skb);
- if (!net_ipvs(net)->enable)
+ ipvs = net_ipvs(net);
+ if (unlikely(sysctl_backup_only(ipvs) || !ipvs->enable))
return NF_ACCEPT;
return ip_vs_in_icmp(skb, &r, hooknum);
@@ -1835,6 +1837,7 @@ ip_vs_forward_icmp_v6(unsigned int hooknum, struct sk_buff *skb,
{
int r;
struct net *net;
+ struct netns_ipvs *ipvs;
struct ip_vs_iphdr iphdr;
ip_vs_fill_iph_skb(AF_INET6, skb, &iphdr);
@@ -1843,7 +1846,8 @@ ip_vs_forward_icmp_v6(unsigned int hooknum, struct sk_buff *skb,
/* ipvs enabled in this netns ? */
net = skb_net(skb);
- if (!net_ipvs(net)->enable)
+ ipvs = net_ipvs(net);
+ if (unlikely(sysctl_backup_only(ipvs) || !ipvs->enable))
return NF_ACCEPT;
return ip_vs_in_icmp_v6(skb, &r, hooknum, &iphdr);
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index c68198b..9e2d1cc 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -1808,6 +1808,12 @@ static struct ctl_table vs_vars[] = {
.mode = 0644,
.proc_handler = proc_dointvec,
},
+ {
+ .procname = "backup_only",
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .proc_handler = proc_dointvec,
+ },
#ifdef CONFIG_IP_VS_DEBUG
{
.procname = "debug_level",
@@ -3741,6 +3747,7 @@ static int __net_init ip_vs_control_net_init_sysctl(struct net *net)
tbl[idx++].data = &ipvs->sysctl_nat_icmp_send;
ipvs->sysctl_pmtu_disc = 1;
tbl[idx++].data = &ipvs->sysctl_pmtu_disc;
+ tbl[idx++].data = &ipvs->sysctl_backup_only;
ipvs->sysctl_hdr = register_net_sysctl(net, "net/ipv4/vs", tbl);
--
1.7.10.4
^ permalink raw reply related
* [GIT PULL nf-next] IPVS enhancements for v3.10
From: Simon Horman @ 2013-03-19 1:41 UTC (permalink / raw)
To: Pablo Neira Ayuso
Cc: lvs-devel, netdev, netfilter-devel, Wensong Zhang,
Julian Anastasov
Hi Pablo,
The following changes since commit 1cdb09056b27b2a06b06dc7187d2c33d57082d20:
netfilter: nfnetlink_queue: use xor hash function to distribute instances (2013-03-15 12:38:40 +0100)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/horms/ipvs-next.git tags/ipvs-for-v3.10
for you to fetch changes up to 95d7929db57c04833ace016fe6889d11f9c24dce:
ipvs: remove extra rcu lock (2013-03-19 09:41:05 +0900)
----------------------------------------------------------------
IPVS enhancements for v3.10 from Julian Anastasov
----------------------------------------------------------------
Julian Anastasov (2):
ipvs: add backup_only flag to avoid loops
ipvs: remove extra rcu lock
Documentation/networking/ipvs-sysctl.txt | 7 +++++++
include/net/ip_vs.h | 12 ++++++++++++
net/netfilter/ipvs/ip_vs_core.c | 14 ++++++++------
net/netfilter/ipvs/ip_vs_ctl.c | 7 +++++++
4 files changed, 34 insertions(+), 6 deletions(-)
^ permalink raw reply
* [PATCH 2/3] ipvs: fix hashing in ip_vs_svc_hashkey
From: Simon Horman @ 2013-03-19 1:39 UTC (permalink / raw)
To: Pablo Neira Ayuso
Cc: lvs-devel, netdev, netfilter-devel, Wensong Zhang,
Julian Anastasov, Simon Horman
In-Reply-To: <1363657198-5333-1-git-send-email-horms@verge.net.au>
From: Julian Anastasov <ja@ssi.bg>
net is a pointer in host order, mix it properly
with other keys in network order. Fixes sparse warning.
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
net/netfilter/ipvs/ip_vs_ctl.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index c68198b..a528178 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -271,16 +271,18 @@ ip_vs_svc_hashkey(struct net *net, int af, unsigned int proto,
{
register unsigned int porth = ntohs(port);
__be32 addr_fold = addr->ip;
+ __u32 ahash;
#ifdef CONFIG_IP_VS_IPV6
if (af == AF_INET6)
addr_fold = addr->ip6[0]^addr->ip6[1]^
addr->ip6[2]^addr->ip6[3];
#endif
- addr_fold ^= ((size_t)net>>8);
+ ahash = ntohl(addr_fold);
+ ahash ^= ((size_t) net >> 8);
- return (proto^ntohl(addr_fold)^(porth>>IP_VS_SVC_TAB_BITS)^porth)
- & IP_VS_SVC_TAB_MASK;
+ return (proto ^ ahash ^ (porth >> IP_VS_SVC_TAB_BITS) ^ porth) &
+ IP_VS_SVC_TAB_MASK;
}
/*
--
1.7.10.4
^ permalink raw reply related
* [PATCH 1/3] ipvs: fix sctp chunk length order
From: Simon Horman @ 2013-03-19 1:39 UTC (permalink / raw)
To: Pablo Neira Ayuso
Cc: lvs-devel, netdev, netfilter-devel, Wensong Zhang,
Julian Anastasov, Simon Horman
In-Reply-To: <1363657198-5333-1-git-send-email-horms@verge.net.au>
From: Julian Anastasov <ja@ssi.bg>
Fix wrong but non-fatal access to chunk length.
sch->length should be in network order, next chunk should
be aligned to 4 bytes. Problem noticed in sparse output.
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
net/netfilter/ipvs/ip_vs_proto_sctp.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/net/netfilter/ipvs/ip_vs_proto_sctp.c b/net/netfilter/ipvs/ip_vs_proto_sctp.c
index ae8ec6f..cd1d729 100644
--- a/net/netfilter/ipvs/ip_vs_proto_sctp.c
+++ b/net/netfilter/ipvs/ip_vs_proto_sctp.c
@@ -906,7 +906,7 @@ set_sctp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
sctp_chunkhdr_t _sctpch, *sch;
unsigned char chunk_type;
int event, next_state;
- int ihl;
+ int ihl, cofs;
#ifdef CONFIG_IP_VS_IPV6
ihl = cp->af == AF_INET ? ip_hdrlen(skb) : sizeof(struct ipv6hdr);
@@ -914,8 +914,8 @@ set_sctp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
ihl = ip_hdrlen(skb);
#endif
- sch = skb_header_pointer(skb, ihl + sizeof(sctp_sctphdr_t),
- sizeof(_sctpch), &_sctpch);
+ cofs = ihl + sizeof(sctp_sctphdr_t);
+ sch = skb_header_pointer(skb, cofs, sizeof(_sctpch), &_sctpch);
if (sch == NULL)
return;
@@ -933,10 +933,12 @@ set_sctp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
*/
if ((sch->type == SCTP_CID_COOKIE_ECHO) ||
(sch->type == SCTP_CID_COOKIE_ACK)) {
- sch = skb_header_pointer(skb, (ihl + sizeof(sctp_sctphdr_t) +
- sch->length), sizeof(_sctpch), &_sctpch);
- if (sch) {
- if (sch->type == SCTP_CID_ABORT)
+ int clen = ntohs(sch->length);
+
+ if (clen >= sizeof(sctp_chunkhdr_t)) {
+ sch = skb_header_pointer(skb, cofs + ALIGN(clen, 4),
+ sizeof(_sctpch), &_sctpch);
+ if (sch && sch->type == SCTP_CID_ABORT)
chunk_type = sch->type;
}
}
--
1.7.10.4
^ permalink raw reply related
* [PATCH 3/3] ipvs: fix some sparse warnings
From: Simon Horman @ 2013-03-19 1:39 UTC (permalink / raw)
To: Pablo Neira Ayuso
Cc: lvs-devel, netdev, netfilter-devel, Wensong Zhang,
Julian Anastasov, Simon Horman
In-Reply-To: <1363657198-5333-1-git-send-email-horms@verge.net.au>
From: Julian Anastasov <ja@ssi.bg>
Add missing __percpu annotations and make ip_vs_net_id static.
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
include/net/ip_vs.h | 2 +-
net/netfilter/ipvs/ip_vs_core.c | 8 +-------
net/netfilter/ipvs/ip_vs_est.c | 2 +-
3 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 68c69d5..29bc055 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -459,7 +459,7 @@ struct ip_vs_estimator {
struct ip_vs_stats {
struct ip_vs_stats_user ustats; /* statistics */
struct ip_vs_estimator est; /* estimator */
- struct ip_vs_cpu_stats *cpustats; /* per cpu counters */
+ struct ip_vs_cpu_stats __percpu *cpustats; /* per cpu counters */
spinlock_t lock; /* spin lock */
struct ip_vs_stats_user ustats0; /* reset values */
};
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index 47edf5a..3e5e80b 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -69,10 +69,7 @@ EXPORT_SYMBOL(ip_vs_conn_put);
EXPORT_SYMBOL(ip_vs_get_debug_level);
#endif
-int ip_vs_net_id __read_mostly;
-#ifdef IP_VS_GENERIC_NETNS
-EXPORT_SYMBOL(ip_vs_net_id);
-#endif
+static int ip_vs_net_id __read_mostly;
/* netns cnt used for uniqueness */
static atomic_t ipvs_netns_cnt = ATOMIC_INIT(0);
@@ -1181,9 +1178,6 @@ ip_vs_out(unsigned int hooknum, struct sk_buff *skb, int af)
iph.len)))) {
#ifdef CONFIG_IP_VS_IPV6
if (af == AF_INET6) {
- struct net *net =
- dev_net(skb_dst(skb)->dev);
-
if (!skb->dev)
skb->dev = net->loopback_dev;
icmpv6_send(skb,
diff --git a/net/netfilter/ipvs/ip_vs_est.c b/net/netfilter/ipvs/ip_vs_est.c
index 0fac601..6bee6d0 100644
--- a/net/netfilter/ipvs/ip_vs_est.c
+++ b/net/netfilter/ipvs/ip_vs_est.c
@@ -56,7 +56,7 @@
* Make a summary from each cpu
*/
static void ip_vs_read_cpu_stats(struct ip_vs_stats_user *sum,
- struct ip_vs_cpu_stats *stats)
+ struct ip_vs_cpu_stats __percpu *stats)
{
int i;
--
1.7.10.4
^ permalink raw reply related
* [GIT PULL nf] IPVS fixes for v3.9
From: Simon Horman @ 2013-03-19 1:39 UTC (permalink / raw)
To: Pablo Neira Ayuso
Cc: lvs-devel, netdev, netfilter-devel, Wensong Zhang,
Julian Anastasov
Hi Pablo,
The following changes since commit a82783c91d5dce680dbd290ebf301a520b0e72a5:
netfilter: ip6t_NPT: restrict to mangle table (2013-03-15 12:58:21 +0100)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/horms/ipvs.git tags/ipvs-fixes-for-v3.9
for you to fetch changes up to 1804ac13ac3d9d39b94f3074f303b286e90632ba:
ipvs: fix some sparse warnings (2013-03-19 09:37:37 +0900)
----------------------------------------------------------------
IPVS fixes for v3.9 from Julian Anastasov
----------------------------------------------------------------
Julian Anastasov (3):
ipvs: fix sctp chunk length order
ipvs: fix hashing in ip_vs_svc_hashkey
ipvs: fix some sparse warnings
include/net/ip_vs.h | 2 +-
net/netfilter/ipvs/ip_vs_core.c | 8 +-------
net/netfilter/ipvs/ip_vs_ctl.c | 8 +++++---
net/netfilter/ipvs/ip_vs_est.c | 2 +-
net/netfilter/ipvs/ip_vs_proto_sctp.c | 16 +++++++++-------
5 files changed, 17 insertions(+), 19 deletions(-)
^ permalink raw reply
* Re: [Xen-devel] [PATCH 2/4] xen-netfront: drop skb when skb->len > 65535
From: annie li @ 2013-03-19 1:35 UTC (permalink / raw)
To: Wei Liu; +Cc: netdev, xen-devel, ian.campbell, konrad.wilk
In-Reply-To: <1363602955-24790-3-git-send-email-wei.liu2@citrix.com>
On 2013-3-18 18:35, Wei Liu wrote:
> The `size' field of Xen network wire format is uint16_t, anything bigger than
> 65535 will cause overflow.
>
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> ---
> drivers/net/xen-netfront.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
> index 5527663..8c3d065 100644
> --- a/drivers/net/xen-netfront.c
> +++ b/drivers/net/xen-netfront.c
> @@ -547,6 +547,18 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
> unsigned int len = skb_headlen(skb);
> unsigned long flags;
>
> + /*
> + * wire format of xen_netif_tx_request only supports skb->len
> + * < 64K, because size field in xen_netif_tx_request is
> + * uint16_t.
> + */
> + if (unlikely(skb->len > (uint16_t)(~0))) {
> + net_alert_ratelimited(
> + "xennet: skb->len = %d, too big for wire format\n",
> + skb->len);
> + goto drop;
> + }
> +
Maybe it is better to do some segmentation for packets(>15536) which
support segments, and drop those which do not support segment.
This can also be implemented in another patch(Just like what i did for
packets which requires slots larger than SKB_MAX_FRAGS).
Thanks
Annie
> slots = DIV_ROUND_UP(offset + len, PAGE_SIZE) +
> xennet_count_skb_frag_slots(skb);
> if (unlikely(slots > MAX_SKB_FRAGS + 1)) {
^ permalink raw reply
* Re: [Patch net] bridge: do not expire mdb entry when bridge still uses it
From: Cong Wang @ 2013-03-19 1:12 UTC (permalink / raw)
To: Herbert Xu; +Cc: Stephen Hemminger, netdev, bridge, David S. Miller, Adam Baker
In-Reply-To: <1362966251.17872.2.camel@cr0>
Herbert, ping... :-)
On Mon, 2013-03-11 at 09:44 +0800, Cong Wang wrote:
> On Fri, 2013-03-08 at 19:24 +0800, Herbert Xu wrote:
> > On Fri, Mar 08, 2013 at 03:26:21PM +0800, Cong Wang wrote:
> > >
> > > Hmm, what the user experiences is the multicast traffic between the
> > > bridge and some port is broken. Isn't this expected to work by default?
> >
> > Oh I'm not arguing that this isn't a bug. I'm trying to ensure
> > that we come up with the right fix.
>
> Do you have any idea of a better fix?
>
> >
> > > Or we can just change the default value of br->multicast_router to 2?
> >
> > No because that will cause all sorts of stuff to be thrown at
> > the host.
> >
>
> OK.
>
> Thanks!
^ permalink raw reply
* Re: [PATCH] ath9k : Fix ieee80211 work while going to suspend
From: Parag Warudkar @ 2013-03-19 1:02 UTC (permalink / raw)
To: Luis R. Rodriguez
Cc: John W. Linville, Parag Warudkar, Jouni Malinen,
Vasanthakumar Thiagarajan, linux-wireless, ath9k-devel, netdev,
LKML, senthilb
In-Reply-To: <20130318210308.GD32416@pogo>
On Mon, 18 Mar 2013, Luis R. Rodriguez wrote:
>
> Note that what this will do is call later mod_timer() for
> rx_poll_timer, the right thing to do then, which would
> be equivalent to your patch is to modify the ath_start_rx_poll()
> to instead use the new API mod_timer_pending() added on v2.6.30
> via commit 74019224. This would not re-arm the timer if it was
> previously removed.
Thanks for the details Luis. Converting to mod_timer_pending() seems to do
the trick as well.
Parag
^ permalink raw reply
* Re: [PATCH] drivers/isdn: beautify code, delete 'break' after 'return'
From: Chen Gang @ 2013-03-19 0:53 UTC (permalink / raw)
To: Jiri Kosina; +Cc: isdn, Jiri Slaby, Greg KH, alan, netdev
In-Reply-To: <alpine.LNX.2.00.1303181424590.9529@pobox.suse.cz>
On 2013年03月18日 21:25, Jiri Kosina wrote:
> On Fri, 15 Mar 2013, Chen Gang wrote:
>
>> > Hello Maintainers:
>> >
>> > is it patch ok ?
> This one is now applied.
thanks.
--
Chen Gang
Asianux Corporation
^ permalink raw reply
* Re: [GIT PULL nf-next] IPVS
From: Simon Horman @ 2013-03-19 0:38 UTC (permalink / raw)
To: Pablo Neira Ayuso
Cc: lvs-devel, netdev, netfilter-devel, Wensong Zhang,
Julian Anastasov
In-Reply-To: <20130318233115.GA23070@localhost>
On Tue, Mar 19, 2013 at 12:31:15AM +0100, Pablo Neira Ayuso wrote:
> Hi Simon,
>
> On Mon, Mar 18, 2013 at 10:15:38PM +0900, Simon Horman wrote:
> [...]
> > ----------------------------------------------------------------
> > IPVS enhancements for v3.10 from Julian Anastasov
> >
> > ----------------------------------------------------------------
> > Julian Anastasov (5):
> > ipvs: add backup_only flag to avoid loops
> > ipvs: remove extra rcu lock
> > ipvs: fix sctp chunk length order
> > ipvs: fix hashing in ip_vs_svc_hashkey
> > ipvs: fix some sparse warnings
>
> I think that these three fixes:
>
> ipvs: add backup_only flag to avoid loops
> ipvs: remove extra rcu lock
> ipvs: fix sctp chunk length order
>
> should find their path to the net tree.
>
> The remaining two sparse fixes should go to net-next.
>
> I can manually apply these patch if you want to the corresponding
> trees.
Thanks. I'll send two fresh pull requests shortly.
^ permalink raw reply
* Re: [PATCH net-next 2/2] bnx2x: add RSS capability for GRE traffic
From: Eric Dumazet @ 2013-03-19 0:07 UTC (permalink / raw)
To: Dmitry Kravkov
Cc: davem, netdev, Eilon Greenstein, Tom Herbert,
Maciej Żenczykowski
In-Reply-To: <1363625464-21633-2-git-send-email-dmitry@broadcom.com>
On Mon, 2013-03-18 at 18:51 +0200, Dmitry Kravkov wrote:
> The patch drives FW to perform RSS for GRE traffic,
> based on inner headers.
>
> Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
> ---
> drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 3 +++
> drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 23 ++++++++++++-----------
> drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h | 9 +++++++++
> 3 files changed, 24 insertions(+), 11 deletions(-)
This works very well.
Problem is we skb_set_queue_mapping(skb, 0); in __skb_tunnel_rx()
(this was a patch from Tom Herbert, commit
693019e90ca45d881109d32c0c6d29adf03f6447 (net: reset skb queue mapping
when rx'ing over tunnel )
Meaning we hit a single cpu for the GRO stuff in ip_gre.
I have to think about it.
Another question is :
Can bnx2x check the tcp checksum if GRE encapsulated ?
^ permalink raw reply
* Re: [PATCH net-next v2] packet: packet fanout rollover during socket overload
From: Willem de Bruijn @ 2013-03-18 23:36 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev, David Miller
In-Reply-To: <1363649282.21184.12.camel@edumazet-glaptop>
Will resend after rebase + testing.
On Mon, Mar 18, 2013 at 7:28 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Mon, 2013-03-18 at 19:16 -0400, Willem de Bruijn wrote:
>
>> Thanks Eric.
>>
>> I need to rebase the patch once more to have it apply cleanly.
>
> Oh right, include/linux/if_packet.h was moved
> to include/uapi/linux/if_packet.h
Yes. I found another way to mess up a patch. Have rebased it already
and it compiles fine, but I want to test it, just to be sure. Will send
tomorrow with no other changes if nothing shows up.
>
>
>
^ permalink raw reply
* Re: [GIT PULL nf-next] IPVS
From: Pablo Neira Ayuso @ 2013-03-18 23:31 UTC (permalink / raw)
To: Simon Horman
Cc: lvs-devel, netdev, netfilter-devel, Wensong Zhang,
Julian Anastasov
In-Reply-To: <1363612543-9787-1-git-send-email-horms@verge.net.au>
Hi Simon,
On Mon, Mar 18, 2013 at 10:15:38PM +0900, Simon Horman wrote:
[...]
> ----------------------------------------------------------------
> IPVS enhancements for v3.10 from Julian Anastasov
>
> ----------------------------------------------------------------
> Julian Anastasov (5):
> ipvs: add backup_only flag to avoid loops
> ipvs: remove extra rcu lock
> ipvs: fix sctp chunk length order
> ipvs: fix hashing in ip_vs_svc_hashkey
> ipvs: fix some sparse warnings
I think that these three fixes:
ipvs: add backup_only flag to avoid loops
ipvs: remove extra rcu lock
ipvs: fix sctp chunk length order
should find their path to the net tree.
The remaining two sparse fixes should go to net-next.
I can manually apply these patch if you want to the corresponding
trees.
^ permalink raw reply
* Re: [PATCH net-next v2] packet: packet fanout rollover during socket overload
From: Eric Dumazet @ 2013-03-18 23:28 UTC (permalink / raw)
To: Willem de Bruijn; +Cc: netdev, David Miller
In-Reply-To: <CA+FuTSfvG8Wzn9Q12V-wsuzXv-VTth4NEkX1kFqdFKe42A-+9Q@mail.gmail.com>
On Mon, 2013-03-18 at 19:16 -0400, Willem de Bruijn wrote:
> Thanks Eric.
>
> I need to rebase the patch once more to have it apply cleanly.
Oh right, include/linux/if_packet.h was moved
to include/uapi/linux/if_packet.h
^ permalink raw reply
* Re: [PATCH net-next v2] packet: packet fanout rollover during socket overload
From: Willem de Bruijn @ 2013-03-18 23:16 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev, David Miller
In-Reply-To: <1363648249.21184.11.camel@edumazet-glaptop>
On Mon, Mar 18, 2013 at 7:10 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Mon, 2013-03-18 at 19:07 -0400, Willem de Bruijn wrote:
>> Minimize packet drop in a fanout group. If one socket is full,
>> roll over packets to another from the group. Maintain flow
>> affinity during normal load using an rxhash fanout policy, while
>> dispersing unexpected traffic storms that hit a single cpu, such
>> as spoofed-source DoS flows. Rollover breaks affinity for flows
>> arriving at saturated sockets during those conditions.
>>
>> The patch adds a fanout policy ROLLOVER that rotates between sockets,
>> filling each socket before moving to the next. It also adds a fanout
>> flag ROLLOVER. If passed along with any other fanout policy, the
>> primary policy is applied until the chosen socket is full. Then,
>> rollover selects another socket, to delay packet drop until the
>> entire system is saturated.
>>
>> Probing sockets is not free. Selecting the last used socket, as
>> rollover does, is a greedy approach that maximizes chance of
>> success, at the cost of extreme load imbalance. In practice, with
>> sufficiently long queues to absorb bursts, sockets are drained in
>> parallel and load balance looks uniform in `top`.
>>
>> To avoid contention, scales counters with number of sockets and
>> accesses them lockfree. Values are bounds checked to ensure
>> correctness.
>>
>> Tested using an application with 9 threads pinned to CPUs, one socket
>> per thread and sufficient busywork per packet operation to limits each
>> thread to handling 32 Kpps. When sent 500 Kpps single UDP stream
>> packets, a FANOUT_CPU setup processes 32 Kpps in total without this
>> patch, 270 Kpps with the patch. Tested with read() and with a packet
>> ring (V1).
>>
>> Signed-off-by: Willem de Bruijn <willemb@google.com>
>> ---
>
> Reviewed-by: Eric Dumazet <edumazet@google.com>
Thanks Eric.
I need to rebase the patch once more to have it apply cleanly.
>
>
^ 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