* Re: [PATCH 2/5] arm64: dts: APM X-Gene SoC Ethernet device tree nodes
From: Mark Salter @ 2014-01-24 17:01 UTC (permalink / raw)
To: Iyappan Subramanian
Cc: devicetree, jcm, gregkh, patches, linux-kernel, netdev,
Keyur Chudgar, davem, linux-arm-kernel, Ravi Patel
In-Reply-To: <1387597376-29303-3-git-send-email-isubramanian@apm.com>
On Fri, 2013-12-20 at 19:42 -0800, Iyappan Subramanian wrote:
> Device tree files for APM X-Gene SoC Ethernet.
>
> Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
> Signed-off-by: Ravi Patel <rapatel@apm.com>
> Signed-off-by: Keyur Chudgar <kchudgar@apm.com>
> ---
> arch/arm64/boot/dts/apm-mustang.dts | 8 ++++++++
> arch/arm64/boot/dts/apm-storm.dtsi | 19 +++++++++++++++++++
> 2 files changed, 27 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/apm-mustang.dts b/arch/arm64/boot/dts/apm-mustang.dts
> index 1247ca1..ccb2771 100644
> --- a/arch/arm64/boot/dts/apm-mustang.dts
> +++ b/arch/arm64/boot/dts/apm-mustang.dts
> @@ -17,6 +17,10 @@
> model = "APM X-Gene Mustang board";
> compatible = "apm,mustang", "apm,xgene-storm";
>
> + aliases {
> + ethernet0 = &menet;
> + };
> +
> chosen { };
>
> memory {
> @@ -24,3 +28,7 @@
> reg = < 0x1 0x00000000 0x0 0x80000000 >; /* Updated by bootloader */
> };
> };
> +
> +&menet {
> + status = "ok";
> +};
> diff --git a/arch/arm64/boot/dts/apm-storm.dtsi b/arch/arm64/boot/dts/apm-storm.dtsi
> index f64f946..9c7b8cd 100644
> --- a/arch/arm64/boot/dts/apm-storm.dtsi
> +++ b/arch/arm64/boot/dts/apm-storm.dtsi
> @@ -204,5 +204,24 @@
> #clock-cells = <1>;
> clocks = <&qmlclk 0>;
> };
> +
> + menet: ethernet@17020000 {
> + compatible = "apm,xgene-enet";
> + status = "disabled";
> + reg = <0x0 0x17020000 0x0 0x30>,
> + <0x0 0x17020000 0x0 0x10000>,
> + <0x0 0x17020000 0x0 0x20>;
> + slave-name = "RGMII";
> + interrupts = <0x0 0x38 0x4>,
> + <0x0 0x39 0x4>,
> + <0x0 0x3a 0x4>;
> + #clock-cells = <1>;
> + clocks = <ð8clk 0>;
> + local-mac-address = <0x0 0x11 0x3a 0x8a 0x5a 0x78>;
Shouldn't this be a byte string?:
local-mac-address = [ 00 11 3a 8a 5a 78 ];
> + max-frame-size = <0x233a>;
> + devid = <8>;
> + phyid = <3>;
> + phy-mode = "rgmii";
> + };
> };
> };
^ permalink raw reply
* Re: [README] bug fixes only...
From: Oliver Hartkopp @ 2014-01-24 16:35 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20140123.162408.681541949851852312.davem@davemloft.net>
Do you plan this fix after the net-next merge?
http://patchwork.ozlabs.org/patch/313483/
Regards,
Oliver
On 24.01.2014 01:24, David Miller wrote:
>
> I want to see zero feature and/or cleanup patches submitted at this
> time.
>
> net-next is now frozen and I'm going to let it sit for a day before
> I try to merge it to Linus.
>
> Thanks for your understanding.
> --
> 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: [Xen-devel] [PATCH v5] xen/grant-table: Avoid m2p_override during mapping
From: Stefano Stabellini @ 2014-01-24 14:48 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk
Cc: Zoltan Kiss, Stefano Stabellini, david.vrabel, boris.ostrovsky,
ian.campbell, wei.liu2, xen-devel, netdev, linux-kernel,
jonathan.davies
In-Reply-To: <20140124143711.GB12946@phenom.dumpdata.com>
On Fri, 24 Jan 2014, Konrad Rzeszutek Wilk wrote:
> On Thu, Jan 23, 2014 at 01:07:10PM +0000, Zoltan Kiss wrote:
> > The grant mapping API does m2p_override unnecessarily: only gntdev needs it,
> > for blkback and future netback patches it just cause a lock contention, as
> > those pages never go to userspace. Therefore this series does the following:
> > - the original functions were renamed to __gnttab_[un]map_refs, with a new
> > parameter m2p_override
> > - based on m2p_override either they follow the original behaviour, or just set
> > the private flag and call set_phys_to_machine
> > - gnttab_[un]map_refs are now a wrapper to call __gnttab_[un]map_refs with
> > m2p_override false
> > - a new function gnttab_[un]map_refs_userspace provides the old behaviour
> >
> > It also removes a stray space from page.h and change ret to 0 if
> > XENFEAT_auto_translated_physmap, as that is the only possible return value
> > there.
> >
> > v2:
> > - move the storing of the old mfn in page->index to gnttab_map_refs
> > - move the function header update to a separate patch
> >
> > v3:
> > - a new approach to retain old behaviour where it needed
> > - squash the patches into one
> >
> > v4:
> > - move out the common bits from m2p* functions, and pass pfn/mfn as parameter
> > - clear page->private before doing anything with the page, so m2p_find_override
> > won't race with this
> >
> > v5:
> > - change return value handling in __gnttab_[un]map_refs
> > - remove a stray space in page.h
> > - add detail why ret = 0 now at some places
> >
> > Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com>
> > Suggested-by: David Vrabel <david.vrabel@citrix.com>
>
> It looks OK to me and while it is not a bug-fix I think it should
> go for v3.14 - as it _should_ improve the backends.
>
> David or Boris; Stefano, please Ack/Nack it.
>
> Thank you.
I reviewed-by the v6 version of the patch
> > arch/x86/include/asm/xen/page.h | 12 +++--
> > arch/x86/xen/p2m.c | 25 ++--------
> > drivers/block/xen-blkback/blkback.c | 15 +++---
> > drivers/xen/gntdev.c | 13 +++--
> > drivers/xen/grant-table.c | 90 ++++++++++++++++++++++++++++++-----
> > include/xen/grant_table.h | 8 +++-
> > 6 files changed, 109 insertions(+), 54 deletions(-)
> >
> > diff --git a/arch/x86/include/asm/xen/page.h b/arch/x86/include/asm/xen/page.h
> > index b913915..68a1438 100644
> > --- a/arch/x86/include/asm/xen/page.h
> > +++ b/arch/x86/include/asm/xen/page.h
> > @@ -49,10 +49,14 @@ extern bool __set_phys_to_machine(unsigned long pfn, unsigned long mfn);
> > extern unsigned long set_phys_range_identity(unsigned long pfn_s,
> > unsigned long pfn_e);
> >
> > -extern int m2p_add_override(unsigned long mfn, struct page *page,
> > - struct gnttab_map_grant_ref *kmap_op);
> > +extern int m2p_add_override(unsigned long mfn,
> > + struct page *page,
> > + struct gnttab_map_grant_ref *kmap_op,
> > + unsigned long pfn);
> > extern int m2p_remove_override(struct page *page,
> > - struct gnttab_map_grant_ref *kmap_op);
> > + struct gnttab_map_grant_ref *kmap_op,
> > + unsigned long pfn,
> > + unsigned long mfn);
> > extern struct page *m2p_find_override(unsigned long mfn);
> > extern unsigned long m2p_find_override_pfn(unsigned long mfn, unsigned long pfn);
> >
> > @@ -121,7 +125,7 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn)
> > pfn = m2p_find_override_pfn(mfn, ~0);
> > }
> >
> > - /*
> > + /*
> > * pfn is ~0 if there are no entries in the m2p for mfn or if the
> > * entry doesn't map back to the mfn and m2p_override doesn't have a
> > * valid entry for it.
> > diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
> > index 2ae8699..0060178 100644
> > --- a/arch/x86/xen/p2m.c
> > +++ b/arch/x86/xen/p2m.c
> > @@ -872,15 +872,13 @@ static unsigned long mfn_hash(unsigned long mfn)
> >
> > /* Add an MFN override for a particular page */
> > int m2p_add_override(unsigned long mfn, struct page *page,
> > - struct gnttab_map_grant_ref *kmap_op)
> > + struct gnttab_map_grant_ref *kmap_op, unsigned long pfn)
> > {
> > unsigned long flags;
> > - unsigned long pfn;
> > unsigned long uninitialized_var(address);
> > unsigned level;
> > pte_t *ptep = NULL;
> >
> > - pfn = page_to_pfn(page);
> > if (!PageHighMem(page)) {
> > address = (unsigned long)__va(pfn << PAGE_SHIFT);
> > ptep = lookup_address(address, &level);
> > @@ -888,13 +886,6 @@ int m2p_add_override(unsigned long mfn, struct page *page,
> > "m2p_add_override: pfn %lx not mapped", pfn))
> > return -EINVAL;
> > }
> > - WARN_ON(PagePrivate(page));
> > - SetPagePrivate(page);
> > - set_page_private(page, mfn);
> > - page->index = pfn_to_mfn(pfn);
> > -
> > - if (unlikely(!set_phys_to_machine(pfn, FOREIGN_FRAME(mfn))))
> > - return -ENOMEM;
> >
> > if (kmap_op != NULL) {
> > if (!PageHighMem(page)) {
> > @@ -933,20 +924,15 @@ int m2p_add_override(unsigned long mfn, struct page *page,
> > }
> > EXPORT_SYMBOL_GPL(m2p_add_override);
> > int m2p_remove_override(struct page *page,
> > - struct gnttab_map_grant_ref *kmap_op)
> > + struct gnttab_map_grant_ref *kmap_op,
> > + unsigned long pfn,
> > + unsigned long mfn)
> > {
> > unsigned long flags;
> > - unsigned long mfn;
> > - unsigned long pfn;
> > unsigned long uninitialized_var(address);
> > unsigned level;
> > pte_t *ptep = NULL;
> >
> > - pfn = page_to_pfn(page);
> > - mfn = get_phys_to_machine(pfn);
> > - if (mfn == INVALID_P2M_ENTRY || !(mfn & FOREIGN_FRAME_BIT))
> > - return -EINVAL;
> > -
> > if (!PageHighMem(page)) {
> > address = (unsigned long)__va(pfn << PAGE_SHIFT);
> > ptep = lookup_address(address, &level);
> > @@ -959,10 +945,7 @@ int m2p_remove_override(struct page *page,
> > spin_lock_irqsave(&m2p_override_lock, flags);
> > list_del(&page->lru);
> > spin_unlock_irqrestore(&m2p_override_lock, flags);
> > - WARN_ON(!PagePrivate(page));
> > - ClearPagePrivate(page);
> >
> > - set_phys_to_machine(pfn, page->index);
> > if (kmap_op != NULL) {
> > if (!PageHighMem(page)) {
> > struct multicall_space mcs;
> > diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
> > index 6620b73..875025f 100644
> > --- a/drivers/block/xen-blkback/blkback.c
> > +++ b/drivers/block/xen-blkback/blkback.c
> > @@ -285,8 +285,7 @@ static void free_persistent_gnts(struct xen_blkif *blkif, struct rb_root *root,
> >
> > if (++segs_to_unmap == BLKIF_MAX_SEGMENTS_PER_REQUEST ||
> > !rb_next(&persistent_gnt->node)) {
> > - ret = gnttab_unmap_refs(unmap, NULL, pages,
> > - segs_to_unmap);
> > + ret = gnttab_unmap_refs(unmap, pages, segs_to_unmap);
> > BUG_ON(ret);
> > put_free_pages(blkif, pages, segs_to_unmap);
> > segs_to_unmap = 0;
> > @@ -321,8 +320,7 @@ static void unmap_purged_grants(struct work_struct *work)
> > pages[segs_to_unmap] = persistent_gnt->page;
> >
> > if (++segs_to_unmap == BLKIF_MAX_SEGMENTS_PER_REQUEST) {
> > - ret = gnttab_unmap_refs(unmap, NULL, pages,
> > - segs_to_unmap);
> > + ret = gnttab_unmap_refs(unmap, pages, segs_to_unmap);
> > BUG_ON(ret);
> > put_free_pages(blkif, pages, segs_to_unmap);
> > segs_to_unmap = 0;
> > @@ -330,7 +328,7 @@ static void unmap_purged_grants(struct work_struct *work)
> > kfree(persistent_gnt);
> > }
> > if (segs_to_unmap > 0) {
> > - ret = gnttab_unmap_refs(unmap, NULL, pages, segs_to_unmap);
> > + ret = gnttab_unmap_refs(unmap, pages, segs_to_unmap);
> > BUG_ON(ret);
> > put_free_pages(blkif, pages, segs_to_unmap);
> > }
> > @@ -670,15 +668,14 @@ static void xen_blkbk_unmap(struct xen_blkif *blkif,
> > GNTMAP_host_map, pages[i]->handle);
> > pages[i]->handle = BLKBACK_INVALID_HANDLE;
> > if (++invcount == BLKIF_MAX_SEGMENTS_PER_REQUEST) {
> > - ret = gnttab_unmap_refs(unmap, NULL, unmap_pages,
> > - invcount);
> > + ret = gnttab_unmap_refs(unmap, unmap_pages, invcount);
> > BUG_ON(ret);
> > put_free_pages(blkif, unmap_pages, invcount);
> > invcount = 0;
> > }
> > }
> > if (invcount) {
> > - ret = gnttab_unmap_refs(unmap, NULL, unmap_pages, invcount);
> > + ret = gnttab_unmap_refs(unmap, unmap_pages, invcount);
> > BUG_ON(ret);
> > put_free_pages(blkif, unmap_pages, invcount);
> > }
> > @@ -740,7 +737,7 @@ again:
> > }
> >
> > if (segs_to_map) {
> > - ret = gnttab_map_refs(map, NULL, pages_to_gnt, segs_to_map);
> > + ret = gnttab_map_refs(map, pages_to_gnt, segs_to_map);
> > BUG_ON(ret);
> > }
> >
> > diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c
> > index e41c79c..e652c0e 100644
> > --- a/drivers/xen/gntdev.c
> > +++ b/drivers/xen/gntdev.c
> > @@ -284,8 +284,10 @@ static int map_grant_pages(struct grant_map *map)
> > }
> >
> > pr_debug("map %d+%d\n", map->index, map->count);
> > - err = gnttab_map_refs(map->map_ops, use_ptemod ? map->kmap_ops : NULL,
> > - map->pages, map->count);
> > + err = gnttab_map_refs_userspace(map->map_ops,
> > + use_ptemod ? map->kmap_ops : NULL,
> > + map->pages,
> > + map->count);
> > if (err)
> > return err;
> >
> > @@ -315,9 +317,10 @@ static int __unmap_grant_pages(struct grant_map *map, int offset, int pages)
> > }
> > }
> >
> > - err = gnttab_unmap_refs(map->unmap_ops + offset,
> > - use_ptemod ? map->kmap_ops + offset : NULL, map->pages + offset,
> > - pages);
> > + err = gnttab_unmap_refs_userspace(map->unmap_ops + offset,
> > + use_ptemod ? map->kmap_ops + offset : NULL,
> > + map->pages + offset,
> > + pages);
> > if (err)
> > return err;
> >
> > diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
> > index aa846a4..2add483 100644
> > --- a/drivers/xen/grant-table.c
> > +++ b/drivers/xen/grant-table.c
> > @@ -880,15 +880,17 @@ void gnttab_batch_copy(struct gnttab_copy *batch, unsigned count)
> > }
> > EXPORT_SYMBOL_GPL(gnttab_batch_copy);
> >
> > -int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
> > +int __gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
> > struct gnttab_map_grant_ref *kmap_ops,
> > - struct page **pages, unsigned int count)
> > + struct page **pages, unsigned int count,
> > + bool m2p_override)
> > {
> > int i, ret;
> > bool lazy = false;
> > pte_t *pte;
> > - unsigned long mfn;
> > + unsigned long mfn, pfn;
> >
> > + BUG_ON(kmap_ops && !m2p_override);
> > ret = HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, map_ops, count);
> > if (ret)
> > return ret;
> > @@ -907,10 +909,12 @@ int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
> > set_phys_to_machine(map_ops[i].host_addr >> PAGE_SHIFT,
> > map_ops[i].dev_bus_addr >> PAGE_SHIFT);
> > }
> > - return ret;
> > + return 0;
> > }
> >
> > - if (!in_interrupt() && paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE) {
> > + if (m2p_override &&
> > + !in_interrupt() &&
> > + paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE) {
> > arch_enter_lazy_mmu_mode();
> > lazy = true;
> > }
> > @@ -927,8 +931,20 @@ int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
> > } else {
> > mfn = PFN_DOWN(map_ops[i].dev_bus_addr);
> > }
> > - ret = m2p_add_override(mfn, pages[i], kmap_ops ?
> > - &kmap_ops[i] : NULL);
> > + pfn = page_to_pfn(pages[i]);
> > +
> > + WARN_ON(PagePrivate(pages[i]));
> > + SetPagePrivate(pages[i]);
> > + set_page_private(pages[i], mfn);
> > +
> > + pages[i]->index = pfn_to_mfn(pfn);
> > + if (unlikely(!set_phys_to_machine(pfn, FOREIGN_FRAME(mfn)))) {
> > + ret = -ENOMEM;
> > + goto out;
> > + }
> > + if (m2p_override)
> > + ret = m2p_add_override(mfn, pages[i], kmap_ops ?
> > + &kmap_ops[i] : NULL, pfn);
> > if (ret)
> > goto out;
> > }
> > @@ -939,15 +955,32 @@ int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
> >
> > return ret;
> > }
> > +
> > +int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
> > + struct page **pages, unsigned int count)
> > +{
> > + return __gnttab_map_refs(map_ops, NULL, pages, count, false);
> > +}
> > EXPORT_SYMBOL_GPL(gnttab_map_refs);
> >
> > -int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops,
> > +int gnttab_map_refs_userspace(struct gnttab_map_grant_ref *map_ops,
> > + struct gnttab_map_grant_ref *kmap_ops,
> > + struct page **pages, unsigned int count)
> > +{
> > + return __gnttab_map_refs(map_ops, kmap_ops, pages, count, true);
> > +}
> > +EXPORT_SYMBOL_GPL(gnttab_map_refs_userspace);
> > +
> > +int __gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops,
> > struct gnttab_map_grant_ref *kmap_ops,
> > - struct page **pages, unsigned int count)
> > + struct page **pages, unsigned int count,
> > + bool m2p_override)
> > {
> > int i, ret;
> > bool lazy = false;
> > + unsigned long pfn, mfn;
> >
> > + BUG_ON(kmap_ops && !m2p_override);
> > ret = HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, unmap_ops, count);
> > if (ret)
> > return ret;
> > @@ -958,17 +991,34 @@ int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops,
> > set_phys_to_machine(unmap_ops[i].host_addr >> PAGE_SHIFT,
> > INVALID_P2M_ENTRY);
> > }
> > - return ret;
> > + return 0;
> > }
> >
> > - if (!in_interrupt() && paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE) {
> > + if (m2p_override &&
> > + !in_interrupt() &&
> > + paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE) {
> > arch_enter_lazy_mmu_mode();
> > lazy = true;
> > }
> >
> > for (i = 0; i < count; i++) {
> > - ret = m2p_remove_override(pages[i], kmap_ops ?
> > - &kmap_ops[i] : NULL);
> > + pfn = page_to_pfn(pages[i]);
> > + mfn = get_phys_to_machine(pfn);
> > + if (mfn == INVALID_P2M_ENTRY || !(mfn & FOREIGN_FRAME_BIT)) {
> > + ret = -EINVAL;
> > + goto out;
> > + }
> > +
> > + set_page_private(pages[i], INVALID_P2M_ENTRY);
> > + WARN_ON(!PagePrivate(pages[i]));
> > + ClearPagePrivate(pages[i]);
> > + set_phys_to_machine(pfn, pages[i]->index);
> > + if (m2p_override)
> > + ret = m2p_remove_override(pages[i],
> > + kmap_ops ?
> > + &kmap_ops[i] : NULL,
> > + pfn,
> > + mfn);
> > if (ret)
> > goto out;
> > }
> > @@ -979,8 +1029,22 @@ int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops,
> >
> > return ret;
> > }
> > +
> > +int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *map_ops,
> > + struct page **pages, unsigned int count)
> > +{
> > + return __gnttab_unmap_refs(map_ops, NULL, pages, count, false);
> > +}
> > EXPORT_SYMBOL_GPL(gnttab_unmap_refs);
> >
> > +int gnttab_unmap_refs_userspace(struct gnttab_unmap_grant_ref *map_ops,
> > + struct gnttab_map_grant_ref *kmap_ops,
> > + struct page **pages, unsigned int count)
> > +{
> > + return __gnttab_unmap_refs(map_ops, kmap_ops, pages, count, true);
> > +}
> > +EXPORT_SYMBOL_GPL(gnttab_unmap_refs_userspace);
> > +
> > static unsigned nr_status_frames(unsigned nr_grant_frames)
> > {
> > BUG_ON(grefs_per_grant_frame == 0);
> > diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h
> > index 694dcaf..9a919b1 100644
> > --- a/include/xen/grant_table.h
> > +++ b/include/xen/grant_table.h
> > @@ -184,11 +184,15 @@ unsigned int gnttab_max_grant_frames(void);
> > #define gnttab_map_vaddr(map) ((void *)(map.host_virt_addr))
> >
> > int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
> > - struct gnttab_map_grant_ref *kmap_ops,
> > struct page **pages, unsigned int count);
> > +int gnttab_map_refs_userspace(struct gnttab_map_grant_ref *map_ops,
> > + struct gnttab_map_grant_ref *kmap_ops,
> > + struct page **pages, unsigned int count);
> > int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops,
> > - struct gnttab_map_grant_ref *kunmap_ops,
> > struct page **pages, unsigned int count);
> > +int gnttab_unmap_refs_userspace(struct gnttab_unmap_grant_ref *unmap_ops,
> > + struct gnttab_map_grant_ref *kunmap_ops,
> > + struct page **pages, unsigned int count);
> >
> > /* Perform a batch of grant map/copy operations. Retry every batch slot
> > * for which the hypervisor returns GNTST_eagain. This is typically due
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xen.org
> > http://lists.xen.org/xen-devel
>
^ permalink raw reply
* Re: [Xen-devel] [PATCH v5] xen/grant-table: Avoid m2p_override during mapping
From: David Vrabel @ 2014-01-24 14:44 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk
Cc: Zoltan Kiss, Stefano Stabellini, boris.ostrovsky, ian.campbell,
wei.liu2, xen-devel, netdev, linux-kernel, jonathan.davies
In-Reply-To: <20140124143711.GB12946@phenom.dumpdata.com>
On 24/01/14 14:37, Konrad Rzeszutek Wilk wrote:
> On Thu, Jan 23, 2014 at 01:07:10PM +0000, Zoltan Kiss wrote:
>> The grant mapping API does m2p_override unnecessarily: only gntdev needs it,
>> for blkback and future netback patches it just cause a lock contention, as
>> those pages never go to userspace. Therefore this series does the following:
>> - the original functions were renamed to __gnttab_[un]map_refs, with a new
>> parameter m2p_override
>> - based on m2p_override either they follow the original behaviour, or just set
>> the private flag and call set_phys_to_machine
>> - gnttab_[un]map_refs are now a wrapper to call __gnttab_[un]map_refs with
>> m2p_override false
>> - a new function gnttab_[un]map_refs_userspace provides the old behaviour
>>
>> It also removes a stray space from page.h and change ret to 0 if
>> XENFEAT_auto_translated_physmap, as that is the only possible return value
>> there.
>>
>> v2:
>> - move the storing of the old mfn in page->index to gnttab_map_refs
>> - move the function header update to a separate patch
>>
>> v3:
>> - a new approach to retain old behaviour where it needed
>> - squash the patches into one
>>
>> v4:
>> - move out the common bits from m2p* functions, and pass pfn/mfn as parameter
>> - clear page->private before doing anything with the page, so m2p_find_override
>> won't race with this
>>
>> v5:
>> - change return value handling in __gnttab_[un]map_refs
>> - remove a stray space in page.h
>> - add detail why ret = 0 now at some places
>>
>> Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com>
>> Suggested-by: David Vrabel <david.vrabel@citrix.com>
>
> It looks OK to me and while it is not a bug-fix I think it should
> go for v3.14 - as it _should_ improve the backends.
>
> David or Boris; Stefano, please Ack/Nack it.
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
David
^ permalink raw reply
* Re: [Xen-devel] [PATCH v5] xen/grant-table: Avoid m2p_override during mapping
From: Konrad Rzeszutek Wilk @ 2014-01-24 14:37 UTC (permalink / raw)
To: Zoltan Kiss, Stefano Stabellini, david.vrabel, boris.ostrovsky
Cc: ian.campbell, wei.liu2, xen-devel, netdev, linux-kernel,
jonathan.davies
In-Reply-To: <1390482430-9168-1-git-send-email-zoltan.kiss@citrix.com>
On Thu, Jan 23, 2014 at 01:07:10PM +0000, Zoltan Kiss wrote:
> The grant mapping API does m2p_override unnecessarily: only gntdev needs it,
> for blkback and future netback patches it just cause a lock contention, as
> those pages never go to userspace. Therefore this series does the following:
> - the original functions were renamed to __gnttab_[un]map_refs, with a new
> parameter m2p_override
> - based on m2p_override either they follow the original behaviour, or just set
> the private flag and call set_phys_to_machine
> - gnttab_[un]map_refs are now a wrapper to call __gnttab_[un]map_refs with
> m2p_override false
> - a new function gnttab_[un]map_refs_userspace provides the old behaviour
>
> It also removes a stray space from page.h and change ret to 0 if
> XENFEAT_auto_translated_physmap, as that is the only possible return value
> there.
>
> v2:
> - move the storing of the old mfn in page->index to gnttab_map_refs
> - move the function header update to a separate patch
>
> v3:
> - a new approach to retain old behaviour where it needed
> - squash the patches into one
>
> v4:
> - move out the common bits from m2p* functions, and pass pfn/mfn as parameter
> - clear page->private before doing anything with the page, so m2p_find_override
> won't race with this
>
> v5:
> - change return value handling in __gnttab_[un]map_refs
> - remove a stray space in page.h
> - add detail why ret = 0 now at some places
>
> Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com>
> Suggested-by: David Vrabel <david.vrabel@citrix.com>
It looks OK to me and while it is not a bug-fix I think it should
go for v3.14 - as it _should_ improve the backends.
David or Boris; Stefano, please Ack/Nack it.
Thank you.
> ---
> arch/x86/include/asm/xen/page.h | 12 +++--
> arch/x86/xen/p2m.c | 25 ++--------
> drivers/block/xen-blkback/blkback.c | 15 +++---
> drivers/xen/gntdev.c | 13 +++--
> drivers/xen/grant-table.c | 90 ++++++++++++++++++++++++++++++-----
> include/xen/grant_table.h | 8 +++-
> 6 files changed, 109 insertions(+), 54 deletions(-)
>
> diff --git a/arch/x86/include/asm/xen/page.h b/arch/x86/include/asm/xen/page.h
> index b913915..68a1438 100644
> --- a/arch/x86/include/asm/xen/page.h
> +++ b/arch/x86/include/asm/xen/page.h
> @@ -49,10 +49,14 @@ extern bool __set_phys_to_machine(unsigned long pfn, unsigned long mfn);
> extern unsigned long set_phys_range_identity(unsigned long pfn_s,
> unsigned long pfn_e);
>
> -extern int m2p_add_override(unsigned long mfn, struct page *page,
> - struct gnttab_map_grant_ref *kmap_op);
> +extern int m2p_add_override(unsigned long mfn,
> + struct page *page,
> + struct gnttab_map_grant_ref *kmap_op,
> + unsigned long pfn);
> extern int m2p_remove_override(struct page *page,
> - struct gnttab_map_grant_ref *kmap_op);
> + struct gnttab_map_grant_ref *kmap_op,
> + unsigned long pfn,
> + unsigned long mfn);
> extern struct page *m2p_find_override(unsigned long mfn);
> extern unsigned long m2p_find_override_pfn(unsigned long mfn, unsigned long pfn);
>
> @@ -121,7 +125,7 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn)
> pfn = m2p_find_override_pfn(mfn, ~0);
> }
>
> - /*
> + /*
> * pfn is ~0 if there are no entries in the m2p for mfn or if the
> * entry doesn't map back to the mfn and m2p_override doesn't have a
> * valid entry for it.
> diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
> index 2ae8699..0060178 100644
> --- a/arch/x86/xen/p2m.c
> +++ b/arch/x86/xen/p2m.c
> @@ -872,15 +872,13 @@ static unsigned long mfn_hash(unsigned long mfn)
>
> /* Add an MFN override for a particular page */
> int m2p_add_override(unsigned long mfn, struct page *page,
> - struct gnttab_map_grant_ref *kmap_op)
> + struct gnttab_map_grant_ref *kmap_op, unsigned long pfn)
> {
> unsigned long flags;
> - unsigned long pfn;
> unsigned long uninitialized_var(address);
> unsigned level;
> pte_t *ptep = NULL;
>
> - pfn = page_to_pfn(page);
> if (!PageHighMem(page)) {
> address = (unsigned long)__va(pfn << PAGE_SHIFT);
> ptep = lookup_address(address, &level);
> @@ -888,13 +886,6 @@ int m2p_add_override(unsigned long mfn, struct page *page,
> "m2p_add_override: pfn %lx not mapped", pfn))
> return -EINVAL;
> }
> - WARN_ON(PagePrivate(page));
> - SetPagePrivate(page);
> - set_page_private(page, mfn);
> - page->index = pfn_to_mfn(pfn);
> -
> - if (unlikely(!set_phys_to_machine(pfn, FOREIGN_FRAME(mfn))))
> - return -ENOMEM;
>
> if (kmap_op != NULL) {
> if (!PageHighMem(page)) {
> @@ -933,20 +924,15 @@ int m2p_add_override(unsigned long mfn, struct page *page,
> }
> EXPORT_SYMBOL_GPL(m2p_add_override);
> int m2p_remove_override(struct page *page,
> - struct gnttab_map_grant_ref *kmap_op)
> + struct gnttab_map_grant_ref *kmap_op,
> + unsigned long pfn,
> + unsigned long mfn)
> {
> unsigned long flags;
> - unsigned long mfn;
> - unsigned long pfn;
> unsigned long uninitialized_var(address);
> unsigned level;
> pte_t *ptep = NULL;
>
> - pfn = page_to_pfn(page);
> - mfn = get_phys_to_machine(pfn);
> - if (mfn == INVALID_P2M_ENTRY || !(mfn & FOREIGN_FRAME_BIT))
> - return -EINVAL;
> -
> if (!PageHighMem(page)) {
> address = (unsigned long)__va(pfn << PAGE_SHIFT);
> ptep = lookup_address(address, &level);
> @@ -959,10 +945,7 @@ int m2p_remove_override(struct page *page,
> spin_lock_irqsave(&m2p_override_lock, flags);
> list_del(&page->lru);
> spin_unlock_irqrestore(&m2p_override_lock, flags);
> - WARN_ON(!PagePrivate(page));
> - ClearPagePrivate(page);
>
> - set_phys_to_machine(pfn, page->index);
> if (kmap_op != NULL) {
> if (!PageHighMem(page)) {
> struct multicall_space mcs;
> diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
> index 6620b73..875025f 100644
> --- a/drivers/block/xen-blkback/blkback.c
> +++ b/drivers/block/xen-blkback/blkback.c
> @@ -285,8 +285,7 @@ static void free_persistent_gnts(struct xen_blkif *blkif, struct rb_root *root,
>
> if (++segs_to_unmap == BLKIF_MAX_SEGMENTS_PER_REQUEST ||
> !rb_next(&persistent_gnt->node)) {
> - ret = gnttab_unmap_refs(unmap, NULL, pages,
> - segs_to_unmap);
> + ret = gnttab_unmap_refs(unmap, pages, segs_to_unmap);
> BUG_ON(ret);
> put_free_pages(blkif, pages, segs_to_unmap);
> segs_to_unmap = 0;
> @@ -321,8 +320,7 @@ static void unmap_purged_grants(struct work_struct *work)
> pages[segs_to_unmap] = persistent_gnt->page;
>
> if (++segs_to_unmap == BLKIF_MAX_SEGMENTS_PER_REQUEST) {
> - ret = gnttab_unmap_refs(unmap, NULL, pages,
> - segs_to_unmap);
> + ret = gnttab_unmap_refs(unmap, pages, segs_to_unmap);
> BUG_ON(ret);
> put_free_pages(blkif, pages, segs_to_unmap);
> segs_to_unmap = 0;
> @@ -330,7 +328,7 @@ static void unmap_purged_grants(struct work_struct *work)
> kfree(persistent_gnt);
> }
> if (segs_to_unmap > 0) {
> - ret = gnttab_unmap_refs(unmap, NULL, pages, segs_to_unmap);
> + ret = gnttab_unmap_refs(unmap, pages, segs_to_unmap);
> BUG_ON(ret);
> put_free_pages(blkif, pages, segs_to_unmap);
> }
> @@ -670,15 +668,14 @@ static void xen_blkbk_unmap(struct xen_blkif *blkif,
> GNTMAP_host_map, pages[i]->handle);
> pages[i]->handle = BLKBACK_INVALID_HANDLE;
> if (++invcount == BLKIF_MAX_SEGMENTS_PER_REQUEST) {
> - ret = gnttab_unmap_refs(unmap, NULL, unmap_pages,
> - invcount);
> + ret = gnttab_unmap_refs(unmap, unmap_pages, invcount);
> BUG_ON(ret);
> put_free_pages(blkif, unmap_pages, invcount);
> invcount = 0;
> }
> }
> if (invcount) {
> - ret = gnttab_unmap_refs(unmap, NULL, unmap_pages, invcount);
> + ret = gnttab_unmap_refs(unmap, unmap_pages, invcount);
> BUG_ON(ret);
> put_free_pages(blkif, unmap_pages, invcount);
> }
> @@ -740,7 +737,7 @@ again:
> }
>
> if (segs_to_map) {
> - ret = gnttab_map_refs(map, NULL, pages_to_gnt, segs_to_map);
> + ret = gnttab_map_refs(map, pages_to_gnt, segs_to_map);
> BUG_ON(ret);
> }
>
> diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c
> index e41c79c..e652c0e 100644
> --- a/drivers/xen/gntdev.c
> +++ b/drivers/xen/gntdev.c
> @@ -284,8 +284,10 @@ static int map_grant_pages(struct grant_map *map)
> }
>
> pr_debug("map %d+%d\n", map->index, map->count);
> - err = gnttab_map_refs(map->map_ops, use_ptemod ? map->kmap_ops : NULL,
> - map->pages, map->count);
> + err = gnttab_map_refs_userspace(map->map_ops,
> + use_ptemod ? map->kmap_ops : NULL,
> + map->pages,
> + map->count);
> if (err)
> return err;
>
> @@ -315,9 +317,10 @@ static int __unmap_grant_pages(struct grant_map *map, int offset, int pages)
> }
> }
>
> - err = gnttab_unmap_refs(map->unmap_ops + offset,
> - use_ptemod ? map->kmap_ops + offset : NULL, map->pages + offset,
> - pages);
> + err = gnttab_unmap_refs_userspace(map->unmap_ops + offset,
> + use_ptemod ? map->kmap_ops + offset : NULL,
> + map->pages + offset,
> + pages);
> if (err)
> return err;
>
> diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
> index aa846a4..2add483 100644
> --- a/drivers/xen/grant-table.c
> +++ b/drivers/xen/grant-table.c
> @@ -880,15 +880,17 @@ void gnttab_batch_copy(struct gnttab_copy *batch, unsigned count)
> }
> EXPORT_SYMBOL_GPL(gnttab_batch_copy);
>
> -int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
> +int __gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
> struct gnttab_map_grant_ref *kmap_ops,
> - struct page **pages, unsigned int count)
> + struct page **pages, unsigned int count,
> + bool m2p_override)
> {
> int i, ret;
> bool lazy = false;
> pte_t *pte;
> - unsigned long mfn;
> + unsigned long mfn, pfn;
>
> + BUG_ON(kmap_ops && !m2p_override);
> ret = HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, map_ops, count);
> if (ret)
> return ret;
> @@ -907,10 +909,12 @@ int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
> set_phys_to_machine(map_ops[i].host_addr >> PAGE_SHIFT,
> map_ops[i].dev_bus_addr >> PAGE_SHIFT);
> }
> - return ret;
> + return 0;
> }
>
> - if (!in_interrupt() && paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE) {
> + if (m2p_override &&
> + !in_interrupt() &&
> + paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE) {
> arch_enter_lazy_mmu_mode();
> lazy = true;
> }
> @@ -927,8 +931,20 @@ int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
> } else {
> mfn = PFN_DOWN(map_ops[i].dev_bus_addr);
> }
> - ret = m2p_add_override(mfn, pages[i], kmap_ops ?
> - &kmap_ops[i] : NULL);
> + pfn = page_to_pfn(pages[i]);
> +
> + WARN_ON(PagePrivate(pages[i]));
> + SetPagePrivate(pages[i]);
> + set_page_private(pages[i], mfn);
> +
> + pages[i]->index = pfn_to_mfn(pfn);
> + if (unlikely(!set_phys_to_machine(pfn, FOREIGN_FRAME(mfn)))) {
> + ret = -ENOMEM;
> + goto out;
> + }
> + if (m2p_override)
> + ret = m2p_add_override(mfn, pages[i], kmap_ops ?
> + &kmap_ops[i] : NULL, pfn);
> if (ret)
> goto out;
> }
> @@ -939,15 +955,32 @@ int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
>
> return ret;
> }
> +
> +int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
> + struct page **pages, unsigned int count)
> +{
> + return __gnttab_map_refs(map_ops, NULL, pages, count, false);
> +}
> EXPORT_SYMBOL_GPL(gnttab_map_refs);
>
> -int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops,
> +int gnttab_map_refs_userspace(struct gnttab_map_grant_ref *map_ops,
> + struct gnttab_map_grant_ref *kmap_ops,
> + struct page **pages, unsigned int count)
> +{
> + return __gnttab_map_refs(map_ops, kmap_ops, pages, count, true);
> +}
> +EXPORT_SYMBOL_GPL(gnttab_map_refs_userspace);
> +
> +int __gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops,
> struct gnttab_map_grant_ref *kmap_ops,
> - struct page **pages, unsigned int count)
> + struct page **pages, unsigned int count,
> + bool m2p_override)
> {
> int i, ret;
> bool lazy = false;
> + unsigned long pfn, mfn;
>
> + BUG_ON(kmap_ops && !m2p_override);
> ret = HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, unmap_ops, count);
> if (ret)
> return ret;
> @@ -958,17 +991,34 @@ int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops,
> set_phys_to_machine(unmap_ops[i].host_addr >> PAGE_SHIFT,
> INVALID_P2M_ENTRY);
> }
> - return ret;
> + return 0;
> }
>
> - if (!in_interrupt() && paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE) {
> + if (m2p_override &&
> + !in_interrupt() &&
> + paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE) {
> arch_enter_lazy_mmu_mode();
> lazy = true;
> }
>
> for (i = 0; i < count; i++) {
> - ret = m2p_remove_override(pages[i], kmap_ops ?
> - &kmap_ops[i] : NULL);
> + pfn = page_to_pfn(pages[i]);
> + mfn = get_phys_to_machine(pfn);
> + if (mfn == INVALID_P2M_ENTRY || !(mfn & FOREIGN_FRAME_BIT)) {
> + ret = -EINVAL;
> + goto out;
> + }
> +
> + set_page_private(pages[i], INVALID_P2M_ENTRY);
> + WARN_ON(!PagePrivate(pages[i]));
> + ClearPagePrivate(pages[i]);
> + set_phys_to_machine(pfn, pages[i]->index);
> + if (m2p_override)
> + ret = m2p_remove_override(pages[i],
> + kmap_ops ?
> + &kmap_ops[i] : NULL,
> + pfn,
> + mfn);
> if (ret)
> goto out;
> }
> @@ -979,8 +1029,22 @@ int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops,
>
> return ret;
> }
> +
> +int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *map_ops,
> + struct page **pages, unsigned int count)
> +{
> + return __gnttab_unmap_refs(map_ops, NULL, pages, count, false);
> +}
> EXPORT_SYMBOL_GPL(gnttab_unmap_refs);
>
> +int gnttab_unmap_refs_userspace(struct gnttab_unmap_grant_ref *map_ops,
> + struct gnttab_map_grant_ref *kmap_ops,
> + struct page **pages, unsigned int count)
> +{
> + return __gnttab_unmap_refs(map_ops, kmap_ops, pages, count, true);
> +}
> +EXPORT_SYMBOL_GPL(gnttab_unmap_refs_userspace);
> +
> static unsigned nr_status_frames(unsigned nr_grant_frames)
> {
> BUG_ON(grefs_per_grant_frame == 0);
> diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h
> index 694dcaf..9a919b1 100644
> --- a/include/xen/grant_table.h
> +++ b/include/xen/grant_table.h
> @@ -184,11 +184,15 @@ unsigned int gnttab_max_grant_frames(void);
> #define gnttab_map_vaddr(map) ((void *)(map.host_virt_addr))
>
> int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
> - struct gnttab_map_grant_ref *kmap_ops,
> struct page **pages, unsigned int count);
> +int gnttab_map_refs_userspace(struct gnttab_map_grant_ref *map_ops,
> + struct gnttab_map_grant_ref *kmap_ops,
> + struct page **pages, unsigned int count);
> int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops,
> - struct gnttab_map_grant_ref *kunmap_ops,
> struct page **pages, unsigned int count);
> +int gnttab_unmap_refs_userspace(struct gnttab_unmap_grant_ref *unmap_ops,
> + struct gnttab_map_grant_ref *kunmap_ops,
> + struct page **pages, unsigned int count);
>
> /* Perform a batch of grant map/copy operations. Retry every batch slot
> * for which the hypervisor returns GNTST_eagain. This is typically due
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
^ permalink raw reply
* Re: [PATCH] net: sk == 0xffffffff fix - not for commit
From: Andrew Ruder @ 2014-01-24 14:15 UTC (permalink / raw)
To: Andrzej Pietrasiewicz, linux-kernel, linux-usb, Kyungmin Park,
Felipe Balbi, Greg Kroah-Hartman, Marek Szyprowski,
Michal Nazarewicz, David S. Miller, Alexey Kuznetsov,
James Morris, Hideaki YOSHIFUJI, Patrick McHardy, netdev
In-Reply-To: <20140124133831.GB20804@gmail.com>
On Fri, Jan 24, 2014 at 07:38:31AM -0600, Andrew Ruder wrote:
> http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg574770.html
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58854
Just a little further confirmation. This appears in
__inet_lookup_established as the last four instructions before
returning.
<+440>: bl <__rcu_read_unlock>
<+444>: sub sp, r11, #40 ; 0x28
<+448>: ldr r0, [r11, #-48] ; 0x30
<+452>: ldm sp, {r4, r5, r6, r7, r8, r9, r10, r11, sp, pc}
^ permalink raw reply
* Re: [PATCH net-next] bonding: do't permit slaves to change their mtu ndependently
From: Ding Tianhong @ 2014-01-24 13:58 UTC (permalink / raw)
To: David Miller, dingtianhong; +Cc: fubar, vfalico, andy, netdev
In-Reply-To: <20140124.015538.738633619234119497.davem@davemloft.net>
于 2014/1/24 17:55, David Miller 写道:
>
> Diag, your commit messages and subject lines chronically have
> many typos.
>
> Please take the time out necessary to correct such errors before
> sending your patches.
>
> This subject line shows a complete lack of care.
>
I am very sorry, I was not in my office, so I could not resend now by office email, sorry for that.
Ding
> Subject: Re: [PATCH net-next] bonding: do't permit slaves to change their mtu ndependently
> --
> 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: IPV6 routing problem
From: Hannes Frederic Sowa @ 2014-01-24 13:59 UTC (permalink / raw)
To: Emmanuel Thierry; +Cc: Sharat Masetty, netdev
In-Reply-To: <CD36411A-7584-48B1-A406-E1584B3D32DD@sekil.fr>
On Fri, Jan 24, 2014 at 10:36:54AM +0100, Emmanuel Thierry wrote:
> Hello,
>
> Le 23 janv. 2014 à 08:15, Sharat Masetty a écrit :
>
> > Unfortunately toggling this config setting CONFIG_IPV6_ROUTER_PREF did
> > not help, I see the same problem in both cases.
> > The kernel version I am using is 3.10.0.
> >
> > Thanks for confirming that this is a non issue on 3.13 kernel version.
> > Would you happen to know which patch would have potentially fixed this
> > issue?
>
> Your problem looks like the following one :
> http://marc.info/?l=linux-netdev&m=137280268407054&w=2
>
> Which has been fixed in 3.10.4, and 3.11+
Yes, that could very well be the case. We resolve the gateway while
inserting the route (if not on-link), and it may not be available
because of missing probes or no traffic went to it, yet. Thanks for
looking after this, Emmanuel.
I really recommend using the stable kernels btw. instead of the vanialla
point zero releases.
Thanks,
Hannes
^ permalink raw reply
* BUSINESS PROPOSAL OF $44.5MILLI?ON.USD.
From: BusinessProposal21 @ 2014-01-24 3:44 UTC (permalink / raw)
To: Recipients
Hello, It is understandable that you might be a little bit apprehensive
because you do not know me but I have a lucrative business proposal of mutual
interest to share with you.
I got your reference in my search for someone who suits my proposed business relationship.
I am Mr.ching Kwok bank officer with the International bank of Taipei.
I will need you to assist me in executing a business project from Taiwan to your country.
It involves the transfer of money.
Everything concerning this transaction shall be legally done without hitch.
Once the funds have been successfully transferred into your account,
we shall share in the ratio to be agreed by both of us.Contact me for further details.
I shall furnish you with more information about this operation immediately
I receive a positive response from you.
You Contact me for more details
Email: mrchingkwok091@gmail.com
Kind Regards,
Mr.ching Kwok
^ permalink raw reply
* Re: [PATCH] net: sk == 0xffffffff fix - not for commit
From: Andrew Ruder @ 2014-01-24 13:38 UTC (permalink / raw)
To: Andrzej Pietrasiewicz
Cc: linux-kernel, linux-usb, Kyungmin Park, Felipe Balbi,
Greg Kroah-Hartman, Marek Szyprowski, Michal Nazarewicz,
David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, netdev
In-Reply-To: <1386589672-5830-1-git-send-email-andrzej.p@samsung.com>
Actually found what looks to be a fix for this in another thread.
http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg574770.html
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58854
Cheers,
Andy
^ permalink raw reply
* Re: [PATCH net v2] ipv6: reallocate addrconf router for ipv6 address when lo device up
From: Hannes Frederic Sowa @ 2014-01-24 13:32 UTC (permalink / raw)
To: Gao feng; +Cc: netdev, davem, Sabrina Dubroca, Weilong Chen
In-Reply-To: <1390552151-20735-1-git-send-email-gaofeng@cn.fujitsu.com>
On Fri, Jan 24, 2014 at 04:29:11PM +0800, Gao feng wrote:
> commit 25fb6ca4ed9cad72f14f61629b68dc03c0d9713f
> "net IPv6 : Fix broken IPv6 routing table after loopback down-up"
> allocates addrconf router for ipv6 address when lo device up.
> but commit a881ae1f625c599b460cc8f8a7fcb1c438f699ad
> "ipv6:don't call addrconf_dst_alloc again when enable lo" breaks
> this behavior.
>
> Since the addrconf router is moved to the garbage list when
> lo device down, we should release this router and rellocate
> a new one for ipv6 address when lo device up.
>
> This patch solves bug 67951 on bugzilla
> https://bugzilla.kernel.org/show_bug.cgi?id=67951
>
> change from v1:
> use ip6_rt_put to repleace ip6_del_rt, thanks Hannes!
> change code style, suggested by Sergei.
>
> CC: Sabrina Dubroca <sd@queasysnail.net>
> CC: Hannes Frederic Sowa <hannes@stressinduktion.org>
> Reported-by: Weilong Chen <chenweilong@huawei.com>
> Signed-off-by: Weilong Chen <chenweilong@huawei.com>
> Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Thanks, Gao!
^ permalink raw reply
* [net/loopback] +46% netperf.Throughput_Mbps
From: Fengguang Wu @ 2014-01-24 12:24 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev
Hi Eric,
Just FYI, we do measured +46.4% performance boost in netperf
TCP_SENDFILE tests on an atom server for commit:
commit 0cf833aefaa85bbfce3ff70485e5534e09254773
Author: Eric Dumazet <edumazet@google.com>
AuthorDate: Sun Sep 23 22:28:59 2012 +0000
Commit: David S. Miller <davem@davemloft.net>
CommitDate: Mon Sep 24 16:23:53 2012 -0400
net: loopback: set default mtu to 64K
loopback current mtu of 16436 bytes allows no more than 3 MSS TCP
segments per frame, or 48 Kbytes. Changing mtu to 64K allows TCP
stack to build large frames and significantly reduces stack overhead.
Performance boost on bulk TCP transferts can be up to 30 %, partly
because we now have one ACK message for two 64KB segments, and a lower
probability of hitting /proc/sys/net/ipv4/tcp_reordering default limit.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/loopback.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
2a6c8c7998f95b1 0cf833aefaa85bbfce3ff7048
--------------- -------------------------
1233 ~ 4% +46.4% 1805 ~ 0% netperf.Throughput_Mbps
29214 ~ 9% -85.2% 4310 ~17% interrupts.RES
450970 ~ 3% -57.3% 192675 ~ 1% proc-vmstat.pgalloc_normal
453096 ~ 3% -57.0% 194790 ~ 1% proc-vmstat.pgfree
4664799 ~ 6% -47.7% 2441398 ~ 0% softirqs.NET_RX
1107 ~ 9% +62.2% 1797 ~ 0% slabinfo.kmalloc-1024.active_objs
1185 ~ 8% +54.2% 1827 ~ 0% slabinfo.kmalloc-1024.num_objs
244825 ~ 3% -28.6% 174791 ~ 0% proc-vmstat.numa_hit
244825 ~ 3% -28.6% 174791 ~ 0% proc-vmstat.numa_local
913 ~ 2% +39.3% 1271 ~ 1% slabinfo.skbuff_fclone_cache.active_objs
944 ~ 3% +36.9% 1293 ~ 1% slabinfo.skbuff_fclone_cache.num_objs
10 ~ 0% -10.0% 9 ~ 0% vmstat.procs.r
59630 ~12% -94.4% 3336 ~ 8% vmstat.system.cs
1233 ~ 1% -16.4% 1031 ~ 0% vmstat.system.in
netperf.Throughput_Mbps
2000 ++------------------------------------------------------------------+
1800 O+O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O
| |
1600 ++ |
1400 ++ *. |
*.*.*.. .*.*. + * *.*.*.*. .*.*. .*.* |
1200 ++ *.* *..* : : *.*. * |
1000 ++ : : |
800 ++ : : |
| : : |
600 ++ : : |
400 ++ : : |
| : : |
200 ++ : : |
0 ++----------------------*-*-----------------------------------------+
^ permalink raw reply
* Re: [PATCH v2 1/2] can: Decrease default size of CAN_RAW socket send queue
From: Michal Sojka @ 2014-01-24 12:14 UTC (permalink / raw)
To: Marc Kleine-Budde; +Cc: linux-can, netdev, David Miller
In-Reply-To: <52E18331.6050607@pengutronix.de>
On Thu, Jan 23 2014, Marc Kleine-Budde wrote:
> On 01/23/2014 09:41 PM, David Miller wrote:
>> From: Michal Sojka <sojkam1@fel.cvut.cz>
>> Date: Wed, 22 Jan 2014 09:27:36 +0100
>>
>>> Since the length of the qdisc queue was set by default to 10
>>> packets, this is exactly what was happening.
>>
>> This is your bug, set the qdisc limit to something more reasonable.
>>
>> Something large enough to absorb the traffic wrt. the speed at which
>> the CAN device can sink the data.
>
> Hmmm, the problem is on i686 I have to increase the txqueuelen to 366
> before the socket works as expected (writes are blocking). This means if
> there are two processes one sending a stream of bulk data and the other
> one occasionally more important data there will be a lot of frames in
> front of the important ones.
This problem can be solved with queuing disciplines. See
https://rtime.felk.cvut.cz/can/socketcan-qdisc-final.pdf.
This reminds me that I have another patch that makes qdisc work better
with CAN raw sockets. I'll send the patch to linux-can.
-Michal
^ permalink raw reply
* Re: [Xen-devel] [PATCH v6] xen/grant-table: Avoid m2p_override during mapping
From: Stefano Stabellini @ 2014-01-24 12:04 UTC (permalink / raw)
To: Matt Wilson
Cc: Zoltan Kiss, jonathan.davies, wei.liu2, ian.campbell, netdev,
linux-kernel, Anthony Liguori, xen-devel, Matt Wilson
In-Reply-To: <20140124054828.GA18522@u109add4315675089e695.ant.amazon.com>
On Thu, 23 Jan 2014, Matt Wilson wrote:
> On Thu, Jan 23, 2014 at 09:23:44PM +0000, Zoltan Kiss wrote:
> > The grant mapping API does m2p_override unnecessarily: only gntdev needs it,
> > for blkback and future netback patches it just cause a lock contention, as
> > those pages never go to userspace. Therefore this series does the following:
> > - the original functions were renamed to __gnttab_[un]map_refs, with a new
> > parameter m2p_override
> > - based on m2p_override either they follow the original behaviour, or just set
> > the private flag and call set_phys_to_machine
> > - gnttab_[un]map_refs are now a wrapper to call __gnttab_[un]map_refs with
> > m2p_override false
> > - a new function gnttab_[un]map_refs_userspace provides the old behaviour
> >
> > It also removes a stray space from page.h and change ret to 0 if
> > XENFEAT_auto_translated_physmap, as that is the only possible return value
> > there.
> >
> > v2:
> > - move the storing of the old mfn in page->index to gnttab_map_refs
> > - move the function header update to a separate patch
> >
> > v3:
> > - a new approach to retain old behaviour where it needed
> > - squash the patches into one
> >
> > v4:
> > - move out the common bits from m2p* functions, and pass pfn/mfn as parameter
> > - clear page->private before doing anything with the page, so m2p_find_override
> > won't race with this
> >
> > v5:
> > - change return value handling in __gnttab_[un]map_refs
> > - remove a stray space in page.h
> > - add detail why ret = 0 now at some places
> >
> > v6:
> > - don't pass pfn to m2p* functions, just get it locally
> >
> > Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com>
> > Suggested-by: David Vrabel <david.vrabel@citrix.com>
>
> Apologies for coming in late on this thread. I'm quite behind on
> xen-devel mail that isn't CC: to me.
>
> It seems to have been forgotten that Anthony and I proposed a similar
> change last November.
>
> https://lkml.kernel.org/r/1384307336-5328-1-git-send-email-anthony@codemonkey.ws
>
> Or am I misunderstanding the change?
Matt, you are correct, it is very similar. I had forgotten about
Anthony's patch, otherwise I would have CC'ed him in the discussion.
^ permalink raw reply
* RE: [PATCH net-next 3/4] ethtool: Support for configurable RSS hash key.
From: Venkata Duvvuru @ 2014-01-24 12:00 UTC (permalink / raw)
To: Ben Hutchings; +Cc: netdev@vger.kernel.org
In-Reply-To: <1390489756.1547.13.camel@deadeye.wl.decadent.org.uk>
> -----Original Message-----
> From: Ben Hutchings [mailto:ben@decadent.org.uk]
> Sent: Thursday, January 23, 2014 8:39 PM
> To: Venkata Duvvuru
> Cc: netdev@vger.kernel.org
> Subject: Re: [PATCH net-next 3/4] ethtool: Support for configurable RSS hash
> key.
>
> On Thu, 2014-01-23 at 13:47 +0000, Venkata Duvvuru wrote:
> > > -----Original Message-----
> > > From: Ben Hutchings [mailto:ben@decadent.org.uk]
> > > Sent: Thursday, January 23, 2014 11:09 AM
> > > To: Venkata Duvvuru
> > > Cc: netdev@vger.kernel.org
> > > Subject: Re: [PATCH net-next 3/4] ethtool: Support for configurable
> > > RSS hash key.
> > >
> > > On Wed, 2014-01-22 at 12:12 +0000, Venkata Duvvuru wrote:
> > > [...]
> > > > > No, what I mean is:
> > > > >
> > > > > 1. An RX flow steering filter can specify use of RSS, in which
> > > > > case the value looked up in the indirection is added to the
> > > > > queue number specified in the filter. This is not yet
> > > > > controllable through RX NFC though there is room for extension
> there.
> > > > >
> > > > > 2. Multi-function controllers need multiple RSS contexts (key +
> > > > > indirection
> > > > > table) to support independent use of RSS on each function.
> > > > > But it may also be possible to allocate multiple contexts to a
> > > > > single
> > > function.
> > > > > This could be useful in conjunction with 1. But there would
> > > > > need to be a way to allocate and configure extra contexts first.
> > > > The proposed changes will be incremental so I think this can be
> > > > done in a separate patch. Thoughts?
> > >
> > > The ethtool ABI (to userland) has to remain backward-compatible, and
> > > it is preferable if we don't add lots of different structures for this.
> > >
> > > So please define the new command structure to include both the key
> > > and indirection table, and some reserved space (documented as
> > > 'userland must set to 0') for future extensions.
> >
> > I think it’s better to keep key and indirection table settings as
> > different ethtool commands. We can probably add rss contexts (reserved
> > space) to both the command structures.
> > If we mix key and indirection table into one command structure then it
> > will hamper the compatibility.
> [...]
>
> Right, there is no compatible way to extend struct ethtool_rxfh_indir.
> I should have thought ahead when defining it! But the new structure doesn't
> need to have that problem.
If any one of the operations (key or indirection table) is not supported by the driver, should we silently ignore that operation and process the other supported operation or should we fail the command. If we fail the command then we are mandating the drivers to implement both the operations.
>
> Ben.
>
> --
> Ben Hutchings
> compatible: Gracefully accepts erroneous data from any source
^ permalink raw reply
* Re: [PATCH net-next] bonding: do't permit slaves to change their mtu ndependently
From: Jiri Pirko @ 2014-01-24 11:50 UTC (permalink / raw)
To: David Miller; +Cc: dingtianhong, fubar, vfalico, andy, netdev
In-Reply-To: <20140124.015538.738633619234119497.davem@davemloft.net>
Fri, Jan 24, 2014 at 10:55:38AM CET, davem@davemloft.net wrote:
>
>Diag, your commit messages and subject lines chronically have
^^^^
Also typo :)
>many typos.
>
>Please take the time out necessary to correct such errors before
>sending your patches.
>
>This subject line shows a complete lack of care.
>
>Subject: Re: [PATCH net-next] bonding: do't permit slaves to change their mtu ndependently
This patch (leaving the typos out of the equation) looks correct to me.
Acked-by: Jiri Pirko <jiri@resnulli.us>
>--
>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 iproute2] Add IFLA_SLAVE support.
From: Jiri Pirko @ 2014-01-24 11:46 UTC (permalink / raw)
To: stephen; +Cc: netdev, roopa, shm, sfeldma
In-Reply-To: <20140120222505.6206.85084.stgit@debian>
Stephen, please note that this patch was replaced by following patchset:
[patch iproute2 net-next-for-3.13 0/2] iplink: add support for bonding slave
[patch iproute2 net-next-for-3.13 1/2] introduce support for slave info data
[patch iproute2 net-next-for-3.13 2/2] iplink: add support for bonding slave
Thanks.
Mon, Jan 20, 2014 at 11:25:05PM CET, sfeldma@cumulusnetworks.com wrote:
>Show slave details for link when slave has IFLA_SLAVE attributes, e.g.:
>
>ip -d link show eth4
>6: eth4: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond1 state UP mode DEFAULT group default qlen 1000
> link/ether 00:02:00:00:04:03 brd ff:ff:ff:ff:ff:ff promiscuity 1
> slave state ACTIVE mii_status UP link_failure_count 0 perm_hwaddr 00:02:00:00:04:03 queue_id 0 ad_aggregator_id 1
>---
> include/linux/if_link.h | 13 +++++++++
> ip/ipaddress.c | 71 +++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 84 insertions(+)
>
>diff --git a/include/linux/if_link.h b/include/linux/if_link.h
>index 098be3d..7f956f6 100644
>--- a/include/linux/if_link.h
>+++ b/include/linux/if_link.h
>@@ -144,6 +144,7 @@ enum {
> IFLA_NUM_RX_QUEUES,
> IFLA_CARRIER,
> IFLA_PHYS_PORT_ID,
>+ IFLA_SLAVE,
> __IFLA_MAX
> };
>
>@@ -366,6 +367,18 @@ enum {
>
> #define IFLA_BOND_AD_INFO_MAX (__IFLA_BOND_AD_INFO_MAX - 1)
>
>+enum {
>+ IFLA_SLAVE_STATE,
>+ IFLA_SLAVE_MII_STATUS,
>+ IFLA_SLAVE_LINK_FAILURE_COUNT,
>+ IFLA_SLAVE_PERM_HWADDR,
>+ IFLA_SLAVE_QUEUE_ID,
>+ IFLA_SLAVE_AD_AGGREGATOR_ID,
>+ __IFLA_SLAVE_MAX,
>+};
>+
>+#define IFLA_SLAVE_MAX (__IFLA_SLAVE_MAX - 1)
>+
> /* SR-IOV virtual function management section */
>
> enum {
>diff --git a/ip/ipaddress.c b/ip/ipaddress.c
>index d02eaaf..a0d3ab8 100644
>--- a/ip/ipaddress.c
>+++ b/ip/ipaddress.c
>@@ -27,6 +27,7 @@
>
> #include <linux/netdevice.h>
> #include <linux/if_arp.h>
>+#include <linux/if_bonding.h>
> #include <linux/sockios.h>
>
> #include "rt_names.h"
>@@ -223,6 +224,73 @@ static void print_linktype(FILE *fp, struct rtattr *tb)
> }
> }
>
>+static const char *slave_states[] = {
>+ [BOND_STATE_ACTIVE] = "ACTIVE",
>+ [BOND_STATE_BACKUP] = "BACKUP",
>+};
>+
>+static void print_slave_state(FILE *f, struct rtattr *tb)
>+{
>+ unsigned int state = rta_getattr_u8(tb);
>+
>+ if (state >= sizeof(slave_states) / sizeof(slave_states[0]))
>+ fprintf(f, "state %d ", state);
>+ else
>+ fprintf(f, "state %s ", slave_states[state]);
>+}
>+
>+static const char *slave_mii_status[] = {
>+ [BOND_LINK_UP] = "UP",
>+ [BOND_LINK_FAIL] = "GOING_DOWN",
>+ [BOND_LINK_DOWN] = "DOWN",
>+ [BOND_LINK_BACK] = "GOING_BACK",
>+};
>+
>+static void print_slave_mii_status(FILE *f, struct rtattr *tb)
>+{
>+ unsigned int status = rta_getattr_u8(tb);
>+
>+ if (status >= sizeof(slave_mii_status) / sizeof(slave_mii_status[0]))
>+ fprintf(f, "mii_status %d ", status);
>+ else
>+ fprintf(f, "mii_status %s ", slave_mii_status[status]);
>+}
>+
>+static void print_slave(FILE *fp, struct rtattr *tb)
>+{
>+ struct rtattr *slave[IFLA_SLAVE_MAX+1];
>+ SPRINT_BUF(b1);
>+
>+ parse_rtattr_nested(slave, IFLA_SLAVE_MAX, tb);
>+
>+ if (!slave[IFLA_SLAVE_STATE])
>+ return;
>+
>+ fprintf(fp, "%s slave ", _SL_);
>+ print_slave_state(fp, slave[IFLA_SLAVE_STATE]);
>+
>+ if (slave[IFLA_SLAVE_MII_STATUS])
>+ print_slave_mii_status(fp, slave[IFLA_SLAVE_MII_STATUS]);
>+
>+ if (slave[IFLA_SLAVE_LINK_FAILURE_COUNT])
>+ fprintf(fp, "link_failure_count %d ",
>+ rta_getattr_u32(slave[IFLA_SLAVE_LINK_FAILURE_COUNT]));
>+
>+ if (slave[IFLA_SLAVE_PERM_HWADDR])
>+ fprintf(fp, "perm_hwaddr %s ",
>+ ll_addr_n2a(RTA_DATA(slave[IFLA_SLAVE_PERM_HWADDR]),
>+ RTA_PAYLOAD(slave[IFLA_SLAVE_PERM_HWADDR]),
>+ 0, b1, sizeof(b1)));
>+
>+ if (slave[IFLA_SLAVE_QUEUE_ID])
>+ fprintf(fp, "queue_id %d ",
>+ rta_getattr_u16(slave[IFLA_SLAVE_QUEUE_ID]));
>+
>+ if (slave[IFLA_SLAVE_AD_AGGREGATOR_ID])
>+ fprintf(fp, "ad_aggregator_id %d ",
>+ rta_getattr_u16(slave[IFLA_SLAVE_AD_AGGREGATOR_ID]));
>+}
>+
> static void print_vfinfo(FILE *fp, struct rtattr *vfinfo)
> {
> struct ifla_vf_mac *vf_mac;
>@@ -516,6 +584,9 @@ int print_linkinfo(const struct sockaddr_nl *who,
> print_vfinfo(fp, i);
> }
>
>+ if (do_link && tb[IFLA_SLAVE] && show_details)
>+ print_slave(fp, tb[IFLA_SLAVE]);
>+
> fprintf(fp, "\n");
> fflush(fp);
> return 0;
>
>--
>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: Correctly sync addresses from multiple sources to single device
From: Andrey Dmitrov @ 2014-01-24 11:33 UTC (permalink / raw)
To: Vlad Yasevich; +Cc: netdev, Alexandra N. Kossovsky, Konstantin Ushakov
In-Reply-To: <1390413255-32223-1-git-send-email-vyasevic@redhat.com>
On 01/22/2014 09:54 PM, Vlad Yasevich wrote:
> When we have multiple devices attempting to sync the same address
> to a single destination, each device should be permitted to sync
> it once. To accomplish this, pass the 'sync_cnt' of the source
> address when adding the addresss to the lower device. 'sync_cnt'
> tracks how many time a given address has been succefully synced.
> This way, we know that if the 'sync_cnt' passed in is 0, we should
> sync this address.
>
> Also, turn 'synced' member back into the counter as was originally
> done in
> commit 4543fbefe6e06a9e40d9f2b28d688393a299f079.
> net: count hw_addr syncs so that unsync works properly.
> It tracks how many time a given address has been added via a
> 'sync' operation. For every successfull 'sync' the counter is
> incremented, and for ever 'unsync', the counter is decremented.
> This makes sure that the address will be properly removed from
> the the lower device when all the upper devices have removed it.
>
> Reported-by: Andrey Dmitrov <andrey.dmitrov@oktetlabs.ru>
> CC: Andrey Dmitrov <andrey.dmitrov@oktetlabs.ru>
> CC: Alexandra N. Kossovsky <Alexandra.Kossovsky@oktetlabs.ru>
> CC: Konstantin Ushakov <Konstantin.Ushakov@oktetlabs.ru>
> Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
> ---
> net/core/dev_addr_lists.c | 18 ++++++++++--------
> 1 file changed, 10 insertions(+), 8 deletions(-)
>
> diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c
> index ec40a84..9974f48 100644
> --- a/net/core/dev_addr_lists.c
> +++ b/net/core/dev_addr_lists.c
> @@ -38,7 +38,7 @@ static int __hw_addr_create_ex(struct netdev_hw_addr_list *list,
> ha->type = addr_type;
> ha->refcount = 1;
> ha->global_use = global;
> - ha->synced = sync;
> + ha->synced = sync ? 1 : 0;
> ha->sync_cnt = 0;
> list_add_tail_rcu(&ha->list, &list->list);
> list->count++;
> @@ -48,7 +48,8 @@ static int __hw_addr_create_ex(struct netdev_hw_addr_list *list,
>
> static int __hw_addr_add_ex(struct netdev_hw_addr_list *list,
> const unsigned char *addr, int addr_len,
> - unsigned char addr_type, bool global, bool sync)
> + unsigned char addr_type, bool global, bool sync,
> + int sync_count)
> {
> struct netdev_hw_addr *ha;
>
> @@ -66,10 +67,10 @@ static int __hw_addr_add_ex(struct netdev_hw_addr_list *list,
> ha->global_use = true;
> }
> if (sync) {
> - if (ha->synced)
> + if (ha->synced && sync_count)
> return -EEXIST;
> else
> - ha->synced = true;
> + ha->synced++;
> }
> ha->refcount++;
> return 0;
> @@ -84,7 +85,8 @@ static int __hw_addr_add(struct netdev_hw_addr_list *list,
> const unsigned char *addr, int addr_len,
> unsigned char addr_type)
> {
> - return __hw_addr_add_ex(list, addr, addr_len, addr_type, false, false);
> + return __hw_addr_add_ex(list, addr, addr_len, addr_type, false, false,
> + 0);
> }
>
> static int __hw_addr_del_entry(struct netdev_hw_addr_list *list,
> @@ -101,7 +103,7 @@ static int __hw_addr_del_entry(struct netdev_hw_addr_list *list,
> ha->global_use = false;
>
> if (sync)
> - ha->synced = false;
> + ha->synced--;
>
> if (--ha->refcount)
> return 0;
> @@ -139,7 +141,7 @@ static int __hw_addr_sync_one(struct netdev_hw_addr_list *to_list,
> int err;
>
> err = __hw_addr_add_ex(to_list, ha->addr, addr_len, ha->type,
> - false, true);
> + false, true, ha->sync_cnt);
> if (err && err != -EEXIST)
> return err;
>
> @@ -676,7 +678,7 @@ static int __dev_mc_add(struct net_device *dev, const unsigned char *addr,
>
> netif_addr_lock_bh(dev);
> err = __hw_addr_add_ex(&dev->mc, addr, dev->addr_len,
> - NETDEV_HW_ADDR_T_MULTICAST, global, false);
> + NETDEV_HW_ADDR_T_MULTICAST, global, false, 0);
> if (!err)
> __dev_set_rx_mode(dev);
> netif_addr_unlock_bh(dev);
Everything works properly now. The patch has been tested with linux-3.12.6.
Thanks,
Andrey
^ permalink raw reply
* Re: [Xen-devel] [PATCH net-next v4] xen-netfront: clean up code in xennet_release_rx_bufs
From: annie li @ 2014-01-24 11:05 UTC (permalink / raw)
To: David Vrabel; +Cc: netdev, wei.liu2, ian.campbell, xen-devel
In-Reply-To: <52E24507.8060402@citrix.com>
On 2014/1/24 18:48, David Vrabel wrote:
> On 24/01/14 03:28, Annie Li wrote:
>> From: Annie Li <annie.li@oracle.com>
>>
>> This patch removes grant transfer releasing code from netfront, and uses
>> gnttab_end_foreign_access to end grant access since
>> gnttab_end_foreign_access_ref may fail when the grant entry is
>> currently used for reading or writing.
>>
>> * clean up grant transfer code kept from old netfront(2.6.18) which grants
>> pages for access/map and transfer. But grant transfer is deprecated in current
>> netfront, so remove corresponding release code for transfer.
>>
>> * release grant access (through gnttab_end_foreign_access) and skb for tx/rx path,
>> use get_page to ensure page is released when grant access is completed successfully.
>>
>> Xen-blkfront/xen-tpmfront/xen-pcifront also have similar issue, but patches
>> for them will be created separately.
> ...
>> @@ -1439,8 +1403,11 @@ static int netfront_probe(struct xenbus_device *dev,
>> static void xennet_end_access(int ref, void *page)
>> {
>> /* This frees the page as a side-effect */
>> - if (ref != GRANT_INVALID_REF)
>> + if (ref != GRANT_INVALID_REF) {
>> + get_page(virt_to_page(page));
>> gnttab_end_foreign_access(ref, 0, (unsigned long)page);
>> + free_page((unsigned long)page);
>> + }
>> }
Oh, these code were kept from my debug, will remove it.
Thanks
Annie
> Please drop this hunk.
>
> Otherwise,
>
> Reviewed-by: David Vrabel <david.vrabel@citrix.com>
>
> David
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
^ permalink raw reply
* Re: [Xen-devel] [PATCH v6] xen/grant-table: Avoid m2p_override during mapping
From: David Vrabel @ 2014-01-24 10:57 UTC (permalink / raw)
To: Matt Wilson
Cc: Zoltan Kiss, jonathan.davies, wei.liu2, ian.campbell, netdev,
linux-kernel, Anthony Liguori, xen-devel, Matt Wilson
In-Reply-To: <20140124054828.GA18522@u109add4315675089e695.ant.amazon.com>
On 24/01/14 05:48, Matt Wilson wrote:
> On Thu, Jan 23, 2014 at 09:23:44PM +0000, Zoltan Kiss wrote:
>> The grant mapping API does m2p_override unnecessarily: only gntdev needs it,
>> for blkback and future netback patches it just cause a lock contention, as
>> those pages never go to userspace. Therefore this series does the following:
>> - the original functions were renamed to __gnttab_[un]map_refs, with a new
>> parameter m2p_override
>> - based on m2p_override either they follow the original behaviour, or just set
>> the private flag and call set_phys_to_machine
>> - gnttab_[un]map_refs are now a wrapper to call __gnttab_[un]map_refs with
>> m2p_override false
>> - a new function gnttab_[un]map_refs_userspace provides the old behaviour
>>
>> It also removes a stray space from page.h and change ret to 0 if
>> XENFEAT_auto_translated_physmap, as that is the only possible return value
>> there.
>>
>> v2:
>> - move the storing of the old mfn in page->index to gnttab_map_refs
>> - move the function header update to a separate patch
>>
>> v3:
>> - a new approach to retain old behaviour where it needed
>> - squash the patches into one
>>
>> v4:
>> - move out the common bits from m2p* functions, and pass pfn/mfn as parameter
>> - clear page->private before doing anything with the page, so m2p_find_override
>> won't race with this
>>
>> v5:
>> - change return value handling in __gnttab_[un]map_refs
>> - remove a stray space in page.h
>> - add detail why ret = 0 now at some places
>>
>> v6:
>> - don't pass pfn to m2p* functions, just get it locally
>>
>> Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com>
>> Suggested-by: David Vrabel <david.vrabel@citrix.com>
>
> Apologies for coming in late on this thread. I'm quite behind on
> xen-devel mail that isn't CC: to me.
>
> It seems to have been forgotten that Anthony and I proposed a similar
> change last November.
>
> https://lkml.kernel.org/r/1384307336-5328-1-git-send-email-anthony@codemonkey.ws
>
> Or am I misunderstanding the change?
Yes, it's equivalent. There doesn't seem to have been a follow up patch
posted for Anthony's patch so it's not surprising that it's fallen
through the cracks.
David
^ permalink raw reply
* Re: [PATCH v2 1/2] can: Decrease default size of CAN_RAW socket send queue
From: Michal Sojka @ 2014-01-24 10:51 UTC (permalink / raw)
To: David Miller, mkl; +Cc: linux-can, netdev
In-Reply-To: <20140123.144243.998328685775607324.davem@davemloft.net>
On Thu, Jan 23 2014, David Miller wrote:
> From: Michal Sojka <sojkam1@fel.cvut.cz>
> Date: Wed, 22 Jan 2014 09:27:36 +0100
>
>> Since the length of the qdisc queue was set by default to 10
>> packets, this is exactly what was happening.
>
> This is your bug, set the qdisc limit to something more reasonable.
This is what that patch does. It increases qdisc limit from 10 to 100.
> What do you think UDP applications have to do on slow interfaces?
> If they care about overrunning the device queue and getting packet
> drops, they themselves set a smaller socket send buffer size.
>
> CAN is not special in this regard, please stop treating it as such.
CAN is different from UDP in that it cannot send big datagrams. So it
makes sense to change the default sk_sndbuf value. Otherwise, you're
right. I've checked that skb->truesize is the same for small UDP
datagrams and CAN frames.
What about the following?
----8<--------8<-----
Subject: [PATCH v3] can: Decrease default size of CAN_RAW socket send queue
This fixes the infamous ENOBUFS problem, which appears when an
application sends CAN frames faster than they leave the interface.
Packets for sending can be queued at queueing discipline. Qdisc queue
has two limits: maximum length and per-socket byte limit (SO_SNDBUF).
Only the later limit can cause the sender to block. If maximum queue
length limit is reached before the per-socket limit, the application
receives ENOBUFS and there is no way how it can wait for the queue to
become free again. Since the length of the qdisc queue was set by
default to 10 packets, this is exactly what was happening.
This patch decreases the default per-socket limit to the minimum value
(which corresponds to approximately 11 CAN frames) and increases the
length of the qdisc queue to 100 frames. This setting allows for at
least 9 CAN_RAW sockets to send simultaneously to the same CAN
interface without getting ENOBUFS errors.
The exact maximum number of CAN frames that fit into the per-socket
limit is: 1+floor(sk_sndbuf/skb->truesize). On my 32 bit PowerPC
system, skb->truesize = 448 and SOCK_MIN_SNDBUF = 4480. This gives the
limit of 1+floor(4480/448) = 11 CAN frames.
Changes since v2:
- Used SOCK_MIN_SNDBUF instead of a custom lower value.
- Dropped second patch that set SOCK_MIN_SNDBUF differently for
AF_CAN.
Changes since v1:
- Improved the commit message, added some number from my system.
Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
---
drivers/net/can/dev.c | 2 +-
net/can/raw.c | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index 1870c47..a0bce83 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -492,7 +492,7 @@ static void can_setup(struct net_device *dev)
dev->mtu = CAN_MTU;
dev->hard_header_len = 0;
dev->addr_len = 0;
- dev->tx_queue_len = 10;
+ dev->tx_queue_len = 100;
/* New-style flags. */
dev->flags = IFF_NOARP;
diff --git a/net/can/raw.c b/net/can/raw.c
index fdda5f6..4293197 100644
--- a/net/can/raw.c
+++ b/net/can/raw.c
@@ -291,6 +291,9 @@ static int raw_init(struct sock *sk)
{
struct raw_sock *ro = raw_sk(sk);
+ /* This limits the number of queued CAN frames to approximately 11 */
+ sk->sk_sndbuf = SOCK_MIN_SNDBUF;
+
ro->bound = 0;
ro->ifindex = 0;
--
1.8.5.2
^ permalink raw reply related
* Re: [Xen-devel] [PATCH net-next v4] xen-netfront: clean up code in xennet_release_rx_bufs
From: David Vrabel @ 2014-01-24 10:48 UTC (permalink / raw)
To: Annie Li; +Cc: xen-devel, netdev, konrad.wilk, ian.campbell, wei.liu2
In-Reply-To: <1390534095-5097-1-git-send-email-Annie.li@oracle.com>
On 24/01/14 03:28, Annie Li wrote:
> From: Annie Li <annie.li@oracle.com>
>
> This patch removes grant transfer releasing code from netfront, and uses
> gnttab_end_foreign_access to end grant access since
> gnttab_end_foreign_access_ref may fail when the grant entry is
> currently used for reading or writing.
>
> * clean up grant transfer code kept from old netfront(2.6.18) which grants
> pages for access/map and transfer. But grant transfer is deprecated in current
> netfront, so remove corresponding release code for transfer.
>
> * release grant access (through gnttab_end_foreign_access) and skb for tx/rx path,
> use get_page to ensure page is released when grant access is completed successfully.
>
> Xen-blkfront/xen-tpmfront/xen-pcifront also have similar issue, but patches
> for them will be created separately.
...
> @@ -1439,8 +1403,11 @@ static int netfront_probe(struct xenbus_device *dev,
> static void xennet_end_access(int ref, void *page)
> {
> /* This frees the page as a side-effect */
> - if (ref != GRANT_INVALID_REF)
> + if (ref != GRANT_INVALID_REF) {
> + get_page(virt_to_page(page));
> gnttab_end_foreign_access(ref, 0, (unsigned long)page);
> + free_page((unsigned long)page);
> + }
> }
Please drop this hunk.
Otherwise,
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
David
^ permalink raw reply
* Re: [PATCH 4/4 v3] ipv4: mark nexthop as dead when it's subnet becomes
From: Sergey Popovich @ 2014-01-24 10:26 UTC (permalink / raw)
To: netdev
In-Reply-To: <3898551.8JLk8eulsc@tuxracer>
Please ignore this mail. MUA line wrapping issues. Sorry.
^ permalink raw reply
* [PATCH 4/4 v3] ipv4: mark nexthop as dead when it's subnet becomes unreachable
From: Sergey Popovich @ 2014-01-24 10:25 UTC (permalink / raw)
To: netdev
In-Reply-To: <2039386.VZO3kUlZdW@tuxracer>
Removing ip address and it's subnet route using fib_del_ifaddr() does
not purge routes with nexthop in such subnet.
This could be easily reproduced with the following config:
ip link add dev dummy1 type dummy
ip link set up dev dummy1
ip -4 addr add 10.0.10.1/24 dev dummy1
ip -4 addr add 10.0.20.1/24 dev dummy1
ip -4 route add 172.16.0.0/12 proto static via 10.0.10.5
ip -4 route show exact 172.16.0.0/12
172.16.0.0/12 via 10.0.10.5 dev dummy1 proto static
ip -4 addr del 10.0.10.1/24 dev dummy1
ip -4 route show exact 172.16.0.0/12
172.16.0.0/12 via 10.0.10.5 dev dummy1 proto static
Add interface address (ifa) parameter to fib_sync_down_dev()
and use it to match nexthop against it's subnet.
Use fib_sync_down_dev() in fib_del_ifaddr() among with fib_sync_down_addr()
to mark as dead routes with nexthop in ifa.
v3. Fix NH marking as dead when NH gateway subnet is still on
interface (e.g. 10.0.10.1/24 and 10.0.30.1/16 and NH is 10.0.10.5).
Thanks to Julian Anastasov.
v2. Fix NH marking as dead when NH created with onlink option.
Signed-off-by: Sergey Popovich <popovich_sergei@mail.ru>
---
include/net/ip_fib.h | 3 ++-
net/ipv4/fib_frontend.c | 5 +++--
net/ipv4/fib_semantics.c | 29 +++++++++++++++++++++++++++--
3 files changed, 32 insertions(+), 5 deletions(-)
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index 9922093..0405fc9 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -287,8 +287,9 @@ static inline int fib_num_tclassid_users(struct net *net)
#endif
/* Exported by fib_semantics.c */
+struct in_ifaddr;
int ip_fib_check_default(__be32 gw, struct net_device *dev);
-int fib_sync_down_dev(struct net_device *dev, int force);
+int fib_sync_down_dev(struct net_device *dev, struct in_ifaddr *ifa, int force);
int fib_sync_down_addr(struct net *net, __be32 local);
int fib_sync_up(struct net_device *dev);
void fib_select_multipath(struct fib_result *res);
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index ae5f35f..fd3445e 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -907,7 +907,8 @@ void fib_del_ifaddr(struct in_ifaddr *ifa, struct in_ifaddr *iprim)
* First of all, we scan fib_info list searching
* for stray nexthop entries, then ignite fib_flush.
*/
- if (fib_sync_down_addr(dev_net(dev), ifa->ifa_local))
+ if (fib_sync_down_addr(dev_net(dev), ifa->ifa_local) +
+ fib_sync_down_dev(dev, ifa, 0))
fib_flush(dev_net(dev));
}
}
@@ -997,7 +998,7 @@ static void nl_fib_lookup_exit(struct net *net)
static void fib_disable_ip(struct net_device *dev, int force)
{
- if (fib_sync_down_dev(dev, force))
+ if (fib_sync_down_dev(dev, NULL, force))
fib_flush(dev_net(dev));
rt_cache_flush(dev_net(dev));
arp_ifdown(dev);
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 9d43468..fbebba5 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -1112,7 +1112,29 @@ int fib_sync_down_addr(struct net *net, __be32 local)
return ret;
}
-int fib_sync_down_dev(struct net_device *dev, int force)
+static inline bool fib_sync_down_gw(struct fib_nh *nh,
+ struct in_ifaddr *ifr)
+{
+ if (!ifr)
+ return true;
+
+ if (nh->nh_flags & RTNH_F_ONLINK)
+ return false;
+
+ if (!inet_ifa_match(nh->nh_gw, ifr))
+ return false;
+
+ for_ifa(ifr->ifa_dev) {
+ if (unlikely(ifa == ifr))
+ continue;
+ if (inet_ifa_match(nh->nh_gw, ifa))
+ return false;
+ } endfor_ifa(ifr->ifa_dev);
+
+ return true;
+}
+
+int fib_sync_down_dev(struct net_device *dev, struct in_ifaddr *ifa, int force)
{
int ret = 0;
int scope = RT_SCOPE_NOWHERE;
@@ -1124,6 +1146,8 @@ int fib_sync_down_dev(struct net_device *dev, int force)
if (force)
scope = -1;
+ BUG_ON(ifa && ifa->ifa_dev->dev != dev);
+
hlist_for_each_entry(nh, head, nh_hash) {
struct fib_info *fi = nh->nh_parent;
int dead;
@@ -1137,7 +1161,8 @@ int fib_sync_down_dev(struct net_device *dev, int force)
if (nexthop_nh->nh_flags & RTNH_F_DEAD)
dead++;
else if (nexthop_nh->nh_dev == dev &&
- nexthop_nh->nh_scope != scope) {
+ nexthop_nh->nh_scope != scope &&
+ fib_sync_down_gw(nexthop_nh, ifa)) {
nexthop_nh->nh_flags |= RTNH_F_DEAD;
#ifdef CONFIG_IP_ROUTE_MULTIPATH
spin_lock_bh(&fib_multipath_lock);
--
1.8.3.4
^ permalink raw reply related
* [PATCH 4/4 v3] ipv4: mark nexthop as dead when it's subnet becomes
From: Sergey Popovich @ 2014-01-24 10:15 UTC (permalink / raw)
To: netdev
In-Reply-To: <alpine.LFD.2.11.1401232221010.1667@ja.home.ssi.bg>
Removing ip address and it's subnet route using fib_del_ifaddr() does
not purge routes with nexthop in such subnet.
This could be easily reproduced with the following config:
ip link add dev dummy1 type dummy
ip link set up dev dummy1
ip -4 addr add 10.0.10.1/24 dev dummy1
ip -4 addr add 10.0.20.1/24 dev dummy1
ip -4 route add 172.16.0.0/12 proto static via 10.0.10.5
ip -4 route show exact 172.16.0.0/12
172.16.0.0/12 via 10.0.10.5 dev dummy1 proto static
ip -4 addr del 10.0.10.1/24 dev dummy1
ip -4 route show exact 172.16.0.0/12
172.16.0.0/12 via 10.0.10.5 dev dummy1 proto static
Add interface address (ifa) parameter to fib_sync_down_dev()
and use it to match nexthop against it's subnet.
Use fib_sync_down_dev() in fib_del_ifaddr() among with fib_sync_down_addr()
to mark as dead routes with nexthop in ifa.
v3. Fix NH marking as dead when NH gateway subnet is still on
interface (e.g. 10.0.10.1/24 and 10.0.30.1/16 and NH is 10.0.10.5).
Thanks to Julian Anastasov.
v2. Fix NH marking as dead when NH created with onlink option.
Signed-off-by: Sergey Popovich <popovich_sergei@mail.ru>
---
include/net/ip_fib.h | 3 ++-
net/ipv4/fib_frontend.c | 5 +++--
net/ipv4/fib_semantics.c | 29 +++++++++++++++++++++++++++--
3 files changed, 32 insertions(+), 5 deletions(-)
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index 9922093..0405fc9 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -287,8 +287,9 @@ static inline int fib_num_tclassid_users(struct net *net)
#endif
/* Exported by fib_semantics.c */
+struct in_ifaddr;
int ip_fib_check_default(__be32 gw, struct net_device *dev);
-int fib_sync_down_dev(struct net_device *dev, int force);
+int fib_sync_down_dev(struct net_device *dev, struct in_ifaddr *ifa, int
force);
int fib_sync_down_addr(struct net *net, __be32 local);
int fib_sync_up(struct net_device *dev);
void fib_select_multipath(struct fib_result *res);
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index ae5f35f..fd3445e 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -907,7 +907,8 @@ void fib_del_ifaddr(struct in_ifaddr *ifa, struct
in_ifaddr *iprim)
* First of all, we scan fib_info list searching
* for stray nexthop entries, then ignite fib_flush.
*/
- if (fib_sync_down_addr(dev_net(dev), ifa->ifa_local))
+ if (fib_sync_down_addr(dev_net(dev), ifa->ifa_local) +
+ fib_sync_down_dev(dev, ifa, 0))
fib_flush(dev_net(dev));
}
}
@@ -997,7 +998,7 @@ static void nl_fib_lookup_exit(struct net *net)
static void fib_disable_ip(struct net_device *dev, int force)
{
- if (fib_sync_down_dev(dev, force))
+ if (fib_sync_down_dev(dev, NULL, force))
fib_flush(dev_net(dev));
rt_cache_flush(dev_net(dev));
arp_ifdown(dev);
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 9d43468..fbebba5 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -1112,7 +1112,29 @@ int fib_sync_down_addr(struct net *net, __be32 local)
return ret;
}
-int fib_sync_down_dev(struct net_device *dev, int force)
+static inline bool fib_sync_down_gw(struct fib_nh *nh,
+ struct in_ifaddr *ifr)
+{
+ if (!ifr)
+ return true;
+
+ if (nh->nh_flags & RTNH_F_ONLINK)
+ return false;
+
+ if (!inet_ifa_match(nh->nh_gw, ifr))
+ return false;
+
+ for_ifa(ifr->ifa_dev) {
+ if (unlikely(ifa == ifr))
+ continue;
+ if (inet_ifa_match(nh->nh_gw, ifa))
+ return false;
+ } endfor_ifa(ifr->ifa_dev);
+
+ return true;
+}
+
+int fib_sync_down_dev(struct net_device *dev, struct in_ifaddr *ifa, int
force)
{
int ret = 0;
int scope = RT_SCOPE_NOWHERE;
@@ -1124,6 +1146,8 @@ int fib_sync_down_dev(struct net_device *dev, int force)
if (force)
scope = -1;
+ BUG_ON(ifa && ifa->ifa_dev->dev != dev);
+
hlist_for_each_entry(nh, head, nh_hash) {
struct fib_info *fi = nh->nh_parent;
int dead;
@@ -1137,7 +1161,8 @@ int fib_sync_down_dev(struct net_device *dev, int force)
if (nexthop_nh->nh_flags & RTNH_F_DEAD)
dead++;
else if (nexthop_nh->nh_dev == dev &&
- nexthop_nh->nh_scope != scope) {
+ nexthop_nh->nh_scope != scope &&
+ fib_sync_down_gw(nexthop_nh, ifa)) {
nexthop_nh->nh_flags |= RTNH_F_DEAD;
#ifdef CONFIG_IP_ROUTE_MULTIPATH
spin_lock_bh(&fib_multipath_lock);
--
1.8.3.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