* Re: [PATCH] net: ICMPv6 packets transmitted on wrong interface if nfmark is mangled
From: David Miller @ 2012-12-03 19:11 UTC (permalink / raw)
To: dries.dewinter; +Cc: pablo, kaber, netdev, netfilter-devel
In-Reply-To: <1354538763-2678-1-git-send-email-dries.dewinter@gmail.com>
From: Dries De Winter <dries.dewinter@gmail.com>
Date: Mon, 3 Dec 2012 13:46:03 +0100
> The IPv6 mangle table may change the source/destination address and skb->mark
> of a packet. Therefore it may be necessary to "reroute" a packet after it
> traversed this table. But this should not happen for some special packets like
> neighbour solicitations and MLD reports: they have an explicit destination, not
> originating from the routing table. Rerouting these packets may cause them to
> go out on the wrong interface or not to go out at all depending on the routing
> table.
>
> This patch allows to mark a dst_entry as "non-reroutable". icmp6_dst_alloc()
> (used by ndisc and MLD implementation) will always mark the allocated dst_entry
> as such. A check is added to netfilter (IPv6-only) so packets heading for a
> non-reroutable destination are never rerouted.
>
> Remarks:
>
> (1) dst entries allocated by addrconf_dst_alloc() are added to the routing
> table like normal routes and skbuffs get assigned such dst entries by normal
> rule lookup / route lookup. Therefore it's not needed to mark those dst
> entries as non-reroutable: if an skbuff got assigned such a dst entry by
> normal routing in the first place, and the changes done by the mangle table
> don't affect routing, rerouting the packet will get it there too.
>
> (2) Similar logic exists in IPv4 so local multicast/broadcast messages are
> potentially transmitted on the wrong interface. However, it's a less likely
> corner case there because those packets are treated differently by local
> output routing: multicast/broadcast messages are by default routed to the
> interface with a matching source IP-address. But this logic is invalid because
> it is allowed to (1) send messages with a source IP-address different from
> your own and (2) to assign the same IP-address on multiple interfaces.
> So ideally in IPv4 some dsts should be marked as non-reroutable as well.
>
> Signed-off-by: Dries De Winter <dries.dewinter@gmail.com>
Thinking about this some more I can't see how this is correct.
What if netfilter modified one of the keys that go into the route
lookup such as the source or destination address?
That's the whole point of this reroute call.
I'm not applying this, sorry.
^ permalink raw reply
* Re: [PATCH V3 1/5] cxgb4: Add T4 filter support
From: David Miller @ 2012-12-03 19:02 UTC (permalink / raw)
To: vipul-ut6Up61K2wZBDgjK7y7TUQ
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
roland-BHEL68pLQRGGvPXPguhicg, divy-ut6Up61K2wZBDgjK7y7TUQ,
dm-ut6Up61K2wZBDgjK7y7TUQ, kumaras-ut6Up61K2wZBDgjK7y7TUQ,
swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW,
abhishek-ut6Up61K2wZBDgjK7y7TUQ
In-Reply-To: <1354533781-31575-2-git-send-email-vipul-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
From: Vipul Pandya <vipul-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
Date: Mon, 3 Dec 2012 16:52:57 +0530
> + /*
> + * If the new or old filter have loopback rewriteing rules then we'll
> + * need to free any existing Layer Two Table (L2T) entries of the old
> + * filter rule. The firmware will handle freeing up any Source MAC
> + * Table (SMT) entries used for rewriting Source MAC Addresses in
> + * loopback rules.
> + */
> + if (f->l2t)
> + cxgb4_l2t_release(f->l2t);
> +
> + /* The zeroing of the filter rule below clears the filter valid,
> + * pending, locked flags, l2t pointer, etc. so it's all we need for
> + * this operation.
> + */
My greatest amusement is achieved when someone gets a code formatting
rule both correct and wrong in the same patch, as you have done here.
Format comments in the networking:
/* Like
* this.
*/
/*
* Never,
* like this.
*/
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH net-next] ipv6: Make 'addrconf_rs_timer' send Router Solicitations (and re-arm itself) if Router Advertisements are accepted
From: David Miller @ 2012-12-03 19:00 UTC (permalink / raw)
To: shmulik.ladkani; +Cc: netdev, yoshfuji, tgraf, tore, amikoren
In-Reply-To: <1354448693-32155-1-git-send-email-shmulik.ladkani@gmail.com>
From: Shmulik Ladkani <shmulik.ladkani@gmail.com>
Date: Sun, 2 Dec 2012 13:44:53 +0200
> As of 026359b [ipv6: Send ICMPv6 RSes only when RAs are accepted],
> Router Solicitations are sent whenever kernel accepts Router
> Advertisements on the interface.
>
> However, this logic isn't reflected in 'addrconf_rs_timer'.
>
> The timer fails to issue subsequent RS messages (and fails to re-arm
> itself) if forwarding is enabled and the special hybrid mode is
> enabled (accept_ra=2).
>
> Fix the condition determining whether next RS should be sent, by using
> 'ipv6_accept_ra()'.
>
> Reported-by: Ami Koren <amikoren@yahoo.com>
> Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] ipv6: Fix default route failover when CONFIG_IPV6_ROUTER_PREF=n
From: David Miller @ 2012-12-03 18:59 UTC (permalink / raw)
To: pmarks; +Cc: yoshfuji, netdev
In-Reply-To: <1354442421-689-1-git-send-email-pmarks@google.com>
From: Paul Marks <pmarks@google.com>
Date: Sun, 2 Dec 2012 02:00:21 -0800
> I believe this commit from 2008 was incorrect:
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=398bcbebb6f721ac308df1e3d658c0029bb74503
>
> When CONFIG_IPV6_ROUTER_PREF is disabled, the kernel should follow
> RFC4861 section 6.3.6: if no route is NUD_VALID, then traffic should be
> sprayed across all routers (indirectly triggering NUD) until one of them
> becomes NUD_VALID.
>
> However, the following experiment demonstrates that this does not work:
>
> 1) Connect to an IPv6 network.
> 2) Change the router's MAC (and link-local) address.
>
> The kernel will lock onto the first router and never try the new one, even
> if the first becomes unreachable. This patch fixes the problem by
> allowing rt6_check_neigh() to return 0; if all routers return 0, then
> rt6_select() will fall back to round-robin behavior.
>
> This patch should have no effect when CONFIG_IPV6_ROUTER_PREF=y.
>
> Note that rt6_check_neigh() is only used in a boolean context, so the
> presence of both "m = 1" and "m = 2" was irrelevant and confusing.
>
> Signed-off-by: Paul Marks <pmarks@google.com>
The values '1' and '2' used to influence rt6_score_route() in different
ways.
Please change rt6_check_neigh() to return a "bool" if you are going to
do this.
Thanks.
^ permalink raw reply
* Re: [PATCH 1/1] net: mvneta: Remove unneeded version.h header inclusion
From: Thomas Petazzoni @ 2012-12-03 18:58 UTC (permalink / raw)
To: David Miller; +Cc: sachin.kamat, netdev, patches
In-Reply-To: <20121203.134620.972752091312747013.davem@davemloft.net>
Dear David Miller,
On Mon, 03 Dec 2012 13:46:20 -0500 (EST), David Miller wrote:
> From: Sachin Kamat <sachin.kamat@linaro.org>
> Date: Mon, 3 Dec 2012 15:15:28 +0530
>
> > linux/version.h inclusion is not necessary.
> >
> > Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
>
> Acked-by: David S. Miller <davem@davemloft.net>
>
> I hope the mvneta folks will pick this up and apply it where it
> needs to be as the mvneta driver isn't in the net-next tree.
Yes, I will pick it up, and send a pull request to the Marvell
maintainers. I have other mvneta fixes that I'll send together with
this one.
Thanks,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply
* Re: sky2: fix cleanup sequence in probe() function
From: David Miller @ 2012-12-03 18:53 UTC (permalink / raw)
To: LinoSanfilippo; +Cc: shemminger, mlindner, netdev
In-Reply-To: <20121201123928.GA3914@neptun>
From: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Date: Sat, 1 Dec 2012 13:39:28 +0100
> The cleanup sequence in sky2_probe() that is called in case of an error is
> mixed up in different places:
>
> - pci_disable_device() is not called in each case the device has been enabled
> before
>
> - same for pci_disable_msi(): test_msi() may return with an error != EOPNOTSUPP
> (due to failure of request_irq()). In that case msi is not disabled
>
> - also failure of register_netdev() does not disable msi
>
> This patch fixes the concerning parts.
>
> Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
This looks clearly correct to me, so I've applied it to net-next, thanks.
^ permalink raw reply
* Re: [PATCH 2/4 net-next] tg3: PTP - Implement the ptp api and ethtool functions
From: Richard Cochran @ 2012-12-03 18:51 UTC (permalink / raw)
To: Michael Chan; +Cc: davem, netdev, nsujir
In-Reply-To: <1354506171-1646-2-git-send-email-mchan@broadcom.com>
On Sun, Dec 02, 2012 at 07:42:49PM -0800, Michael Chan wrote:
> From: Matt Carlson <mcarlson@broadcom.com>
>
> This patch updates the ptp_caps structure with implementation functions.
> All the basic clock operations as described in
> Documentation/ptp/ptp.txt are supported.
>
> Frequency adjustment is performed using hardware with a 24 bit
> accumulator and a programmable correction value. On each clk, the
> correction value gets added to the accumulator and when it overflows,
> the time counter is incremented/decremented and the accumulator reset.
>
> So conversion from ppb to correction value is
> ppb * (1 << 24) / 1000000000
Are you sure about this? I don't know your hardware, but the others
ones with an addend and an accumulator work differently. Usually there
is a default addend based on the frequency ratio between the input
clock and the divided nominal clock. Then the ppb is applied to the
default addend.
For example, see how tmr_add is calculated in
Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
>
> Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
> ---
> drivers/net/ethernet/broadcom/tg3.c | 125 ++++++++++++++++++++++++++++++++++-
> 1 files changed, 123 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
> index 38047a9..a54d194 100644
> --- a/drivers/net/ethernet/broadcom/tg3.c
> +++ b/drivers/net/ethernet/broadcom/tg3.c
> @@ -5519,6 +5519,14 @@ static int tg3_setup_phy(struct tg3 *tp, int force_reset)
> return err;
> }
>
> +
> +static u64 tg3_refclk_read(struct tg3 *tp)
> +{
> + u64 stamp = tr32(TG3_EAV_REF_CLCK_LSB);
> +
> + return stamp | (u64) tr32(TG3_EAV_REF_CLCK_MSB) << 32;
> +}
> +
> static void tg3_refclk_write(struct tg3 *tp, u64 newval)
> {
> tw32(TG3_EAV_REF_CLCK_CTL, TG3_EAV_REF_CLCK_CTL_STOP);
> @@ -5527,14 +5535,127 @@ static void tg3_refclk_write(struct tg3 *tp, u64 newval)
> tw32_f(TG3_EAV_REF_CLCK_CTL, TG3_EAV_REF_CLCK_CTL_RESUME);
> }
>
> +static inline void tg3_full_lock(struct tg3 *tp, int irq_sync);
> +static inline void tg3_full_unlock(struct tg3 *tp);
> +static int tg3_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info)
> +{
> + struct tg3 *tp = netdev_priv(dev);
> +
> + info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
> + SOF_TIMESTAMPING_RX_SOFTWARE |
> + SOF_TIMESTAMPING_SOFTWARE |
> + SOF_TIMESTAMPING_TX_HARDWARE |
> + SOF_TIMESTAMPING_RX_HARDWARE |
> + SOF_TIMESTAMPING_RAW_HARDWARE;
> +
> + if (tp->ptp_clock)
> + info->phc_index = ptp_clock_index(tp->ptp_clock);
> + else
> + info->phc_index = -1;
> +
> + info->tx_types = (1 << HWTSTAMP_TX_OFF) |
> + (1 << HWTSTAMP_TX_ON);
> +
> + info->rx_filters = (1 << HWTSTAMP_FILTER_NONE) |
> + (1 << HWTSTAMP_FILTER_ALL);
> + return 0;
> +}
> +
> +static int tg3_ptp_adjfreq(struct ptp_clock_info *ptp, s32 ppb)
> +{
> + struct tg3 *tp = container_of(ptp, struct tg3, ptp_info);
> + bool neg_adj = false;
> + u32 correction = 0;
> +
> + if (ppb < 0) {
> + neg_adj = true;
> + ppb = -ppb;
> + }
> +
> + /* Frequency adjustment is performed using hardware with a 24 bit
> + * accumulator and a programmable correction value. On each clk, the
> + * correction value gets added to the accumulator and when it
> + * overflows, the time counter is incremented/decremented.
> + *
> + * So conversion from ppb to correction value is
> + * ppb * (1 << 24) / 1000000000
> + */
> + correction = div_u64((u64)ppb * (1 << 24), 1000000000ULL) &
> + TG3_EAV_REF_CLK_CORRECT_MASK;
> +
> + tg3_full_lock(tp, 0);
> +
> + if (correction)
> + tw32(TG3_EAV_REF_CLK_CORRECT_CTL,
> + TG3_EAV_REF_CLK_CORRECT_EN |
> + (neg_adj ? TG3_EAV_REF_CLK_CORRECT_NEG : 0) | correction);
> + else
> + tw32(TG3_EAV_REF_CLK_CORRECT_CTL, 0);
> +
> + tg3_full_unlock(tp);
> +
> + return 0;
> +}
> +
> +static int tg3_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
> +{
> + struct tg3 *tp = container_of(ptp, struct tg3, ptp_info);
> + tp->ptp_adjust += delta;
This 'ptp_adjust' should be placed under the lock. This races with the
reader method.
> + return 0;
> +}
> +
> +static int tg3_ptp_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
> +{
> + u64 ns;
> + u32 remainder;
> + struct tg3 *tp = container_of(ptp, struct tg3, ptp_info);
> +
> + tg3_full_lock(tp, 0);
> + ns = tg3_refclk_read(tp);
> + tg3_full_unlock(tp);
> + ns += tp->ptp_adjust;
> +
> + ts->tv_sec = div_u64_rem(ns, 1000000000, &remainder);
> + ts->tv_nsec = remainder;
> +
> + return 0;
> +}
> +
> +static int tg3_ptp_settime(struct ptp_clock_info *ptp,
> + const struct timespec *ts)
> +{
> + u64 ns;
> + struct tg3 *tp = container_of(ptp, struct tg3, ptp_info);
> +
> + ns = timespec_to_ns(ts);
> +
> + tg3_full_lock(tp, 0);
> + tg3_refclk_write(tp, ns);
> + tg3_full_unlock(tp);
> + tp->ptp_adjust = 0;
> +
> + return 0;
> +}
> +
> +static int tg3_ptp_enable(struct ptp_clock_info *ptp,
> + struct ptp_clock_request *rq, int on)
> +{
> + return -EOPNOTSUPP;
> +}
> +
> static const struct ptp_clock_info tg3_ptp_caps = {
> .owner = THIS_MODULE,
> .name = "",
> - .max_adj = 0,
> + .max_adj = 250000000,
> .n_alarm = 0,
> .n_ext_ts = 0,
> .n_per_out = 0,
> .pps = 0,
> + .adjfreq = tg3_ptp_adjfreq,
> + .adjtime = tg3_ptp_adjtime,
> + .gettime = tg3_ptp_gettime,
> + .settime = tg3_ptp_settime,
> + .enable = tg3_ptp_enable,
These are missing from patch #1.
> };
>
> static void tg3_ptp_init(struct tg3 *tp)
Thanks,
Richard
^ permalink raw reply
* Re: [RFT PATCH] 8139cp: properly support change of MTU values [v2]
From: David Miller @ 2012-12-03 18:52 UTC (permalink / raw)
To: jogreene; +Cc: netdev
In-Reply-To: <1354551573-23721-1-git-send-email-jogreene@redhat.com>
From: John Greene <jogreene@redhat.com>
Date: Mon, 3 Dec 2012 11:19:33 -0500
> The 8139cp driver has a change_mtu function that has not been
> enabled since the dawn of the git repository. However, the
> generic eth_change_mtu is not used in its place, so that
> invalid MTU values can be set on the interface.
>
> Original patch salvages the broken code for the single case of
> setting the MTU while the interface is down, which is safe
> and also includes the range check. Now enhanced to support up
> or down interface.
>
> v2: fix case where rxbufsz isn't changed in the up state case
>
> Original patch from
> http://lkml.indiana.edu/hypermail/linux/kernel/1202.2/00770.html
>
> Testing: has been test on virtual 8139cp setup without issue,
> have no access real hardware 8139cp, need testing help.
>
> Signed-off-by: "John Greene" <jogreene@redhat.com>
I've applied this to net-next, if it triggers any problems we have
some time to work it out before 3.8 is released.
^ permalink raw reply
* Re: [PATCH net-next] tuntap: attach queue 0 before registering netdevice
From: David Miller @ 2012-12-03 18:49 UTC (permalink / raw)
To: jasowang; +Cc: netdev, linux-kernel, jslaby
In-Reply-To: <1354504785-13036-1-git-send-email-jasowang@redhat.com>
From: Jason Wang <jasowang@redhat.com>
Date: Mon, 3 Dec 2012 11:19:45 +0800
> We attach queue 0 after registering netdevice currently. This leads to call
> netif_set_real_num_{tx|rx}_queues() after registering the netdevice. Since we
> allow tun/tap has a maximum of 1024 queues, this may lead a huge number of
> uevents to be injected to userspace since we create 2048 kobjects and then
> remove 2046. Solve this problem by attaching queue 0 and set the real number of
> queues before registering netdevice.
>
> Reported-by: Jiri Slaby <jslaby@suse.cz>
> Tested-by: Jiri Slaby <jslaby@suse.cz>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
Applied, thanks Jason.
^ permalink raw reply
* Re: [PATCH net 1/1] bnx2x: recognize fan failure
From: David Miller @ 2012-12-03 18:47 UTC (permalink / raw)
To: yuvalmin; +Cc: netdev, ariele, yaniv.rosner, eilong
In-Reply-To: <1354528609-17486-1-git-send-email-yuvalmin@broadcom.com>
From: "Yuval Mintz" <yuvalmin@broadcom.com>
Date: Mon, 3 Dec 2012 11:56:49 +0200
> From: Yaniv Rosner <yaniv.rosner@broadcom.com>
>
> If fan failure is detected, MCP prevents PCI I/O registers from being
> mapped to the bar, causing a fatal error as driver is unaware.
>
> This patch recognizes such an event occurred and gracefully terminates
> the probe process.
>
> Signed-off-by: Yaniv Rosner <yaniv.rosner@broadcom.com>
> Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
> ---
> Hi Dave,
>
> This patch prevents a fatal error on newer bnx2x boards.
>
> Please consider applying it to 'net'.
Too late, I've applied it to net-next. I'm not asking Linus to hold back
an already delayed released for such a rarely triggering issue such as this
one.
^ permalink raw reply
* Re: [PATCH 1/1] net: mvneta: Remove unneeded version.h header inclusion
From: David Miller @ 2012-12-03 18:46 UTC (permalink / raw)
To: sachin.kamat; +Cc: netdev, thomas.petazzoni, patches
In-Reply-To: <1354527928-27472-1-git-send-email-sachin.kamat@linaro.org>
From: Sachin Kamat <sachin.kamat@linaro.org>
Date: Mon, 3 Dec 2012 15:15:28 +0530
> linux/version.h inclusion is not necessary.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: David S. Miller <davem@davemloft.net>
I hope the mvneta folks will pick this up and apply it where it
needs to be as the mvneta driver isn't in the net-next tree.
^ permalink raw reply
* Re: [RFC PATCH] tcp: introduce raw access to experimental options
From: Einar Lueck @ 2012-12-03 18:44 UTC (permalink / raw)
To: Yuchung Cheng; +Cc: netdev, frankbla, raspl, ubacher, samudrala, davem
In-Reply-To: <CAK6E8=cXin1rSvQNMPife692wkd5tswsR_7RVG6FNB0rqymHeg@mail.gmail.com>
On 11/28/2012 01:01 PM, Yuchung Cheng wrote:
> On Sat, Nov 17, 2012 at 12:54 AM, <elelueck@linux.vnet.ibm.com> wrote:
>> From: Einar Lueck <elelueck@linux.vnet.ibm.com>
>>
>> This patch adds means for raw acces to TCP expirimental options
>> 253 and 254. The intention of this is to enable user space
>> applications to implement communication behaviour that depends
>> on experimental options. For that, new (set|get)sockopts are
>
> Could you elaborate on the use case? I am having a hard time
> understanding that. If you need to use experimental options for your
> applications, why not just use another magic number according to
> draft-ietf-tcpm-experimental-options-02 (since you cite that too)?
We want to enable application programmers to exploit this without
having to change the kernel with all the corresponding implications.
Einar.
^ permalink raw reply
* Re: [PATCH] vhost-net: initialize zcopy packet counters
From: David Miller @ 2012-12-03 18:42 UTC (permalink / raw)
To: mst; +Cc: netdev, linux-kernel, kvm, virtualization
In-Reply-To: <20121203173151.GA30949@redhat.com>
From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Mon, 3 Dec 2012 19:31:51 +0200
> These packet counters are used to drive the zercopy
> selection heuristic so nothing too bad happens if they are off a bit -
> and they are also reset once in a while.
> But it's cleaner to clear them when backend is set so that
> we start in a known state.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Applied to net-next, thanks.
^ permalink raw reply
* Re: [PATCH] tun: only queue packets on device
From: David Miller @ 2012-12-03 18:41 UTC (permalink / raw)
To: mst; +Cc: netdev, jasowang, nhorman, ramirose, linux-kernel
In-Reply-To: <20121203131942.GA27953@redhat.com>
From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Mon, 3 Dec 2012 15:19:43 +0200
> Historically tun supported two modes of operation:
> - in default mode, a small number of packets would get queued
> at the device, the rest would be queued in qdisc
> - in one queue mode, all packets would get queued at the device
>
> This might have made sense up to a point where we made the
> queue depth for both modes the same and set it to
> a huge value (500) so unless the consumer
> is stuck the chance of losing packets is small.
>
> Thus in practice both modes behave the same, but the
> default mode has some problems:
> - if packets are never consumed, fragments are never orphaned
> which cases a DOS for sender using zero copy transmit
> - overrun errors are hard to diagnose: fifo error is incremented
> only once so you can not distinguish between
> userspace that is stuck and a transient failure,
> tcpdump on the device does not show any traffic
>
> Userspace solves this simply by enabling IFF_ONE_QUEUE
> but there seems to be little point in not doing the
> right thing for everyone, by default.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Now that TUN_NO_QUEUE has no real effect and is a NOP, please document
it as such both in if_tun.h and the places in the driver that flip the
bit based upon userspace requests.
Thanks.
^ permalink raw reply
* Re: [PATCH] stmmac: remove two repeated macros
From: David Miller @ 2012-12-03 18:35 UTC (permalink / raw)
To: walimisdev; +Cc: peppe.cavallaro, netdev
In-Reply-To: <1354537184-1423-1-git-send-email-walimisdev@gmail.com>
From: Liming Wang <walimisdev@gmail.com>
Date: Mon, 3 Dec 2012 20:19:44 +0800
> Two macros have been defined twice, remove them.
>
> Signed-off-by: Liming Wang <walimisdev@gmail.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] net: phy: smsc: force all capable mode if the phy is started in powerdown mode
From: David Miller @ 2012-12-03 18:34 UTC (permalink / raw)
To: tremyfr
Cc: netdev, linux-kernel, otavio, javier, jkosina, eric.jarrige,
julien.boibessot, thomas.petazzoni
In-Reply-To: <1354394689-28281-1-git-send-email-tremyfr@yahoo.fr>
From: Philippe Reynes <tremyfr@yahoo.fr>
Date: Sat, 1 Dec 2012 21:44:49 +0100
> static int smsc_phy_config_init(struct phy_device *phydev)
> {
> - int rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS);
> + /*
> + * If the SMSC PHY is in power down mode, then set it
> + * in all capable mode before using it.
> + */
> + int rc = phy_read(phydev, MII_LAN83C185_SPECIAL_MODES);
This is formatted poorly. Do not put comments above the basic
block variable declarations, it looks terrible.
Also, comments in the networking code should be formatted:
/* Like
* this.
*/
/*
* Not like
* this.
*/
Thanks.
^ permalink raw reply
* Re: [PATCH net-next] sundance: Enable WoL support
From: David Miller @ 2012-12-03 18:33 UTC (permalink / raw)
To: kda; +Cc: netdev
In-Reply-To: <1354387159-18793-1-git-send-email-kda@linux-powerpc.org>
From: Denis Kirjanov <kda@linux-powerpc.org>
Date: Sat, 1 Dec 2012 22:39:19 +0400
> Enable WoL support.
>
> Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>
Applied.
^ permalink raw reply
* Re: [PATCH] irda: ep7211-sir: Convert to platform_diver
From: David Miller @ 2012-12-03 18:33 UTC (permalink / raw)
To: arnd; +Cc: shc_work, netdev, samuel
In-Reply-To: <201212012050.22382.arnd@arndb.de>
From: Arnd Bergmann <arnd@arndb.de>
Date: Sat, 1 Dec 2012 20:50:22 +0000
> On Saturday 01 December 2012, Alexander Shiyan wrote:
>> This patch converts ep7211-sir driver to platform_driver.
>> Since driver can be used not only for EP7211 CPU, function names
>> was be renamed to generic clps711x...
>>
>> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
Applied.
^ permalink raw reply
* Re: [PATCH v4 net-next] sctp: Add support to per-association statistics via a new SCTP_GET_ASSOC_STATS call
From: David Miller @ 2012-12-03 18:33 UTC (permalink / raw)
To: vyasevich; +Cc: michele, linux-sctp, nhorman, tgraf, netdev
In-Reply-To: <50BCD956.2090706@gmail.com>
From: Vlad Yasevich <vyasevich@gmail.com>
Date: Mon, 03 Dec 2012 11:54:46 -0500
> On 12/01/2012 09:49 AM, Michele Baldessari wrote:
>> The current SCTP stack is lacking a mechanism to have per association
>> statistics. This is an implementation modeled after OpenSolaris'
>> SCTP_GET_ASSOC_STATS.
>>
>> Userspace part will follow on lksctp if/when there is a general ACK on
>> this.
...
>> Signed-off: Michele Baldessari <michele@acksyn.org>
>
> Looks good
>
> Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH 1/4 net-next] tg3: PTP - Add header definitions, initialization and hw access functions.
From: Richard Cochran @ 2012-12-03 18:23 UTC (permalink / raw)
To: Michael Chan; +Cc: davem, netdev, nsujir
In-Reply-To: <1354506171-1646-1-git-send-email-mchan@broadcom.com>
Please put me on CC for any PTP related patches.
I have a few comments, below.
On Sun, Dec 02, 2012 at 07:42:48PM -0800, Michael Chan wrote:
> From: Matt Carlson <mcarlson@broadcom.com>
>
> This patch adds code to register/unregister the ptp clock and write
> the reference clock. If a chip reset is performed, the hwclock is
> reinitialized with the adjusted kernel time
>
> Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
> ---
> drivers/net/ethernet/broadcom/Kconfig | 1 +
> drivers/net/ethernet/broadcom/tg3.c | 84 +++++++++++++++++++++++++++++++--
> drivers/net/ethernet/broadcom/tg3.h | 60 ++++++++++++++++++++++-
> 3 files changed, 137 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/Kconfig b/drivers/net/ethernet/broadcom/Kconfig
> index 4bd416b..f552673 100644
> --- a/drivers/net/ethernet/broadcom/Kconfig
> +++ b/drivers/net/ethernet/broadcom/Kconfig
> @@ -102,6 +102,7 @@ config TIGON3
> depends on PCI
> select PHYLIB
> select HWMON
> + select PTP_1588_CLOCK
> ---help---
> This driver supports Broadcom Tigon3 based gigabit Ethernet cards.
>
> diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
> index 5cc976d..38047a9 100644
> --- a/drivers/net/ethernet/broadcom/tg3.c
> +++ b/drivers/net/ethernet/broadcom/tg3.c
> @@ -54,6 +54,9 @@
> #include <asm/byteorder.h>
> #include <linux/uaccess.h>
>
> +#include <uapi/linux/net_tstamp.h>
> +#include <linux/ptp_clock_kernel.h>
> +
> #ifdef CONFIG_SPARC
> #include <asm/idprom.h>
> #include <asm/prom.h>
> @@ -5516,6 +5519,57 @@ static int tg3_setup_phy(struct tg3 *tp, int force_reset)
> return err;
> }
>
> +static void tg3_refclk_write(struct tg3 *tp, u64 newval)
> +{
> + tw32(TG3_EAV_REF_CLCK_CTL, TG3_EAV_REF_CLCK_CTL_STOP);
> + tw32(TG3_EAV_REF_CLCK_LSB, newval & 0xffffffff);
> + tw32(TG3_EAV_REF_CLCK_MSB, newval >> 32);
> + tw32_f(TG3_EAV_REF_CLCK_CTL, TG3_EAV_REF_CLCK_CTL_RESUME);
> +}
> +
> +static const struct ptp_clock_info tg3_ptp_caps = {
> + .owner = THIS_MODULE,
> + .name = "",
Please use a static name here, something related to the driver, like
"tigon3 clock" perhaps. There used to be drivers doing other things
with this, but now the kernel doc from ptp_clock_kernel.h says:
@name: A short "friendly name" to identify the clock and to
help distinguish PHY based devices from MAC based ones.
The string is not meant to be a unique id.
> + .max_adj = 0,
> + .n_alarm = 0,
> + .n_ext_ts = 0,
> + .n_per_out = 0,
> + .pps = 0,
You have left the methods as a bunch of NULL pointers. This will not
fly, since someone might land on this commit during a bisect. In
general, every patch in a series should result in a working kernel.
> +};
> +
> +static void tg3_ptp_init(struct tg3 *tp)
> +{
> + if (!tg3_flag(tp, PTP_CAPABLE))
> + return;
> +
> + /* Initialize the hardware clock to the system time. */
> + tg3_refclk_write(tp, ktime_to_ns(ktime_get_real()));
> + tp->ptp_adjust = 0;
> +
> + tp->ptp_info = tg3_ptp_caps;
> + strncpy(tp->ptp_info.name, tp->dev->name, IFNAMSIZ);
> +}
> +
> +static void tg3_ptp_resume(struct tg3 *tp)
> +{
> + if (!tg3_flag(tp, PTP_CAPABLE))
> + return;
> +
> + tg3_refclk_write(tp, ktime_to_ns(ktime_get_real()) + tp->ptp_adjust);
> + tp->ptp_adjust = 0;
> +}
> +
> +static void tg3_ptp_fini(struct tg3 *tp)
> +{
> + if (!tg3_flag(tp, PTP_CAPABLE) ||
> + !tp->ptp_clock)
Overzealous line break.
> + return;
> +
> + ptp_clock_unregister(tp->ptp_clock);
> + tp->ptp_clock = NULL;
> + tp->ptp_adjust = 0;
> +}
> +
> static inline int tg3_irq_sync(struct tg3 *tp)
> {
> return tp->irq_sync;
> @@ -6527,6 +6581,8 @@ static inline void tg3_netif_stop(struct tg3 *tp)
>
> static inline void tg3_netif_start(struct tg3 *tp)
> {
> + tg3_ptp_resume(tp);
> +
> /* NOTE: unconditional netif_tx_wake_all_queues is only
> * appropriate so long as all callers are assured to
> * have free tx slots (such as after tg3_init_hw)
> @@ -10364,7 +10420,8 @@ static void tg3_ints_fini(struct tg3 *tp)
> tg3_flag_clear(tp, ENABLE_TSS);
> }
>
> -static int tg3_start(struct tg3 *tp, bool reset_phy, bool test_irq)
> +static int tg3_start(struct tg3 *tp, bool reset_phy, bool test_irq,
> + bool init)
> {
> struct net_device *dev = tp->dev;
> int i, err;
> @@ -10443,6 +10500,12 @@ static int tg3_start(struct tg3 *tp, bool reset_phy, bool test_irq)
> tg3_flag_set(tp, INIT_COMPLETE);
> tg3_enable_ints(tp);
>
> + if (init)
> + tg3_ptp_init(tp);
> + else
> + tg3_ptp_resume(tp);
> +
> +
> tg3_full_unlock(tp);
>
> netif_tx_start_all_queues(dev);
> @@ -10540,11 +10603,19 @@ static int tg3_open(struct net_device *dev)
>
> tg3_full_unlock(tp);
>
> - err = tg3_start(tp, true, true);
> + err = tg3_start(tp, true, true, true);
> if (err) {
> tg3_frob_aux_power(tp, false);
> pci_set_power_state(tp->pdev, PCI_D3hot);
> }
> +
> + if (tg3_flag(tp, PTP_CAPABLE)) {
> + tp->ptp_clock = ptp_clock_register(&tp->ptp_info,
> + &tp->pdev->dev);
> + if (IS_ERR(tp->ptp_clock))
> + tp->ptp_clock = NULL;
> + }
> +
> return err;
> }
>
> @@ -10552,6 +10623,8 @@ static int tg3_close(struct net_device *dev)
> {
> struct tg3 *tp = netdev_priv(dev);
>
> + tg3_ptp_fini(tp);
> +
> tg3_stop(tp);
>
> /* Clear stats across close / open calls */
> @@ -11454,7 +11527,7 @@ static int tg3_set_channels(struct net_device *dev,
>
> tg3_carrier_off(tp);
>
> - tg3_start(tp, true, false);
> + tg3_start(tp, true, false, false);
>
> return 0;
> }
> @@ -12507,7 +12580,6 @@ static void tg3_self_test(struct net_device *dev, struct ethtool_test *etest,
> }
>
> tg3_full_lock(tp, irq_sync);
> -
> tg3_halt(tp, RESET_KIND_SUSPEND, 1);
> err = tg3_nvram_lock(tp);
> tg3_halt_cpu(tp, RX_CPU_BASE);
> @@ -16598,8 +16670,8 @@ static void tg3_io_resume(struct pci_dev *pdev)
> tg3_full_lock(tp, 0);
> tg3_flag_set(tp, INIT_COMPLETE);
> err = tg3_restart_hw(tp, 1);
> - tg3_full_unlock(tp);
> if (err) {
> + tg3_full_unlock(tp);
This is hunk or the next one somehow related to the PTP code?
If not, they it should go into their own patch.
> netdev_err(netdev, "Cannot restart hardware after reset.\n");
> goto done;
> }
> @@ -16610,6 +16682,8 @@ static void tg3_io_resume(struct pci_dev *pdev)
>
> tg3_netif_start(tp);
>
> + tg3_full_unlock(tp);
> +
> tg3_phy_start(tp);
>
> done:
Thanks,
Richard
^ permalink raw reply
* Re: [PATCH net-next 3/7] ipv6: improve ipv6_find_hdr() to skip empty routing headers
From: Pablo Neira Ayuso @ 2012-12-03 18:06 UTC (permalink / raw)
To: Jesse Gross; +Cc: David Miller, netdev, dev, Ansis Atteka
In-Reply-To: <CAEP_g=-D6f-O1F0B4+xLKfZnY_LjFiHF-UaXD4zVUYctGG3-Ug@mail.gmail.com>
On Mon, Dec 03, 2012 at 09:28:55AM -0800, Jesse Gross wrote:
> On Mon, Dec 3, 2012 at 6:04 AM, Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > On Thu, Nov 29, 2012 at 10:35:45AM -0800, Jesse Gross wrote:
> >> @@ -159,9 +162,10 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
> >> }
> >> len = skb->len - start;
> >>
> >> - while (nexthdr != target) {
> >
> > If the offset is set as parameter via ipv6_find_hdr, we now are always
> > entering the loop even if we found the target header we're looking
> > for, before that didn't happen.
> >
> > Something seems wrong here to me.
>
> If the target header is a routing header then you might still need to
> continue searching because the first one that you see could be empty.
OK, but if it's not a routing header what we're searching for (which
seems to be the case of netfilter/IPVS) we waste way more cycles on
copying the IPv6 header again and with way more things that are
completely useless.
^ permalink raw reply
* Re: [PATCH] ixgbe: Use is_valid_ether_addr
From: Joe Perches @ 2012-12-03 17:47 UTC (permalink / raw)
To: Jeff Kirsher; +Cc: netdev, linux-kernel
In-Reply-To: <1350750159.10791.3.camel@joe-AO722>
On Sat, 2012-10-20 at 09:22 -0700, Joe Perches wrote:
> Use the normal kernel test instead of a module specific one.
ping?
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> found when doing that larger style conversion,
> might as well submit it.
>
> drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c | 2 +-
> drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | 27 +------------------------
> drivers/net/ethernet/intel/ixgbe/ixgbe_common.h | 1 -
> drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 +-
> drivers/net/ethernet/intel/ixgbe/ixgbe_type.h | 9 ---------
> drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c | 2 +-
> 6 files changed, 4 insertions(+), 39 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
> index 1077cb2..89fe00d 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
> @@ -1022,7 +1022,7 @@ mac_reset_top:
> hw->mac.ops.get_san_mac_addr(hw, hw->mac.san_addr);
>
> /* Add the SAN MAC address to the RAR only if it's a valid address */
> - if (ixgbe_validate_mac_addr(hw->mac.san_addr) == 0) {
> + if (is_valid_ether_addr(hw->mac.san_addr)) {
> hw->mac.ops.set_rar(hw, hw->mac.num_rar_entries - 1,
> hw->mac.san_addr, 0, IXGBE_RAH_AV);
>
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
> index dbf37e4..2d8f76d 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
> @@ -1762,30 +1762,6 @@ s32 ixgbe_update_eeprom_checksum_generic(struct ixgbe_hw *hw)
> }
>
> /**
> - * ixgbe_validate_mac_addr - Validate MAC address
> - * @mac_addr: pointer to MAC address.
> - *
> - * Tests a MAC address to ensure it is a valid Individual Address
> - **/
> -s32 ixgbe_validate_mac_addr(u8 *mac_addr)
> -{
> - s32 status = 0;
> -
> - /* Make sure it is not a multicast address */
> - if (IXGBE_IS_MULTICAST(mac_addr))
> - status = IXGBE_ERR_INVALID_MAC_ADDR;
> - /* Not a broadcast address */
> - else if (IXGBE_IS_BROADCAST(mac_addr))
> - status = IXGBE_ERR_INVALID_MAC_ADDR;
> - /* Reject the zero address */
> - else if (mac_addr[0] == 0 && mac_addr[1] == 0 && mac_addr[2] == 0 &&
> - mac_addr[3] == 0 && mac_addr[4] == 0 && mac_addr[5] == 0)
> - status = IXGBE_ERR_INVALID_MAC_ADDR;
> -
> - return status;
> -}
> -
> -/**
> * ixgbe_set_rar_generic - Set Rx address register
> * @hw: pointer to hardware structure
> * @index: Receive address register to write
> @@ -1889,8 +1865,7 @@ s32 ixgbe_init_rx_addrs_generic(struct ixgbe_hw *hw)
> * to the permanent address.
> * Otherwise, use the permanent address from the eeprom.
> */
> - if (ixgbe_validate_mac_addr(hw->mac.addr) ==
> - IXGBE_ERR_INVALID_MAC_ADDR) {
> + if (!is_valid_ether_addr(hw->mac.addr)) {
> /* Get the MAC address from the RAR0 for later reference */
> hw->mac.ops.get_mac_addr(hw, hw->mac.addr);
>
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h
> index d813d11..f49ca84 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h
> @@ -80,7 +80,6 @@ s32 ixgbe_enable_rx_dma_generic(struct ixgbe_hw *hw, u32 regval);
> s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw);
> void ixgbe_fc_autoneg(struct ixgbe_hw *hw);
>
> -s32 ixgbe_validate_mac_addr(u8 *mac_addr);
> s32 ixgbe_acquire_swfw_sync(struct ixgbe_hw *hw, u16 mask);
> void ixgbe_release_swfw_sync(struct ixgbe_hw *hw, u16 mask);
> s32 ixgbe_get_san_mac_addr_generic(struct ixgbe_hw *hw, u8 *san_mac_addr);
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> index e2a6691..3bb3485 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> @@ -7345,7 +7345,7 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
> memcpy(netdev->dev_addr, hw->mac.perm_addr, netdev->addr_len);
> memcpy(netdev->perm_addr, hw->mac.perm_addr, netdev->addr_len);
>
> - if (ixgbe_validate_mac_addr(netdev->perm_addr)) {
> + if (!is_valid_ether_addr(netdev->perm_addr)) {
> e_dev_err("invalid MAC address\n");
> err = -EIO;
> goto err_sw_init;
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
> index 0722f33..9ddac64 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
> @@ -1833,15 +1833,6 @@ enum {
> /* Number of 100 microseconds we wait for PCI Express master disable */
> #define IXGBE_PCI_MASTER_DISABLE_TIMEOUT 800
>
> -/* Check whether address is multicast. This is little-endian specific check.*/
> -#define IXGBE_IS_MULTICAST(Address) \
> - (bool)(((u8 *)(Address))[0] & ((u8)0x01))
> -
> -/* Check whether an address is broadcast. */
> -#define IXGBE_IS_BROADCAST(Address) \
> - ((((u8 *)(Address))[0] == ((u8)0xff)) && \
> - (((u8 *)(Address))[1] == ((u8)0xff)))
> -
> /* RAH */
> #define IXGBE_RAH_VIND_MASK 0x003C0000
> #define IXGBE_RAH_VIND_SHIFT 18
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c
> index de4da52..c73b929 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c
> @@ -152,7 +152,7 @@ mac_reset_top:
> hw->mac.ops.get_san_mac_addr(hw, hw->mac.san_addr);
>
> /* Add the SAN MAC address to the RAR only if it's a valid address */
> - if (ixgbe_validate_mac_addr(hw->mac.san_addr) == 0) {
> + if (is_valid_ether_addr(hw->mac.san_addr)) {
> hw->mac.ops.set_rar(hw, hw->mac.num_rar_entries - 1,
> hw->mac.san_addr, 0, IXGBE_RAH_AV);
>
>
^ permalink raw reply
* Re: Optics (SFP) monitoring on ixgbe and igbe
From: Ben Hutchings @ 2012-12-03 17:43 UTC (permalink / raw)
To: footplus; +Cc: netdev
In-Reply-To: <CAPN4dA8+RHq1BAEjXv2tQHQw_h0JhEoah0HCq65k63gmszjLCA@mail.gmail.com>
On Sun, 2012-12-02 at 23:00 +0100, Aurélien wrote:
> On Sun, Dec 2, 2012 at 10:47 PM, Aurélien <footplus@gmail.com> wrote:
> >>
> >> This version drops the -lm completely, so it doesn't link. Maybe you
> >> edited the generated Makefile or Makefile.in?
> >
> > No, I just stupidly forgot to make distclean & autogen after removing
> > all libm checks. Re-added AC_CHECK_LIB to link with it.
> >
>
> Just after re-reading this, I thought it was silly; I instead edited
> Makefile.am and reverted the configure.ac change. Here's a new
> full-patch with that fix along with the rest.
>
> Sorry for the noise.
Applied, thanks.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* [PATCH] vhost-net: initialize zcopy packet counters
From: Michael S. Tsirkin @ 2012-12-03 17:31 UTC (permalink / raw)
To: davem; +Cc: netdev, virtualization, linux-kernel, kvm, Michael S. Tsirkin
These packet counters are used to drive the zercopy
selection heuristic so nothing too bad happens if they are off a bit -
and they are also reset once in a while.
But it's cleaner to clear them when backend is set so that
we start in a known state.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
drivers/vhost/net.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 67898fa..ff6c9199 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -823,6 +823,9 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
r = vhost_init_used(vq);
if (r)
goto err_vq;
+
+ n->tx_packets = 0;
+ n->tx_zcopy_err = 0;
}
mutex_unlock(&vq->mutex);
--
MST
^ permalink raw reply related
* Re: [PATCH net-next 3/7] ipv6: improve ipv6_find_hdr() to skip empty routing headers
From: Jesse Gross @ 2012-12-03 17:28 UTC (permalink / raw)
To: Pablo Neira Ayuso
Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA,
David Miller, Ansis Atteka
In-Reply-To: <20121203140458.GA1596@1984>
On Mon, Dec 3, 2012 at 6:04 AM, Pablo Neira Ayuso <pablo-Cap9r6Oaw4JrovVCs/uTlw@public.gmane.org> wrote:
> On Thu, Nov 29, 2012 at 10:35:45AM -0800, Jesse Gross wrote:
>> @@ -159,9 +162,10 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
>> }
>> len = skb->len - start;
>>
>> - while (nexthdr != target) {
>
> If the offset is set as parameter via ipv6_find_hdr, we now are always
> entering the loop even if we found the target header we're looking
> for, before that didn't happen.
>
> Something seems wrong here to me.
If the target header is a routing header then you might still need to
continue searching because the first one that you see could be empty.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox