* [GIT PULL nf] IPVS
From: Simon Horman @ 2013-01-28 1:18 UTC (permalink / raw)
To: Pablo Neira Ayuso
Cc: lvs-devel, netdev, netfilter-devel, Wensong Zhang,
Julian Anastasov, Hans Schillstrom, Hans Schillstrom,
Jesper Dangaard Brouer, Dan Carpenter
Hi Pablo,
please consider the following fix for IPVS patch for 3.8.
I believe that the problem was introduced in 3.4 and thus
this fix is appropriate for 3.4, 3.5, 3.6 and 3.7 -stable.
----------------------------------------------------------------
The following changes since commit 5b76c4948fe6977bead2359c2054f3e6a2dcf3d0:
netfilter: x_tables: print correct hook names for ARP (2013-01-13 12:54:12 +0100)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/horms/ipvs.git master
for you to fetch changes up to b425df4cdd953a400d814b4474c9d3ec04481858:
ipvs: freeing uninitialized pointer on error (2013-01-28 10:14:37 +0900)
----------------------------------------------------------------
Dan Carpenter (1):
ipvs: freeing uninitialized pointer on error
net/netfilter/ipvs/ip_vs_sync.c | 2 ++
1 file changed, 2 insertions(+)
^ permalink raw reply
* [PATCH] ipvs: freeing uninitialized pointer on error
From: Simon Horman @ 2013-01-28 1:18 UTC (permalink / raw)
To: Pablo Neira Ayuso
Cc: lvs-devel, netdev, netfilter-devel, Wensong Zhang,
Julian Anastasov, Hans Schillstrom, Hans Schillstrom,
Jesper Dangaard Brouer, Dan Carpenter, Simon Horman
In-Reply-To: <1359335914-27325-1-git-send-email-horms@verge.net.au>
From: Dan Carpenter <dan.carpenter@oracle.com>
If state != IP_VS_STATE_BACKUP then tinfo->buf is uninitialized. If
kthread_run() fails then it means we free random memory resulting in an
oops.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
net/netfilter/ipvs/ip_vs_sync.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index effa10c..44fd10c 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -1795,6 +1795,8 @@ int start_sync_thread(struct net *net, int state, char *mcast_ifn, __u8 syncid)
GFP_KERNEL);
if (!tinfo->buf)
goto outtinfo;
+ } else {
+ tinfo->buf = NULL;
}
tinfo->id = id;
--
1.7.10.4
^ permalink raw reply related
* Re: [PATCH 1/2] net: sh_eth: Add support of device tree probe
From: Simon Horman @ 2013-01-28 1:21 UTC (permalink / raw)
To: Nobuhiro Iwamatsu; +Cc: netdev, linux-sh
In-Reply-To: <1350350279-8693-1-git-send-email-nobuhiro.iwamatsu.yj@renesas.com>
[Cc: linux-sh]
On Tue, Oct 16, 2012 at 10:17:58AM +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 let me know what the status of this patch is?
> ---
> Documentation/devicetree/bindings/net/sh_ether.txt | 45 ++++
> drivers/net/ethernet/renesas/sh_eth.c | 267 ++++++++++++++++----
> 2 files changed, 268 insertions(+), 44 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..2cec715
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/sh_ether.txt
> @@ -0,0 +1,45 @@
> +* 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).
> +- cell-index: Ether device index starts at 0.
> +- phy-mode: String, operation mode of the PHY interface.
> +- sh-eth,edmac-endian: String, endian of sh_eth dmac.
> +- sh-eth,register-type: String, register type of sh_eth.
> + Please select "gigabit", "fast-sh4" or
> + "fast-sh3-sh2".
> + Please select "little" or "big".
> +- sh-eth,endian: String, endian of sh_eth dmac.
> +- 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-etn,ether-link-active-low: set link check method.
> + When detection of link is treated as active-low,
> + set.
> +- sh-etn,needs-init: Initialization flag.
> + When initialize device in probing device, set.
> +
> +Example (armadillo800eva):
> + sh-eth@e9a00000 {
> + compatible = "renesas,sh-eth";
> + interrupt-parent = <&intca>;
> + reg = <0xe9a00000 0x800>, <0xe9a01800 0x800>;
> + interrupts = <0x500>;
> + cell-index = <0>;
> + phy-mode = "mii";
> + sh-eth,edmac-endian = "little";
> + 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 c8bfea0..756d87e 100644
> --- a/drivers/net/ethernet/renesas/sh_eth.c
> +++ b/drivers/net/ethernet/renesas/sh_eth.c
> @@ -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,21 +2353,161 @@ 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, int *devno)
> +{
> + int ret;
> + struct sh_eth_private *mdp = NULL;
> + struct resource res;
> + const char *of_str;
> + struct device_node *np = dev->of_node;
> + struct sh_eth_plat_data *pdata;
> +
> + mdp = netdev_priv(ndev);
> +
> + ret = of_address_to_resource(np, 0, &res);
> + if (ret) {
> + dev_err(dev, "could not determine device base address\n");
> + return NULL;
> + }
> +
> + ndev->base_addr = res.start;
> +
> + ndev->irq = irq_of_parse_and_map(np, 0);
> + if (ndev->irq == NO_IRQ) {
> + dev_err(dev, "irq_of_parse_and_map failed\n");
> + return NULL;
> + }
> +
> + mdp->addr = ioremap(res.start, resource_size(&res));
> + if (mdp->addr == NULL) {
> + dev_err(dev, "ioremap failed.\n");
> + return NULL;
> + }
> +
> + 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__);
> + goto out_release;
> + }
> +
> + ret = of_property_read_u32(np, "cell-index", devno);
> +
> + pdata->phy_interface = of_get_phy_mode(np);
> +
> + of_property_read_u32(np, "sh-eth,phy-id", &pdata->phy);
> +
> + of_property_read_string(np, "sh-eth,edmac-endian", &of_str);
> + if (of_str && !strcmp(of_str, "little"))
> + pdata->edmac_endian = EDMAC_LITTLE_ENDIAN;
> + else if (of_str && !strcmp(of_str, "big"))
> + pdata->edmac_endian = EDMAC_BIG_ENDIAN;
> + else
> + goto out_release;
> +
> + 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 out_release;
> + pdata->register_type = ret;
> +
> + if (of_find_property(np, "sh-eth,needs-init", NULL))
> + pdata->needs_init = 1;
> + else
> + pdata->needs_init = 0;
> +
> +#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;
> +
> +out_release:
> + iounmap(mdp->addr);
> + return NULL;
> +}
> +
> +static int
> +sh_eth_parse_dt_tmu(struct device *dev, struct net_device *ndev, int *devno)
> +{
> + int ret;
> + struct sh_eth_private *mdp = NULL;
> + struct resource res;
> +
> + mdp = netdev_priv(ndev);
> +
> + ret = of_address_to_resource(dev->of_node, 1, &res);
> + if (ret) {
> + dev_err(dev, "could not determine device base address\n");
> + return -EINVAL;
> + }
> +
> + mdp->tsu_addr = ioremap(res.start, resource_size(&res));
> + if (mdp->addr == NULL) {
> + dev_err(dev, "ioremap failed.\n");
> + return -ENOMEM;
> + }
> +
> + mdp->port = (*devno) % 2;
> + ndev->features = NETIF_F_HW_VLAN_FILTER;
> +
> + return 0;
> +}
> +#else
> +static struct sh_eth_plat_data *
> +sh_eth_parse_dt(struct device *dev, struct net_device *ndev, int *devno)
> +{
> + return NULL;
> +}
> +static int
> +sh_eth_parse_dt_tmu(struct device *dev, struct net_device *ndev)
> +{
> + return -ENOSYS;
> +}
> +#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;
> -
> - /* 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;
> - }
> + struct device_node *np = pdev->dev.of_node;
>
> ndev = alloc_etherdev(sizeof(struct sh_eth_private));
> if (!ndev) {
> @@ -2369,41 +2515,63 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
> goto out;
> }
>
> - /* The sh Ether-specific entries in the device structure. */
> - ndev->base_addr = res->start;
> - devno = pdev->id;
> - if (devno < 0)
> - devno = 0;
> + /* Fill in the fields of the device structure with ethernet values. */
> + ether_setup(ndev);
>
> - ndev->dma = -1;
> - ret = platform_get_irq(pdev, 0);
> - if (ret < 0) {
> - ret = -ENODEV;
> - goto out_release;
> + mdp = netdev_priv(ndev);
> +
> + if (np && of_device_is_available(np)) {
> + pd = sh_eth_parse_dt(&pdev->dev, ndev, &devno);
> + if (!pd) {
> + dev_err(&pdev->dev, "no setup data defined\n");
> + ret = -EINVAL;
> + goto out_release;
> + }
> + } else {
> + /* 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_release;
> + }
> +
> + /* The sh Ether-specific entries in the device structure. */
> + ndev->base_addr = res->start;
> + devno = pdev->id;
> + if (devno < 0)
> + devno = 0;
> +
> + ndev->dma = -1;
> + ret = platform_get_irq(pdev, 0);
> + if (ret < 0) {
> + ret = -ENODEV;
> + goto out_release;
> + }
> + ndev->irq = ret;
> +
> + mdp->addr = ioremap(res->start, resource_size(res));
> + if (mdp->addr == NULL) {
> + ret = -ENOMEM;
> + dev_err(&pdev->dev, "ioremap failed.\n");
> + goto out_release;
> + }
> +
> + pd = (struct sh_eth_plat_data *)(pdev->dev.platform_data);
> }
> - ndev->irq = ret;
>
> - SET_NETDEV_DEV(ndev, &pdev->dev);
> + ndev->dma = -1;
>
> - /* Fill in the fields of the device structure with ethernet values. */
> - ether_setup(ndev);
> + SET_NETDEV_DEV(ndev, &pdev->dev);
>
> - 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;
> - dev_err(&pdev->dev, "ioremap failed.\n");
> - goto out_release;
> - }
>
> 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 +2580,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,22 +2599,24 @@ 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,
> + if (np) {
> + ret = sh_eth_parse_dt_tmu(&pdev->dev, ndev, &devno);
> + if (ret)
> + goto out_release;
> + } else {
> + struct resource *rtsu;
> + rtsu = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> + if (!rtsu) {
> + dev_err(&pdev->dev, "Not found TSU resource\n");
> + goto out_release;
> + }
> + mdp->tsu_addr = ioremap(rtsu->start,
> resource_size(rtsu));
> - mdp->port = devno % 2;
> - ndev->features = NETIF_F_HW_VLAN_FILTER;
> + mdp->port = devno % 2;
> + ndev->features = NETIF_F_HW_VLAN_FILTER;
> + }
> }
>
> /* initialize first or needed device */
> @@ -2527,12 +2699,19 @@ static struct dev_pm_ops sh_eth_dev_pm_ops = {
> .runtime_resume = sh_eth_runtime_nop,
> };
>
> +static struct of_device_id sh_eth_match[] = {
> + { .compatible = "renesas,sh-eth",},
> + {},
> +};
> +MODULE_DEVICE_TABLE(of, sh_eth_match);
> +
> 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,
> + .of_match_table = 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 2/2] net: sh-eth: Use pr_err instead of printk
From: Simon Horman @ 2013-01-28 1:26 UTC (permalink / raw)
To: Nobuhiro Iwamatsu; +Cc: netdev, David Miller, linux-sh
In-Reply-To: <1350350279-8693-2-git-send-email-nobuhiro.iwamatsu.yj@renesas.com>
[Cc David Miller, linux-sh]
On Tue, Oct 16, 2012 at 10:17:59AM +0900, Nobuhiro Iwamatsu wrote:
> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Dave, I know this is an oldie, but it appears to still be a goodie.
Could you consider it for 3.8?
> ---
> drivers/net/ethernet/renesas/sh_eth.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
> index 756d87e..ba97a45 100644
> --- a/drivers/net/ethernet/renesas/sh_eth.c
> +++ b/drivers/net/ethernet/renesas/sh_eth.c
> @@ -598,7 +598,7 @@ static int sh_eth_check_reset(struct net_device *ndev)
> cnt--;
> }
> if (cnt < 0) {
> - printk(KERN_ERR "Device reset fail\n");
> + pr_err("Device reset fail\n");
> ret = -ETIMEDOUT;
> }
> return ret;
> @@ -2329,7 +2329,7 @@ static const u16 *sh_eth_get_register_offset(int register_type)
> reg_offset = sh_eth_offset_fast_sh3_sh2;
> break;
> default:
> - printk(KERN_ERR "Unknown register type (%d)\n", register_type);
> + pr_err("Unknown register type (%d)\n", register_type);
> break;
> }
>
> --
> 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 2/2] net: sh-eth: Use pr_err instead of printk
From: David Miller @ 2013-01-28 1:28 UTC (permalink / raw)
To: horms; +Cc: nobuhiro.iwamatsu.yj, netdev, linux-sh
In-Reply-To: <20130128012640.GB27896@verge.net.au>
From: Simon Horman <horms@verge.net.au>
Date: Mon, 28 Jan 2013 10:26:40 +0900
> [Cc David Miller, linux-sh]
>
> On Tue, Oct 16, 2012 at 10:17:59AM +0900, Nobuhiro Iwamatsu wrote:
>> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
>
> Acked-by: Simon Horman <horms+renesas@verge.net.au>
>
> Dave, I know this is an oldie, but it appears to still be a goodie.
> Could you consider it for 3.8?
Why would I consider it for 3.8? We're in critical-but-fix-only
state and this just modifies kernel log messages in what should
be rare error paths, so entirely not appropriate for 3.8
^ permalink raw reply
* Re: [Patch net-next 2/2] netpoll: use the net namespace of current process instead of init_net
From: Cong Wang @ 2013-01-28 1:36 UTC (permalink / raw)
To: Eric W. Biederman; +Cc: netdev, David S. Miller
In-Reply-To: <87k3qz6w8x.fsf@xmission.com>
On Sat, 2013-01-26 at 21:16 -0800, Eric W. Biederman wrote:
> Cong Wang <amwang@redhat.com> writes:
>
> > On Wed, 2013-01-23 at 17:02 +0800, Cong Wang wrote:
> >> From: Cong Wang <amwang@redhat.com>
> >>
> >> This will allow us to setup netconsole in a different namespace
> >> rather than where init_net is.
> >>
> >
> > Hmm, I missed to put the netns in netpoll_cleanup()...
> >
> > Will send v2.
>
> Since you are working on it. I forgot to mention that it doesn't
> look you were working with nsproxy properly. The code just felt
> very different from every other nsproxy reference I have seen.
>
> Looking more closely since you are looking at current you don't need
> to test to see if nsproxy is NULL. You can just say.
>
> - if (np->dev_name)
> - ndev = __dev_get_by_name(&init_net, np->dev_name);
> + if (np->dev_name) {
> + net = current->nsproxy->net_ns;
> + ndev = __dev_get_by_name(net, np->dev_name);
> + }
>
> task_nsproxy and get_net are needed when you are accessing another
> tasks nsproxy. Since you are just accessing current the code
> can be much simpler.
Ok.
>
> Which also means that you shouldn't need to get a reference to
> the network namespace or put the reference to the network namespace.
> Although you do need to handle things like network device hotplug
> in case the network device (or equivalently for most purposes) the
> network namespace goes away.
I believe we already handle NETDEV_UNREGISTER.
Thanks!
^ permalink raw reply
* Re: [patch] qlcnic: silence false positive overflow warning
From: David Miller @ 2013-01-28 1:38 UTC (permalink / raw)
To: dan.carpenter
Cc: jitendra.kalsaria, sony.chacko, linux-driver, netdev,
kernel-janitors
In-Reply-To: <20130125064141.GB4882@elgon.mountain>
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Fri, 25 Jan 2013 09:41:42 +0300
> We actually store the MAC address as well as the board_name here. The
> longest board_name is 75 characters so there is more than enough room
> to hold the 17 character MAC and the ": " divider. But making this
> buffer larger silences a static checker warning.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
This patch doesn't apply cleanly to any of my trees.
^ permalink raw reply
* Re: [patch] irda: buffer overflow in irnet_ctrl_read()
From: David Miller @ 2013-01-28 1:39 UTC (permalink / raw)
To: dan.carpenter; +Cc: samuel, netdev, kernel-janitors
In-Reply-To: <20130125064056.GA4882@elgon.mountain>
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Fri, 25 Jan 2013 09:40:56 +0300
> The comments here say that the /* Max event is 61 char */ but in 2003 we
> changed the event format and now the max event size is 75. The longest
> event is:
>
> "Discovered %08x (%s) behind %08x {hints %02X-%02X}\n",
> 12345678901 23 456789012 34567890 1 2 3
> +8 +21 +8 +2 +2 +1
> = 75 characters.
>
> There was a check to return -EOVERFLOW if the user gave us a "count"
> value that was less than 64. Raising it to 75 might break backwards
> compatability. Instead I removed the check and now it returns a
> truncated string if "count" is too low.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied to net-next, thanks.
^ permalink raw reply
* Re: [PATCH 2/2] net: sh-eth: Use pr_err instead of printk
From: Simon Horman @ 2013-01-28 1:41 UTC (permalink / raw)
To: David Miller; +Cc: nobuhiro.iwamatsu.yj, netdev, linux-sh
In-Reply-To: <20130127.202855.2183638663551956921.davem@davemloft.net>
On Sun, Jan 27, 2013 at 08:28:55PM -0500, David Miller wrote:
> From: Simon Horman <horms@verge.net.au>
> Date: Mon, 28 Jan 2013 10:26:40 +0900
>
> > [Cc David Miller, linux-sh]
> >
> > On Tue, Oct 16, 2012 at 10:17:59AM +0900, Nobuhiro Iwamatsu wrote:
> >> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
> >
> > Acked-by: Simon Horman <horms+renesas@verge.net.au>
> >
> > Dave, I know this is an oldie, but it appears to still be a goodie.
> > Could you consider it for 3.8?
>
> Why would I consider it for 3.8? We're in critical-but-fix-only
> state and this just modifies kernel log messages in what should
> be rare error paths, so entirely not appropriate for 3.8
Sorry, I'll repost it for 3.9 at a later date.
^ permalink raw reply
* [PATCH] [PATCH] tcp: Increment of LINUX_MIB_LISTENOVERFLOWS in tcp_v4_conn_request() (updated)
From: Nivedita Singhvi @ 2013-01-28 1:45 UTC (permalink / raw)
To: netdev, David Miller; +Cc: Vijay Subramanian, Nivedita Singhvi
From: Nivedita Singhvi <niv@us.ibm.com>
We drop a connection request if the accept backlog is full and there are
sufficient packets in the syn queue to warrant starting drops. Increment the
appropriate counter so this isn't silent, for accurate stats and help in
debugging.
Signed-off-by: Nivedita Singhvi <niv@us.ibm.com>
---
net/ipv4/tcp_ipv4.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index bbbdcc5..49b4f50 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1502,8 +1502,10 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
* clogging syn queue with openreqs with exponentially increasing
* timeout.
*/
- if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1)
+ if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) {
+ NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENOVERFLOWS);
goto drop;
+ }
req = inet_reqsk_alloc(&tcp_request_sock_ops);
if (!req)
--
1.7.5.4
^ permalink raw reply related
* [Patch net-next v2 1/2] netpoll: use ipv6_addr_equal() to compare ipv6 addr
From: Cong Wang @ 2013-01-28 1:55 UTC (permalink / raw)
To: netdev; +Cc: David S. Miller, Cong Wang
From: Cong Wang <amwang@redhat.com>
ipv6_addr_equal() is faster.
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
---
net/core/netpoll.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index e2f79a1..a6f39b6 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -635,7 +635,7 @@ static void netpoll_neigh_reply(struct sk_buff *skb, struct netpoll_info *npinfo
spin_lock_irqsave(&npinfo->rx_lock, flags);
list_for_each_entry_safe(np, tmp, &npinfo->rx_np, rx) {
- if (memcmp(daddr, &np->local_ip, sizeof(*daddr)))
+ if (!ipv6_addr_equal(daddr, &np->local_ip.in6))
continue;
hlen = LL_RESERVED_SPACE(np->dev);
@@ -828,9 +828,9 @@ int __netpoll_rx(struct sk_buff *skb, struct netpoll_info *npinfo)
if (udp6_csum_init(skb, uh, IPPROTO_UDP))
goto out;
list_for_each_entry_safe(np, tmp, &npinfo->rx_np, rx) {
- if (memcmp(&np->local_ip.in6, &ip6h->daddr, sizeof(struct in6_addr)) != 0)
+ if (!ipv6_addr_equal(&np->local_ip.in6, &ip6h->daddr))
continue;
- if (memcmp(&np->remote_ip.in6, &ip6h->saddr, sizeof(struct in6_addr)) != 0)
+ if (!ipv6_addr_equal(&np->remote_ip.in6, &ip6h->saddr))
continue;
if (np->local_port && np->local_port != ntohs(uh->dest))
continue;
--
1.7.7.6
^ permalink raw reply related
* [Patch net-next v2 2/2] netpoll: use the net namespace of current process instead of init_net
From: Cong Wang @ 2013-01-28 1:55 UTC (permalink / raw)
To: netdev; +Cc: Eric W. Biederman, David S. Miller, Cong Wang
In-Reply-To: <1359338121-10897-1-git-send-email-amwang@redhat.com>
From: Cong Wang <amwang@redhat.com>
This will allow us to setup netconsole in a different namespace
rather than where init_net is.
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
---
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index a6f39b6..331ccb9 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -1049,8 +1049,10 @@ int netpoll_setup(struct netpoll *np)
int err;
rtnl_lock();
- if (np->dev_name)
- ndev = __dev_get_by_name(&init_net, np->dev_name);
+ if (np->dev_name) {
+ struct net *net = current->nsproxy->net_ns;
+ ndev = __dev_get_by_name(net, np->dev_name);
+ }
if (!ndev) {
np_err(np, "%s doesn't exist, aborting\n", np->dev_name);
err = -ENODEV;
^ permalink raw reply related
* [PATCH] SCTP: Free the per-net sysctl table on net exit.
From: Eric W. Biederman @ 2013-01-28 1:58 UTC (permalink / raw)
To: David Miller; +Cc: vyasevich, netdev, linux-sctp, mmokrejs
In-Reply-To: <20130127.193511.2294954038548420781.davem@davemloft.net>
Per-net sysctl table needs to be explicitly freed at
net exit. Otherwise we see the following with kmemleak:
unreferenced object 0xffff880402d08000 (size 2048):
comm "chrome_sandbox", pid 18437, jiffies 4310887172 (age 9097.630s)
hex dump (first 32 bytes):
b2 68 89 81 ff ff ff ff 20 04 04 f8 01 88 ff ff .h...... .......
04 00 00 00 a4 01 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<ffffffff815b4aad>] kmemleak_alloc+0x21/0x3e
[<ffffffff81110352>] slab_post_alloc_hook+0x28/0x2a
[<ffffffff81113fad>] __kmalloc_track_caller+0xf1/0x104
[<ffffffff810f10c2>] kmemdup+0x1b/0x30
[<ffffffff81571e9f>] sctp_sysctl_net_register+0x1f/0x72
[<ffffffff8155d305>] sctp_net_init+0x100/0x39f
[<ffffffff814ad53c>] ops_init+0xc6/0xf5
[<ffffffff814ad5b7>] setup_net+0x4c/0xd0
[<ffffffff814ada5e>] copy_net_ns+0x6d/0xd6
[<ffffffff810938b1>] create_new_namespaces+0xd7/0x147
[<ffffffff810939f4>] copy_namespaces+0x63/0x99
[<ffffffff81076733>] copy_process+0xa65/0x1233
[<ffffffff81077030>] do_fork+0x10b/0x271
[<ffffffff8100a0e9>] sys_clone+0x23/0x25
[<ffffffff815dda73>] stub_clone+0x13/0x20
[<ffffffffffffffff>] 0xffffffffffffffff
I fixed the spelling of sysctl_header so the code actually
compiles. -- EWB.
Reported-by: Martin Mokrejs <mmokrejs@fold.natur.cuni.cz>
Signed-off-by: Vlad Yasevich <vyasevich@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
net/sctp/sysctl.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c
index 043889a..cd5712f 100644
--- a/net/sctp/sysctl.c
+++ b/net/sctp/sysctl.c
@@ -366,7 +366,11 @@ int sctp_sysctl_net_register(struct net *net)
void sctp_sysctl_net_unregister(struct net *net)
{
+ struct ctl_table *table;
+
+ table = net->sctp.sysctl_hdr->ctl_table_arg;
unregister_net_sysctl_table(net->sctp.sysctl_header);
+ kfree(table);
}
static struct ctl_table_header * sctp_sysctl_header;
--
1.7.5.4
^ permalink raw reply related
* Re: [PATCH] [PATCH] tcp: Increment of LINUX_MIB_LISTENOVERFLOWS in tcp_v4_conn_request() (updated)
From: Vijay Subramanian @ 2013-01-28 2:01 UTC (permalink / raw)
To: Nivedita Singhvi; +Cc: netdev, David Miller, Nivedita Singhvi
In-Reply-To: <1359337550-3958-1-git-send-email-niveditasinghvi@gmail.com>
On 27 January 2013 17:45, Nivedita Singhvi <niveditasinghvi@gmail.com> wrote:
> From: Nivedita Singhvi <niv@us.ibm.com>
>
> We drop a connection request if the accept backlog is full and there are
> sufficient packets in the syn queue to warrant starting drops. Increment the
> appropriate counter so this isn't silent, for accurate stats and help in
> debugging.
>
> Signed-off-by: Nivedita Singhvi <niv@us.ibm.com>
Acked-by: Vijay Subramanian <subramanian.vijay@gmail.com>
Thanks,
Vijay
^ permalink raw reply
* [Patch net-next] pktgen: use the net namespace of current process instead of init_net
From: Cong Wang @ 2013-01-28 2:33 UTC (permalink / raw)
To: netdev; +Cc: Eric W. Biederman, David S. Miller, Cong Wang
From: Cong Wang <amwang@redhat.com>
Use the net namespace of the current process loading
pktgen module.
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
---
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index b29dacf..db1f444 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -440,6 +440,7 @@ static int pg_count_d __read_mostly = 1000;
static int pg_delay_d __read_mostly;
static int pg_clone_skb_d __read_mostly;
static int debug __read_mostly;
+static struct net *pktgen_net __read_mostly;
static DEFINE_MUTEX(pktgen_thread_lock);
static LIST_HEAD(pktgen_threads);
@@ -1910,7 +1911,7 @@ static int pktgen_device_event(struct notifier_block *unused,
{
struct net_device *dev = ptr;
- if (!net_eq(dev_net(dev), &init_net) || pktgen_exiting)
+ if (!net_eq(dev_net(dev), pktgen_net) || pktgen_exiting)
return NOTIFY_DONE;
/* It is OK that we do not hold the group lock right now,
@@ -1944,7 +1945,7 @@ static struct net_device *pktgen_dev_get_by_name(struct pktgen_dev *pkt_dev,
}
b[i] = 0;
- return dev_get_by_name(&init_net, b);
+ return dev_get_by_name(pktgen_net, b);
}
@@ -2205,7 +2206,7 @@ static void get_ipsec_sa(struct pktgen_dev *pkt_dev, int flow)
struct xfrm_state *x = pkt_dev->flows[flow].x;
if (!x) {
/*slow path: we dont already have xfrm_state*/
- x = xfrm_stateonly_find(&init_net, DUMMY_MARK,
+ x = xfrm_stateonly_find(pktgen_net, DUMMY_MARK,
(xfrm_address_t *)&pkt_dev->cur_daddr,
(xfrm_address_t *)&pkt_dev->cur_saddr,
AF_INET,
@@ -3600,7 +3601,8 @@ static int __init pg_init(void)
pr_info("%s", version);
- pg_proc_dir = proc_mkdir(PG_PROC_DIR, init_net.proc_net);
+ pktgen_net = current->nsproxy->net_ns;
+ pg_proc_dir = proc_mkdir(PG_PROC_DIR, pktgen_net->proc_net);
if (!pg_proc_dir)
return -ENODEV;
@@ -3634,7 +3636,7 @@ static int __init pg_init(void)
unregister_netdevice_notifier(&pktgen_notifier_block);
remove_proc_entry(PGCTRL, pg_proc_dir);
remove_dir:
- proc_net_remove(&init_net, PG_PROC_DIR);
+ proc_net_remove(pktgen_net, PG_PROC_DIR);
return ret;
}
^ permalink raw reply related
* Re: [Patch net-next] pktgen: use the net namespace of current process instead of init_net
From: Eric W. Biederman @ 2013-01-28 2:48 UTC (permalink / raw)
To: Cong Wang; +Cc: netdev, David S. Miller
In-Reply-To: <1359340387-18004-1-git-send-email-amwang@redhat.com>
Cong Wang <amwang@redhat.com> writes:
> From: Cong Wang <amwang@redhat.com>
>
> Use the net namespace of the current process loading
> pktgen module.
Why not add proper support for multiple network namespaces?
It looks like the proc files could be created in each network namespace
and be controlled from there.
Your patch below looks like it could have some unintended effects
if pktgen was loaded automatically or compiled into the kernel.
Eric
> Cc: Eric W. Biederman <ebiederm@xmission.com>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <amwang@redhat.com>
>
> ---
> diff --git a/net/core/pktgen.c b/net/core/pktgen.c
> index b29dacf..db1f444 100644
> --- a/net/core/pktgen.c
> +++ b/net/core/pktgen.c
> @@ -440,6 +440,7 @@ static int pg_count_d __read_mostly = 1000;
> static int pg_delay_d __read_mostly;
> static int pg_clone_skb_d __read_mostly;
> static int debug __read_mostly;
> +static struct net *pktgen_net __read_mostly;
>
> static DEFINE_MUTEX(pktgen_thread_lock);
> static LIST_HEAD(pktgen_threads);
> @@ -1910,7 +1911,7 @@ static int pktgen_device_event(struct notifier_block *unused,
> {
> struct net_device *dev = ptr;
>
> - if (!net_eq(dev_net(dev), &init_net) || pktgen_exiting)
> + if (!net_eq(dev_net(dev), pktgen_net) || pktgen_exiting)
> return NOTIFY_DONE;
>
> /* It is OK that we do not hold the group lock right now,
> @@ -1944,7 +1945,7 @@ static struct net_device *pktgen_dev_get_by_name(struct pktgen_dev *pkt_dev,
> }
> b[i] = 0;
>
> - return dev_get_by_name(&init_net, b);
> + return dev_get_by_name(pktgen_net, b);
> }
>
>
> @@ -2205,7 +2206,7 @@ static void get_ipsec_sa(struct pktgen_dev *pkt_dev, int flow)
> struct xfrm_state *x = pkt_dev->flows[flow].x;
> if (!x) {
> /*slow path: we dont already have xfrm_state*/
> - x = xfrm_stateonly_find(&init_net, DUMMY_MARK,
> + x = xfrm_stateonly_find(pktgen_net, DUMMY_MARK,
> (xfrm_address_t *)&pkt_dev->cur_daddr,
> (xfrm_address_t *)&pkt_dev->cur_saddr,
> AF_INET,
> @@ -3600,7 +3601,8 @@ static int __init pg_init(void)
>
> pr_info("%s", version);
>
> - pg_proc_dir = proc_mkdir(PG_PROC_DIR, init_net.proc_net);
> + pktgen_net = current->nsproxy->net_ns;
> + pg_proc_dir = proc_mkdir(PG_PROC_DIR, pktgen_net->proc_net);
> if (!pg_proc_dir)
> return -ENODEV;
>
> @@ -3634,7 +3636,7 @@ static int __init pg_init(void)
> unregister_netdevice_notifier(&pktgen_notifier_block);
> remove_proc_entry(PGCTRL, pg_proc_dir);
> remove_dir:
> - proc_net_remove(&init_net, PG_PROC_DIR);
> + proc_net_remove(pktgen_net, PG_PROC_DIR);
> return ret;
> }
>
^ permalink raw reply
* Re: Doubts about listen backlog and tcp_max_syn_backlog
From: Nivedita Singhvi @ 2013-01-28 2:48 UTC (permalink / raw)
To: Leandro Lucarella; +Cc: Rick Jones, Eric Dumazet, netdev, linux-kernel
In-Reply-To: <20130125100525.GE4608@sociomantic.com>
On 01/25/2013 02:05 AM, Leandro Lucarella wrote:
> On Thu, Jan 24, 2013 at 10:12:46PM -0800, Nivedita SInghvi wrote:
>>>>> I was just kind of quoting the name given by netstat: "SYNs to LISTEN
>>>>> sockets dropped" (for kernel 3.0, I noticed newer kernels don't have
>>>>> this stat anymore, or the name was changed). I still don't know if we
>>>>> are talking about the same thing.
>>>>
>> [snip]
>>>> I will sometimes be tripped-up by netstat's not showing a statistic
>>>> with a zero value...
>>
>> Leandro, you should be able to do an nstat -z, it will print all
>> counters even if zero. You should see something like so:
>>
>> ipv4]> nstat -z
>> #kernel
>> IpInReceives 2135 0.0
>> IpInHdrErrors 0 0.0
>> IpInAddrErrors 202 0.0
>> ...
>>
>> You might want to take a look at those (your pkts may not even be
>> making it to tcp) and these in particular:
>>
>> TcpExtSyncookiesSent 0 0.0
>> TcpExtSyncookiesRecv 0 0.0
>> TcpExtSyncookiesFailed 0 0.0
>> TcpExtListenOverflows 0 0.0
>> TcpExtListenDrops 0 0.0
>> TcpExtTCPBacklogDrop 0 0.0
>> TcpExtTCPMinTTLDrop 0 0.0
>> TcpExtTCPDeferAcceptDrop 0 0.0
>>
>> If you don't have nstat on that version for some reason, download the
>> latest iproute pkg. Looking at the counter names is a lot more helpful
>> and precise than the netstat converstion to human consumption.
>
> Thanks, but what about this?
>
> pc2 $ nstat -z | grep -i drop
> TcpExtLockDroppedIcmps 0 0.0
> TcpExtListenDrops 0 0.0
> TcpExtTCPPrequeueDropped 0 0.0
> TcpExtTCPBacklogDrop 0 0.0
> TcpExtTCPMinTTLDrop 0 0.0
> TcpExtTCPDeferAcceptDrop 0 0.0
That seems bogus.
> pc2 $ netstat -s | grep -i drop
> 470 outgoing packets dropped
> 5659740 SYNs to LISTEN sockets dropped
>
> Is this normal?
That's a lot ofconnect requests dropped, but it depends on how
long you've been up and how much traffic you've seen.
Hmm...you were on an older Ubuntu, right? The netstat source
was patched to translate it as follows:
+ { "ListenDrops", N_("%u SYNs to LISTEN sockets dropped"), opt_number },
(see the file debian/patches/CVS-20081003-statistics.c_sync.patch
in the net-tools src)
i.e., the netstat pkg is printing the value of the TCPEXT MIB counter
that's counting TCPExtListenDrops.
Theoretically, that number should be the same as that printed by nstat,
as they are getting it from the same kernel stats counter. I have not
looked at nstat code (I actually almost always dump the counters from
/proc/net/{netstat + snmp} via a simple prettyprint script (will send
you that offline).
If the nstat and netstat counters don't match, something is fishy.
That nstat output is broken.
>>> Yes, I already did captures and we are definitely loosing packets
>>> (including SYNs), but it looks like the amount of SYNs I'm loosing is
>>> lower than the amount of long connect() times I observe. This is not
>>> confirmed yet, I'm still investigating.
>>
>> Where did you narrow down the drop to? There are quite a few places in
>> the networking stack we silently drop packets (such as the one pointed
>> out earlier in this thread), although they should almost all be
>> extremely low probability/NEVER type events. Do you want a patch to
>> gap the most likely scenario? (I'll post that to netdev separately).
>
> Even when that would be awesome, unfortunately there is no way I could
> get permission to run a patched kernel (or even restart the servers for
> that matter).
>
> And I don't know how could I narrow down the drops in any way. What I
> know is capturing traffic with tcpdump, I see some packets leaving one
> server but never arriving to the new one.
Hmm..do you have a switch between your two end points dropping pkts?
Could be.. Basically, by looking at the statistics kept by each layer, you
should be able to narrow it down a little bit at least.
It does still sound like some drops are occurring in TCP due to accept
backlog being full and you're overrunning TCP incoming processing (or
at least this contributing), going by that ListenDrops count.
> Also, the hardware is not great either, I'm not sure is not responsible
> for the loss. There are some errors reported by ethtool, but I don't
> know exactly what they mean:
>
> # ethtool -S eth0
> NIC statistics:
> tx_packets: 336978308273
> rx_packets: 384108075585
> tx_errors: 0
> rx_errors: 194
> rx_missed: 1119
> align_errors: 31731
> tx_single_collisions: 0
> tx_multi_collisions: 0
> unicast: 384108023754
> broadcast: 51825
> multicast: 6
> tx_aborted: 0
> tx_underrun: 0
>
> Thanks!
>
You aren't suffering a lot of packet loss at the NIC.
Sorry, I'm on the road, travelling, and likely not online much this week.
thanks,
Nivedita
^ permalink raw reply
* Re: [PATCH] checkpatch.pl: Fix warnings on code comments
From: Jeff Kirsher @ 2013-01-28 2:56 UTC (permalink / raw)
To: David Miller; +Cc: apw, linux-kernel, netdev
In-Reply-To: <20130127.185910.1743425400733006443.davem@davemloft.net>
[-- Attachment #1: Type: text/plain, Size: 1259 bytes --]
On Sun, 2013-01-27 at 18:59 -0500, David Miller wrote:
> From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> Date: Sun, 27 Jan 2013 03:35:39 -0800
>
> > Produces warnings on code comments which follow the Linux coding style
> > guide. While the desired code comment style for networking my differ
> > from the rest of the kernel, both styles should be permitted.
>
> I was actually going to mention to you guys that I've been lackadasical
> about enforcing the comment style I want with the Intel drivers.
>
> That was a mistake, I should have enforced it strictly, as I do for
> the other drivers and the core networking code, from the beginning.
>
> And it's clearly a mistake if you feel the need to take out the very
> checkpatch working that's meant to enforce this comment style in all
> of the networking drivers and core.
>
> Do not revert this, follow it's advice instead.
Ok, I am fine with that. I just had not seen any emails/responses that
this was direction you wanted to go.
So will you be fine with cleanup patches which go through and convert
all the existing code comments to the desired format? If so, I will get
started on patches to cleanup,convert the Intel drivers to the desired
code comment style.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: [Patch net-next] pktgen: use the net namespace of current process instead of init_net
From: Cong Wang @ 2013-01-28 2:57 UTC (permalink / raw)
To: Eric W. Biederman; +Cc: netdev, David S. Miller
In-Reply-To: <87mwvu10rj.fsf@xmission.com>
On Sun, 2013-01-27 at 18:48 -0800, Eric W. Biederman wrote:
> Cong Wang <amwang@redhat.com> writes:
>
> > From: Cong Wang <amwang@redhat.com>
> >
> > Use the net namespace of the current process loading
> > pktgen module.
>
> Why not add proper support for multiple network namespaces?
>
> It looks like the proc files could be created in each network namespace
> and be controlled from there.
Hmm, I didn't think much about this. You are right... we could probably
make these proc files per-net.
>
> Your patch below looks like it could have some unintended effects
> if pktgen was loaded automatically or compiled into the kernel.
>
In this case, 'current' should be the init process whose net namespace
is init_net, no?
Thanks.
^ permalink raw reply
* Re: [net-next 00/14][pull request] Intel Wired LAN Driver Updates 2013.01.27
From: Jeff Kirsher @ 2013-01-28 3:00 UTC (permalink / raw)
To: David Miller; +Cc: netdev, gospo, sassmann, bruce.w.allan
In-Reply-To: <20130127.190748.404517979856325333.davem@davemloft.net>
[-- Attachment #1: Type: text/plain, Size: 1581 bytes --]
On Sun, 2013-01-27 at 19:07 -0500, David Miller wrote:
> From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> Date: Sun, 27 Jan 2013 02:39:39 -0800
>
> > This series contains updates to e1000e only. All the updates come
> > from Bruce Allan and most of the patch fix or enable features on
> > i217/i218. Most notably is patch 03 "e1000e: add support for IEEE-1588
> > PTP", which is v2 of the patch based on feedback from Stephen Hemminger.
> >
> > Also patch 04 "e1000e: enable ECC on I217/I218 to catch packet buffer
> > memory errors" should be queued up for stable (as well as net) trees, but
> > the patch does not apply cleanly to either of those trees currently.
> > So I will work with Bruce to provide a version of the patch which will
> > apply cleanly to net (and stable) and we can queue it up at that point
> > for stable 3.5 tree.
> >
> > The remaining patches are general cleanups of the code.
>
> Thanks, please provide more commentary like this in future
> pull requests, it helps me a lot and it does get added to the
> merge commit I make when I pull from your tree.
Your right, I have been neglectful in doing this and will be more
verbose in future pull requests. Thanks Dave!
>
> >
> > The following are changes since commit 031554eab078705edb96e9a39665597e3fd22781:
> > Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next
> > and are available in the git repository at:
> > git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master
>
> Pulled, thanks Jeff.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: [PATCH] checkpatch.pl: Fix warnings on code comments
From: David Miller @ 2013-01-28 3:07 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: apw, linux-kernel, netdev
In-Reply-To: <1359341805.2255.56.camel@jtkirshe-mobl>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Sun, 27 Jan 2013 18:56:45 -0800
> So will you be fine with cleanup patches which go through and
> convert all the existing code comments to the desired format?
Sure.
^ permalink raw reply
* Re: [PATCH] vhost-net: fall back to vmalloc if high-order allocation fails
From: David Miller @ 2013-01-28 3:11 UTC (permalink / raw)
To: mst; +Cc: romain, kvm, netdev, linux-kernel
In-Reply-To: <20130123210411.GA9055@redhat.com>
From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Wed, 23 Jan 2013 23:04:11 +0200
> Maybe we should try and reduce our memory usage,
> I will look into this.
As has been pointed out, 32K of the size is from those iovecs in
the queues.
The size of this structure is frankly offensive, and even if you add
some levels of indirection even just one iovec chunk is 16K on 64-bit
which is in my opinion still unacceptably large.
TCP sockets aren't even %25 the size of this beast. :-)
I'm not going to apply this vmalloc patch, because if I apply it the
fundamental problem here just gets swept under the carpet even longer.
Sorry.
^ permalink raw reply
* Re: [Patch net-next] pktgen: use the net namespace of current process instead of init_net
From: Cong Wang @ 2013-01-28 3:13 UTC (permalink / raw)
To: Eric W. Biederman; +Cc: netdev, David S. Miller
In-Reply-To: <1359341852.20444.10.camel@cr0>
On Mon, 2013-01-28 at 10:57 +0800, Cong Wang wrote:
>
> Hmm, I didn't think much about this. You are right... we could probably
> make these proc files per-net.
Cooking a patch now.
^ permalink raw reply
* Re: [Patch net-next] pktgen: use the net namespace of current process instead of init_net
From: Eric W. Biederman @ 2013-01-28 3:13 UTC (permalink / raw)
To: Cong Wang; +Cc: netdev, David S. Miller
In-Reply-To: <1359341852.20444.10.camel@cr0>
Cong Wang <amwang@redhat.com> writes:
> On Sun, 2013-01-27 at 18:48 -0800, Eric W. Biederman wrote:
>> Cong Wang <amwang@redhat.com> writes:
>>
>> > From: Cong Wang <amwang@redhat.com>
>> >
>> > Use the net namespace of the current process loading
>> > pktgen module.
>>
>> Why not add proper support for multiple network namespaces?
>>
>> It looks like the proc files could be created in each network namespace
>> and be controlled from there.
>
> Hmm, I didn't think much about this. You are right... we could probably
> make these proc files per-net.
>> Your patch below looks like it could have some unintended effects
>> if pktgen was loaded automatically or compiled into the kernel.
>>
>
> In this case, 'current' should be the init process whose net namespace
> is init_net, no?
If it is a kernel thread that decided to load the module. If it
something else who knows. To my knowledge there are no guarantees
and I'm not particularly interested in having to worry about current
making sense in a module.
Eric
^ permalink raw reply
* [PATCH] SCTP: Free the per-net sysctl table on net exit. v2
From: Eric W. Biederman @ 2013-01-28 3:25 UTC (permalink / raw)
To: David Miller; +Cc: vyasevich, netdev, linux-sctp, mmokrejs
In-Reply-To: <87libe3w69.fsf@xmission.com>
From: Vlad Yasevich <vyasevich@gmail.com>
Date: Thu, 24 Jan 2013 11:02:47 -0500
Per-net sysctl table needs to be explicitly freed at
net exit. Otherwise we see the following with kmemleak:
unreferenced object 0xffff880402d08000 (size 2048):
comm "chrome_sandbox", pid 18437, jiffies 4310887172 (age 9097.630s)
hex dump (first 32 bytes):
b2 68 89 81 ff ff ff ff 20 04 04 f8 01 88 ff ff .h...... .......
04 00 00 00 a4 01 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<ffffffff815b4aad>] kmemleak_alloc+0x21/0x3e
[<ffffffff81110352>] slab_post_alloc_hook+0x28/0x2a
[<ffffffff81113fad>] __kmalloc_track_caller+0xf1/0x104
[<ffffffff810f10c2>] kmemdup+0x1b/0x30
[<ffffffff81571e9f>] sctp_sysctl_net_register+0x1f/0x72
[<ffffffff8155d305>] sctp_net_init+0x100/0x39f
[<ffffffff814ad53c>] ops_init+0xc6/0xf5
[<ffffffff814ad5b7>] setup_net+0x4c/0xd0
[<ffffffff814ada5e>] copy_net_ns+0x6d/0xd6
[<ffffffff810938b1>] create_new_namespaces+0xd7/0x147
[<ffffffff810939f4>] copy_namespaces+0x63/0x99
[<ffffffff81076733>] copy_process+0xa65/0x1233
[<ffffffff81077030>] do_fork+0x10b/0x271
[<ffffffff8100a0e9>] sys_clone+0x23/0x25
[<ffffffff815dda73>] stub_clone+0x13/0x20
[<ffffffffffffffff>] 0xffffffffffffffff
I fixed the spelling of sysctl_header so the code actually
compiles. -- EWB.
Reported-by: Martin Mokrejs <mmokrejs@fold.natur.cuni.cz>
Signed-off-by: Vlad Yasevich <vyasevich@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
The typo is fixed in the patch this time in addition to my test
tree.
net/sctp/sysctl.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c
index 043889a..bf3c6e8 100644
--- a/net/sctp/sysctl.c
+++ b/net/sctp/sysctl.c
@@ -366,7 +366,11 @@ int sctp_sysctl_net_register(struct net *net)
void sctp_sysctl_net_unregister(struct net *net)
{
+ struct ctl_table *table;
+
+ table = net->sctp.sysctl_header->ctl_table_arg;
unregister_net_sysctl_table(net->sctp.sysctl_header);
+ kfree(table);
}
static struct ctl_table_header * sctp_sysctl_header;
--
1.7.5.4
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox