* Re: [PATCH net-next] fq_codel: add batch ability to fq_codel_drop()
From: Jesper Dangaard Brouer @ 2016-05-02 7:49 UTC (permalink / raw)
To: Eric Dumazet; +Cc: brouer, David Miller, netdev, Dave Taht, Jonathan Morton
In-Reply-To: <1462146446.5535.236.camel@edumazet-glaptop3.roam.corp.google.com>
On Sun, 01 May 2016 16:47:26 -0700
Eric Dumazet <eric.dumazet@gmail.com> wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> In presence of inelastic flows and stress, we can call
> fq_codel_drop() for every packet entering fq_codel qdisc.
>
> fq_codel_drop() is quite expensive, as it does a linear scan
> of 4 KB of memory to find a fat flow.
> Once found, it drops the oldest packet of this flow.
>
> Instead of dropping a single packet, try to drop 50% of the backlog
> of this fat flow, with a configurable limit of 64 packets per round.
>
> TCA_FQ_CODEL_DROP_BATCH_SIZE is the new attribute to make this
> limit configurable.
>
> With this strategy the 4 KB search is amortized to a single cache line
> per drop [1], so fq_codel_drop() no longer appears at the top of kernel
> profile in presence of few inelastic flows.
>
> [1] Assuming a 64byte cache line, and 1024 buckets
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Reported-by: Dave Taht <dave.taht@gmail.com>
> Cc: Jonathan Morton <chromatix99@gmail.com>
> ---
> include/uapi/linux/pkt_sched.h | 1
> net/sched/sch_fq_codel.c | 64 +++++++++++++++++++++----------
> 2 files changed, 46 insertions(+), 19 deletions(-)
>
> diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
> index 1c78c7454c7c..a11afecd4482 100644
> --- a/include/uapi/linux/pkt_sched.h
> +++ b/include/uapi/linux/pkt_sched.h
> @@ -718,6 +718,7 @@ enum {
> TCA_FQ_CODEL_FLOWS,
> TCA_FQ_CODEL_QUANTUM,
> TCA_FQ_CODEL_CE_THRESHOLD,
> + TCA_FQ_CODEL_DROP_BATCH_SIZE,
> __TCA_FQ_CODEL_MAX
> };
>
> diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c
> index a5e420b3d4ab..e7b42b0d5145 100644
> --- a/net/sched/sch_fq_codel.c
> +++ b/net/sched/sch_fq_codel.c
> @@ -59,6 +59,7 @@ struct fq_codel_sched_data {
> u32 flows_cnt; /* number of flows */
> u32 perturbation; /* hash perturbation */
> u32 quantum; /* psched_mtu(qdisc_dev(sch)); */
> + u32 drop_batch_size;
> struct codel_params cparams;
> struct codel_stats cstats;
> u32 drop_overlimit;
> @@ -135,17 +136,20 @@ static inline void flow_queue_add(struct fq_codel_flow *flow,
> skb->next = NULL;
> }
>
> -static unsigned int fq_codel_drop(struct Qdisc *sch)
> +static unsigned int fq_codel_drop(struct Qdisc *sch, unsigned int max_packets)
> {
> struct fq_codel_sched_data *q = qdisc_priv(sch);
> struct sk_buff *skb;
> unsigned int maxbacklog = 0, idx = 0, i, len;
> struct fq_codel_flow *flow;
> + unsigned int threshold;
>
> - /* Queue is full! Find the fat flow and drop packet from it.
> + /* Queue is full! Find the fat flow and drop packet(s) from it.
> * This might sound expensive, but with 1024 flows, we scan
> * 4KB of memory, and we dont need to handle a complex tree
> * in fast path (packet queue/enqueue) with many cache misses.
> + * In stress mode, we'll try to drop 64 packets from the flow,
> + * amortizing this linear lookup to one cache line per drop.
> */
> for (i = 0; i < q->flows_cnt; i++) {
> if (q->backlogs[i] > maxbacklog) {
> @@ -153,15 +157,24 @@ static unsigned int fq_codel_drop(struct Qdisc *sch)
> idx = i;
> }
> }
> +
> + /* Our goal is to drop half of this fat flow backlog */
> + threshold = maxbacklog >> 1;
> +
> flow = &q->flows[idx];
> - skb = dequeue_head(flow);
> - len = qdisc_pkt_len(skb);
> + len = 0;
> + i = 0;
> + do {
> + skb = dequeue_head(flow);
> + len += qdisc_pkt_len(skb);
> + kfree_skb(skb);
> + } while (++i < max_packets && len < threshold);
> +
> + flow->dropped += i;
What about using bulk free of SKBs here?
There is a very high probability that we are hitting SLUB slowpath,
which involves an expensive locked cmpxchg_double per packet. Instead
we can amortize this cost via kmem_cache_free_bulk().
Maybe extend kfree_skb_list() to hide the slab/kmem_cache call?
> q->backlogs[idx] -= len;
> - sch->q.qlen--;
> - qdisc_qstats_drop(sch);
> - qdisc_qstats_backlog_dec(sch, skb);
> - kfree_skb(skb);
> - flow->dropped++;
> + sch->qstats.drops += i;
> + sch->qstats.backlog -= len;
> + sch->q.qlen -= i;
> return idx;
> }
>
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
Author of http://www.iptv-analyzer.org
LinkedIn: http://www.linkedin.com/in/brouer
^ permalink raw reply
* Re: [PATCH] macb: fix mdiobus_scan() error check
From: Nicolas Ferre @ 2016-05-02 7:39 UTC (permalink / raw)
To: Sergei Shtylyov, netdev, David Miller
In-Reply-To: <2317306.aZN9iKAKYz@wasted.cogentembedded.com>
Le 01/05/2016 00:47, Sergei Shtylyov a écrit :
> Now mdiobus_scan() returns ERR_PTR(-ENODEV) instead of NULL if the PHY
> device ID was read as all ones. As this was not an error before, this
> value should be filtered out now in this driver.
>
> Fixes: b74766a0a0fe ("phylib: don't return NULL from get_phy_device()")
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Thanks.
>
> ---
> The patch is against DaveM's 'net-next.git' repo.
>
> drivers/net/ethernet/cadence/macb.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> Index: net-next/drivers/net/ethernet/cadence/macb.c
> ===================================================================
> --- net-next.orig/drivers/net/ethernet/cadence/macb.c
> +++ net-next/drivers/net/ethernet/cadence/macb.c
> @@ -458,7 +458,8 @@ static int macb_mii_init(struct macb *bp
> struct phy_device *phydev;
>
> phydev = mdiobus_scan(bp->mii_bus, i);
> - if (IS_ERR(phydev)) {
> + if (IS_ERR(phydev) &&
> + PTR_ERR(phydev) != -ENODEV) {
> err = PTR_ERR(phydev);
> break;
> }
>
>
--
Nicolas Ferre
^ permalink raw reply
* Re: [net-next PATCH v2 1/9] net: Disable segmentation if checksumming is not supported
From: Or Gerlitz @ 2016-05-02 7:28 UTC (permalink / raw)
To: Alexander Duyck
Cc: Alexander Duyck, talal@mellanox.com, Linux Netdev List,
Michael Chan, David Miller, Or Gerlitz, Eran Ben Elisha,
Tariq Toukan
On Mon, May 2, 2016 at 5:16 AM, Alexander Duyck
<alexander.duyck@gmail.com> wrote:
> On Sun, May 1, 2016 at 1:30 PM, Or Gerlitz <gerlitz.or@gmail.com> wrote:
>> On Sat, Apr 30, 2016 at 1:43 AM, Alexander Duyck <aduyck@mirantis.com> wrote:
>>> In the case of the mlx4 and mlx5 driver they do not support IPv6 checksum
>>> offload for tunnels.
>>
>> Alex,
>>
>> To clarify, when you say "not support IPv6 checksum for tunnels", you
>> refer to the offloading of the outer or inner checksum?
>
> In the case of mlx4 it was an issue with both inner and outer due to
> IPv6 checksum. The issue was that the feature was not exposed and yet
> the stack was attempting to make use of it in various ways. The fixes
> that resolved the issues are in patches 1 and 4. If we wanted to we
> could move those to net, but then it would be difficult to test the
> existing patches on the mlx4 until the net tree containing those
> patches was merged back in.
>
>> Still (me and I think also Tariq from our driver team) catching up on
>> the series, the primitives and conventions you are introducing using
>> and how this applies on mlx5. I saw that Saeed acked the the mlx5e
>> patches (7 and 8).
>
> The concept for all this is pretty simple. What I am doing is
> restricting TSO so that we have a fixed size that is used for all
> outgoing frames.
excellent... how exactly this is done? I wasn't sure if this is
existing facility in the kernel and which or somehow introduced now
(where)? would appreciate if you can drop a note on that.
> Then we precompute the outer headers and use those
> values when performing GSO. By doing this we can populate the UDP
> checksum field instead of forcing it to 0 which allows us to perform
> TSO for tunnels with outer checksums.
now.. understood.
>> Specifically, the mlx4 patches are practically fixes so if they don't
>> land in 4.7 via net-next we can get them there through net, lets give
>> us the few more days needed to catch up from our side.
> Actually the mlx4 specific portion of these patches are not really
> fixes, they are enabling features. Specifically IPv6 checksum, TSOv6,
> and TSO for VXLAN tunnels with outer checksums. It is patches 1 and 4
> that contain the fix and it likely applies to more than just the mlx4
> driver as I believe there is a qlogic driver with a similar feature
> flag layout. If we want we could recommend those patches for stable
All makes sense, I will be able to ack the mlx4 patches tomorrow or
the latest Wed so we are just fine for 4.7 - I don't see urgency to
put them on 4.6
Or.
^ permalink raw reply
* Re: [net-next PATCH v2 5/9] mlx4: Add support for UDP tunnel segmentation with outer checksum offload
From: Or Gerlitz @ 2016-05-02 7:19 UTC (permalink / raw)
To: Alexander Duyck
Cc: Alexander Duyck, talal@mellanox.com, Linux Netdev List,
Michael Chan, David Miller, Gal Pressman, Or Gerlitz,
Eran Ben Elisha
In-Reply-To: <CAKgT0UdV2ruuRsYLmOjnqbXW0_i4QqMfo+VhuCSBqJjWrKhRdQ@mail.gmail.com>
On Mon, May 2, 2016 at 5:25 AM, Alexander Duyck
<alexander.duyck@gmail.com> wrote:
> On Sun, May 1, 2016 at 1:35 PM, Or Gerlitz <gerlitz.or@gmail.com> wrote:
>> On Sat, Apr 30, 2016 at 1:43 AM, Alexander Duyck <aduyck@mirantis.com> wrote:
>>> This patch assumes that the mlx4 hardware will ignore existing IPv4/v6
>>> header fields for length and checksum as well as the length and checksum
>>> fields for outer UDP headers.
>> I see now the above text appearing in bunch of similar commit of
>> yours, specifically to Intel drivers and mlx5... could you please
>> elaborate a bit more what you mean here and what are the practical
>> consequences of that characteristics?
>> I got that right NETIF_F_GSO_UDP_TUNNEL_CSUM means that the HW can do
>> segmentation for TCP packets encapsulated by UDP tunnel e.g VXLAN
>> where the outer checksum is not zero. AFAIK, any other outer checksum
>> value can't correctly be a constant... are you assuming here RCO or
>> LCO?
> Actually it is really easy for outer UDP checksum to be constant as
> long as we keep the length of all segments constant. This all ties
> back into LCO. As long as the fields between the start of the UDP
> header and the start of the TCP header are either constant, as in the
> case of IPv6, or have their own checksum as in the case of IPv4 we
> will end up with the checksum of the outer header being constant.
cool. I would love seeing this documented somewhere, either in the
change log if you do a respin or on some kernel networking
documentation, is that part of the LCO documentation?
> So in effect as long as we can trust the hardware to segment every
> frame to the specified size and that it won't insert any extra data
> anywhere in that region that we aren't expecting we can guarantee that
> each frame will have the same checksum for the outer UDP header.
Wow, that is really cool, thanks for taking the time and explaining it over.
Just one more piece to clarify... in the general case (e.g inner
packet size 1.5k...64k), the last segment would not have the same
length as the other segments, what happens on that case?
Or.
^ permalink raw reply
* [PATCH] rtlwifi:rtl_lps_enter: fix double check cnt_after_linked
From: Wang YanQing @ 2016-05-02 6:11 UTC (permalink / raw)
To: Larry.Finger-tQ5ms3gMjBLk1uMJSBkQmQ
Cc: chaoming_li-kXabqFNEczNtrwSWzY7KCg, kvalo-sgV2jX0FEOL9JmXXK+q4OQ,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
We have checked cnt_after_linked in below code:
"
/*sleep after linked 10s, to let DHCP and 4-way handshake ok enough!! */
if (mac->cnt_after_linked < 5)
return;
"
So the second check isn't necessary.
This patch delete second check code.
Signed-off-by: Wang YanQing <udknight-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
drivers/net/wireless/realtek/rtlwifi/ps.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtlwifi/ps.c b/drivers/net/wireless/realtek/rtlwifi/ps.c
index b69321d..9d73581c 100644
--- a/drivers/net/wireless/realtek/rtlwifi/ps.c
+++ b/drivers/net/wireless/realtek/rtlwifi/ps.c
@@ -443,14 +443,11 @@ void rtl_lps_enter(struct ieee80211_hw *hw)
spin_lock_irqsave(&rtlpriv->locks.lps_lock, flag);
- /* Idle for a while if we connect to AP a while ago. */
- if (mac->cnt_after_linked >= 2) {
- if (ppsc->dot11_psmode == EACTIVE) {
- RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
- "Enter 802.11 power save mode...\n");
+ if (ppsc->dot11_psmode == EACTIVE) {
+ RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
+ "Enter 802.11 power save mode...\n");
- rtl_lps_set_psmode(hw, EAUTOPS);
- }
+ rtl_lps_set_psmode(hw, EAUTOPS);
}
spin_unlock_irqrestore(&rtlpriv->locks.lps_lock, flag);
--
1.8.5.6.2.g3d8a54e.dirty
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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 related
* Re: [PATCH] i40e: constify i40e_client_ops structure
From: Leon Romanovsky @ 2016-05-02 6:06 UTC (permalink / raw)
To: Julia Lawall
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
linux-rdma-u79uwXL29TY76Z2rM5mHXA, Hal Rosenstock, Sean Hefty,
Doug Ledford, Tatyana Nikolova, Shiraz Saleem, Mustafa Ismail,
Chien Tin Tung, Faisal Latif, Jeff Kirsher, Jesse Brandeburg,
Shannon Nelson, Carolyn Wyborny, Don Skidmore, Bruce Allan,
John Ronciak, Mitch Williams,
intel-wired-lan-qjLDD68F18P21nG7glBr7A,
netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1462104443-30724-1-git-send-email-Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 361 bytes --]
On Sun, May 01, 2016 at 02:07:23PM +0200, Julia Lawall wrote:
> The i40e_client_ops structure is never modified, so declare it as const.
>
> Done with the help of Coccinelle.
>
> Signed-off-by: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
>
Thanks Julia,
Reviewed-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* [PATCH] rtlwifi:rtl_watchdog_wq_callback: fix calling rtl_lps_enter|rtl_lps_leave in opposite condition
From: Wang YanQing @ 2016-05-02 5:37 UTC (permalink / raw)
To: Larry.Finger-tQ5ms3gMjBLk1uMJSBkQmQ
Cc: chaoming_li-kXabqFNEczNtrwSWzY7KCg, kvalo-sgV2jX0FEOL9JmXXK+q4OQ,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Commit a269913c52ad37952a4d9953bb6d748f7299c304
("rtlwifi: Rework rtl_lps_leave() and rtl_lps_enter() to use work queue")
make a mistake, change the meaning of num_tx|rx_inperiod comparison test.
Commit fd09ff958777cf583d7541f180991c0fc50bd2f7
("rtlwifi: Remove extra workqueue for enter/leave power state")
follow previous mistake, bring us to current code.
This patch fix it.
Signed-off-by: Wang YanQing <udknight-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
I think this patch should be ported back to stable kernels, 3.10+.
In my machine, I will lost wifi connection after minutes if I enable
fwlps.
drivers/net/wireless/realtek/rtlwifi/base.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c b/drivers/net/wireless/realtek/rtlwifi/base.c
index c74eb13..264466f 100644
--- a/drivers/net/wireless/realtek/rtlwifi/base.c
+++ b/drivers/net/wireless/realtek/rtlwifi/base.c
@@ -1660,9 +1660,9 @@ void rtl_watchdog_wq_callback(void *data)
if (((rtlpriv->link_info.num_rx_inperiod +
rtlpriv->link_info.num_tx_inperiod) > 8) ||
(rtlpriv->link_info.num_rx_inperiod > 2))
- rtl_lps_enter(hw);
- else
rtl_lps_leave(hw);
+ else
+ rtl_lps_enter(hw);
}
rtlpriv->link_info.num_rx_inperiod = 0;
--
1.8.5.6.2.g3d8a54e.dirty
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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 related
* Re: Q: How to disable vlan strip in Intel igb driver ?
From: Ran Shalit @ 2016-05-02 5:12 UTC (permalink / raw)
To: Peter Palúch; +Cc: netdev, Alexander Duyck
In-Reply-To: <add3dc34-51fc-73e2-489a-e3230cc081f6@fri.uniza.sk>
On Sun, May 1, 2016 at 11:51 PM, Peter Palúch <Peter.Paluch@fri.uniza.sk> wrote:
> Hi Ran,
>
>
>> Alex,
>> I don't see rx-vlan-offload option in my ethtool. strange, maybe it is
>> not available in all ethtool versions ?
>
>
> According to my manpage for ethtool v4.5, the relevant -K option is
> "rxvlan".
>
>> Hi Peter,
>> Yes, I'm using AF_PACKET (I can't validate it now for 100%, but I
>> quite sure about it).
>
>
> Okay - but I assume that you are writing a userspace application, not a
> kernelspace driver or module, right?
>
>> I'm accessing the ethernet header, and it always gives me non extended
>> ethernet header (without vlan information).
>
>
> It seems that this behavior has been around for a long time, and is
> intentional. See the following thread for more information:
>
> http://www.spinics.net/lists/netdev/msg244668.html
>
> The only legit way of accessing VLAN tag info on an AF_PACKET socket I know
> about is by setting the PACKET_AUXDATA socket option, and reading the
> auxiliary data as a struct tpacket_auxdata using recvmsg().
>
> In addition, however, there seems to be a bug in the kernel in that the
> tp_vlan_tci member of the struct tpacket_auxdata is filled in only if the
> AF_PACKET socket is bound to htons(ETH_P_ALL). If the socket is bound to any
> other specific protocol, the tp_vlan_tci is set to 0. I have raised this
> issue recently in the following thread(s) but have not received a response
> yet:
>
> http://www.spinics.net/lists/netdev/msg372830.html
> http://www.spinics.net/lists/netdev/msg373112.html
>
>
>> I can see the vlan tag in vlan_tci field in sk_buff, but this is not
>> exactly what I need, I need the header AS-IS with the original
>> (extended) ethernet header.
>
>
> How are you accessing the vlan_tci field from your software?
>
> In any case, with AF_PACKET sockets, I am afraid you don't have much choice.
> Even libpcap reconstructs VLAN-tagged frames by reading the VLAN tag from an
> auxiliary structure and then re-inserting it into the frame, because the
> frame delivered through an AF_PACKET socket does not have the VLAN tag
> present anymore.
>
Hi Peter,
I have a patch (hook) in the igb (Intel) driver which reads the skb
buffer into our buffer, this is without using socket actually. ipstack
is not involved, so socket as
I mentioned before are not relevant (AF_PACKET not relevant).
the problem seems in the driver that the driver strip vlan information
(there is a lot of mention of strip and vlan in the igb driver, and I
tried many things, but still it always strip this information from the
data in the sk_buff.)
will ethtool assist in this case ? I don;t see any vlan option in my
ethtool. Does ethtool communicated with the driver and command it not
to strip the vlan info ?
Thanks,
Ran
^ permalink raw reply
* [GIT] Networking
From: David Miller @ 2016-05-02 5:11 UTC (permalink / raw)
To: torvalds; +Cc: akpm, netdev, linux-kernel
1) MODULE_FIRMWARE firmware string not correct for iwlwifi 8000 chips,
from Sara Sharon.
2) Fix SKB size checks in batman-adv stack on receive, from Sven
Eckelmann.
3) Leak fix on mac80211 interface add error paths, from Johannes Berg.
4) Cannot invoke napi_disable() with BH disabled in myri10ge driver, fix
from Stanislaw Gruszka.
5) Fix sign extension problem when computing feature masks in
net_gso_ok(), from Marcelo Ricardo Leitner.
6) lan78xx driver doesn't count packets and packet lengths in it's
statistics properly, fix from Woojung Huh.
7) Fix the buffer allocation sizes in pegasus USB driver, from
Petko Manolov.
8) Fix refcount overflows in bpf, from Alexei Starovoitov.
9) Unified dst cache handling introduced a preempt warning in
ip_tunnel, fix by resetting rather then setting the cached
route. From Paolo Abeni.
10) Listener hash collision test fix in soreuseport, from Craig
Gallak.
Please pull, thanks a lot!
The following changes since commit f28f20da704d399fb1e4d8838ffd697a357d9cc8:
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (2016-04-26 16:25:51 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
for you to fetch changes up to b7f8fe251e4609e2a437bd2c2dea01e61db6849c:
gre: do not pull header in ICMP error processing (2016-05-02 00:19:58 -0400)
----------------------------------------------------------------
Alexei Starovoitov (3):
bpf: fix refcnt overflow
bpf: fix check_map_func_compatibility logic
samples/bpf: fix trace_output example
Andreas Larsson (1):
MAINTAINERS: net: Change maintainer for GRETH 10/100/1G Ethernet MAC device driver
Arnd Bergmann (1):
net/smscx5xx: use the device tree for mac address
Ayala Beker (1):
iwlwifi: mvm: avoid to WARN about gscan capabilities
Bert Kenward (1):
MAINTAINERS: net: update sfc maintainers
Christophe Jaillet (1):
ps3_gelic: fix memcpy parameter
Colin Ian King (1):
net: dsa: mv88e6xxx: fix uninitialized error return
Craig Gallek (1):
soreuseport: Fix TCP listener hash collision
David Rivshin (5):
drivers: net: cpsw: fix parsing of phy-handle DT property in dual_emac config
drivers: net: cpsw: fix segfault in case of bad phy-handle
drivers: net: cpsw: don't ignore phy-mode if phy-handle is used
dt: cpsw: phy-handle, phy_id, and fixed-link are mutually exclusive
drivers: net: cpsw: use of_phy_connect() in fixed-link case
David S. Miller (8):
Merge branch 'bnxt_en-fixes'
Merge tag 'wireless-drivers-for-davem-2016-04-25' of git://git.kernel.org/.../kvalo/wireless-drivers
Merge tag 'batman-adv-fix-for-davem' of git://git.open-mesh.org/linux-merge
Merge tag 'mac80211-for-davem-2016-04-27' of git://git.kernel.org/.../jberg/mac80211
Merge branch 'gre-lwt-fixes'
Merge branch 'pegasus-sizes'
Merge branch 'cpsw-phy-handle-fixes'
Merge branch 'bpf-fixes'
Eric Engestrom (1):
Documentation: networking: fix spelling mistakes
Hamish Martin (1):
tipc: only process unicast on intended node
Jiri Benc (4):
gre: do not assign header_ops in collect metadata mode
gre: build header correctly for collect metadata tunnels
gre: reject GUE and FOU in collect metadata mode
gre: do not pull header in ICMP error processing
Johannes Berg (1):
mac80211: fix statistics leak if dev_alloc_name() fails
Jon Cooper (1):
sfc: disable RSS when unsupported
Kalle Valo (1):
Merge tag 'iwlwifi-for-kalle-2016-04-12_2' of https://git.kernel.org/.../iwlwifi/iwlwifi-fixes
Linus Lüssing (1):
batman-adv: Fix broadcast/ogm queue limit on a removed interface
Marcelo Ricardo Leitner (1):
net: fix net_gso_ok for new GSO types.
Marek Lindner (1):
batman-adv: init neigh node last seen field
Matti Gottlieb (1):
iwlwifi: mvm: fix accessing Null pointer during fw dump collection
Michael Chan (3):
bnxt_en: Don't fallback to INTA on VF.
bnxt_en: Limit RX BD pages to be no bigger than 32K.
bnxt_en: Divide a page into 32K buffers for the aggregation ring if necessary.
Michal Schmidt (1):
cxgb3: fix out of bounds read
Neil Armstrong (1):
net: ethernet: davinci_emac: Fix devioctl while in fixed link
Oleksij Rempel (1):
ath9k: ar5008_hw_cmn_spur_mitigate: add missing mask_m & mask_p initialisation
Oren Givon (1):
iwlwifi: add device IDs for the 8265 device
Paolo Abeni (1):
ip_tunnel: fix preempt warning in ip tunnel creation/updating
Petko Manolov (2):
pegasus: fixes URB buffer allocation size;
pegasus: fixes reported packet length
Sara Sharon (1):
iwlwifi: 8000: fix MODULE_FIRMWARE input
Stanislaw Gruszka (1):
myri10ge: fix sleeping with bh disabled
Sven Eckelmann (3):
batman-adv: Check skb size before using encapsulated ETH+VLAN header
batman-adv: Deactivate TO_BE_ACTIVATED hardif on shutdown
batman-adv: Reduce refcnt of removed router when updating route
Tim Bingham (1):
net: Implement net_dbg_ratelimited() for CONFIG_DYNAMIC_DEBUG case
Timur Tabi (1):
net: phy: at803x: only the AT8030 needs a hardware reset on link change
Wang Shanker (1):
net: l2tp: fix reversed udp6 checksum flags
Woojung Huh (2):
lan78xx: fix statistics counter error
lan78xx: workaround of forced 100 Full/Half duplex mode error
Documentation/devicetree/bindings/net/cpsw.txt | 6 +++---
Documentation/networking/altera_tse.txt | 6 +++---
Documentation/networking/ipvlan.txt | 6 +++---
Documentation/networking/pktgen.txt | 6 +++---
Documentation/networking/vrf.txt | 2 +-
Documentation/networking/xfrm_sync.txt | 6 +++---
MAINTAINERS | 5 +++--
drivers/net/dsa/mv88e6xxx.c | 2 +-
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 53 ++++++++++++++++++++++++++++++++++-------------
drivers/net/ethernet/broadcom/bnxt/bnxt.h | 13 ++++++++++++
drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c | 3 ++-
drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 4 ++--
drivers/net/ethernet/sfc/ef10.c | 15 ++++++++++++--
drivers/net/ethernet/ti/cpsw.c | 67 ++++++++++++++++++++++++++++++++----------------------------
drivers/net/ethernet/ti/cpsw.h | 1 +
drivers/net/ethernet/ti/davinci_emac.c | 5 ++++-
drivers/net/ethernet/toshiba/ps3_gelic_wireless.c | 2 +-
drivers/net/phy/at803x.c | 40 ++++++++++++++++--------------------
drivers/net/usb/lan78xx.c | 44 +++++++++++++++++++++++++++++++++------
drivers/net/usb/pegasus.c | 10 ++++-----
drivers/net/usb/smsc75xx.c | 12 ++++++++++-
drivers/net/usb/smsc95xx.c | 12 ++++++++++-
drivers/net/wireless/ath/ath9k/ar5008_phy.c | 8 +++-----
drivers/net/wireless/ath/ath9k/ar9002_phy.c | 5 -----
drivers/net/wireless/intel/iwlwifi/iwl-8000.c | 2 +-
drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 26 +++++++++--------------
drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c | 6 ++++--
drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 2 ++
drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 10 +++++++++
include/linux/bpf.h | 3 ++-
include/linux/net.h | 10 ++++++++-
include/linux/netdevice.h | 2 +-
kernel/bpf/inode.c | 7 ++++---
kernel/bpf/syscall.c | 24 ++++++++++++++++++----
kernel/bpf/verifier.c | 76 ++++++++++++++++++++++++++++++++++++++++++--------------------------
net/batman-adv/hard-interface.c | 3 +--
net/batman-adv/originator.c | 1 +
net/batman-adv/routing.c | 9 ++++++++
net/batman-adv/send.c | 6 ++++++
net/batman-adv/soft-interface.c | 8 ++++++--
net/ipv4/inet_hashtables.c | 2 ++
net/ipv4/ip_gre.c | 30 +++++++++++++++++++--------
net/ipv4/ip_tunnel.c | 4 ++--
net/l2tp/l2tp_core.c | 4 ++--
net/mac80211/iface.c | 4 ++--
net/tipc/node.c | 5 +++++
samples/bpf/trace_output_kern.c | 1 -
47 files changed, 384 insertions(+), 194 deletions(-)
^ permalink raw reply
* Re: [PATCH net] gre: do not pull header in ICMP error processing
From: David Miller @ 2016-05-02 4:20 UTC (permalink / raw)
To: jbenc; +Cc: netdev, pshelar
In-Reply-To: <666d05a8cff4a89ce4fd77810902246aa3e7a13f.1461965458.git.jbenc@redhat.com>
From: Jiri Benc <jbenc@redhat.com>
Date: Fri, 29 Apr 2016 23:31:32 +0200
> iptunnel_pull_header expects that IP header was already pulled; with this
> expectation, it pulls the tunnel header. This is not true in gre_err.
> Furthermore, ipv4_update_pmtu and ipv4_redirect expect that skb->data points
> to the IP header.
>
> We cannot pull the tunnel header in this path. It's just a matter of not
> calling iptunnel_pull_header - we don't need any of its effects.
>
> Fixes: bda7bb463436 ("gre: Allow multiple protocol listener for gre protocol.")
> Signed-off-by: Jiri Benc <jbenc@redhat.com>
Applied and queued up for -stable, thanks Jiri.
^ permalink raw reply
* Re: [net-next 00/15][pull request] 40GbE Intel Wired LAN Driver Updates 2016-05-01
From: David Miller @ 2016-05-02 3:39 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, nhorman, sassmann, jogreene, john.ronciak
In-Reply-To: <1462147581-135254-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Sun, 1 May 2016 17:06:06 -0700
> This series contains updates to i40e and i40evf.
Looks good, pulled, thanks Jeff.
^ permalink raw reply
* Re: [net-next PATCH v2 5/9] mlx4: Add support for UDP tunnel segmentation with outer checksum offload
From: Alexander Duyck @ 2016-05-02 2:25 UTC (permalink / raw)
To: Or Gerlitz
Cc: Alexander Duyck, talal@mellanox.com, Linux Netdev List,
Michael Chan, David Miller, Gal Pressman, Or Gerlitz,
Eran Ben Elisha
In-Reply-To: <CAJ3xEMiog9zEwg_S=jG5LjM6FpvtyffvPcYX_G4j-ubBE_wLDw@mail.gmail.com>
On Sun, May 1, 2016 at 1:35 PM, Or Gerlitz <gerlitz.or@gmail.com> wrote:
> On Sat, Apr 30, 2016 at 1:43 AM, Alexander Duyck <aduyck@mirantis.com> wrote:
>> This patch assumes that the mlx4 hardware will ignore existing IPv4/v6
>> header fields for length and checksum as well as the length and checksum
>> fields for outer UDP headers.
>
> Hi Alex,
>
> I see now the above text appearing in bunch of similar commit of
> yours, specifically to Intel drivers and mlx5... could you please
> elaborate a bit more what you mean here and what are the practical
> consequences of that characteristics?
>
> I got that right NETIF_F_GSO_UDP_TUNNEL_CSUM means that the HW can do
> segmentation for TCP packets encapsulated by UDP tunnel e.g VXLAN
> where the outer checksum is not zero. AFAIK, any other outer checksum
> value can't correctly be a constant... are you assuming here RCO or
> LCO?
Actually it is really easy for outer UDP checksum to be constant as
long as we keep the length of all segments constant. This all ties
back into LCO. As long as the fields between the start of the UDP
header and the start of the TCP header are either constant, as in the
case of IPv6, or have their own checksum as in the case of IPv4 we
will end up with the checksum of the outer header being constant.
So in effect as long as we can trust the hardware to segment every
frame to the specified size and that it won't insert any extra data
anywhere in that region that we aren't expecting we can guarantee that
each frame will have the same checksum for the outer UDP header.
- Alex
^ permalink raw reply
* Re: [net-next PATCH v2 1/9] net: Disable segmentation if checksumming is not supported
From: Alexander Duyck @ 2016-05-02 2:16 UTC (permalink / raw)
To: Or Gerlitz
Cc: Alexander Duyck, talal@mellanox.com, Linux Netdev List,
Michael Chan, David Miller, Or Gerlitz, Eran Ben Elisha,
Tariq Toukan
In-Reply-To: <CAJ3xEMhCHny00V0GAFH1a9NXj52q5M4B1Rmz+JMCT8YsK02vKQ@mail.gmail.com>
On Sun, May 1, 2016 at 1:30 PM, Or Gerlitz <gerlitz.or@gmail.com> wrote:
> On Sat, Apr 30, 2016 at 1:43 AM, Alexander Duyck <aduyck@mirantis.com> wrote:
>> In the case of the mlx4 and mlx5 driver they do not support IPv6 checksum
>> offload for tunnels.
>
> Alex,
>
> To clarify, when you say "not support IPv6 checksum for tunnels", you
> refer to the offloading of the outer or inner checksum?
In the case of mlx4 it was an issue with both inner and outer due to
IPv6 checksum. The issue was that the feature was not exposed and yet
the stack was attempting to make use of it in various ways. The fixes
that resolved the issues are in patches 1 and 4. If we wanted to we
could move those to net, but then it would be difficult to test the
existing patches on the mlx4 until the net tree containing those
patches was merged back in.
> Still (me and I think also Tariq from our driver team) catching up on
> the series, the primitives and conventions you are introducing using
> and how this applies on mlx5. I saw that Saeed acked the the mlx5e
> patches (7 and 8).
The concept for all this is pretty simple. What I am doing is
restricting TSO so that we have a fixed size that is used for all
outgoing frames. Then we precompute the outer headers and use those
values when performing GSO. By doing this we can populate the UDP
checksum field instead of forcing it to 0 which allows us to perform
TSO for tunnels with outer checksums.
> Specifically, the mlx4 patches are practically fixes so if they don't
> land in 4.7 via net-next we can get them there through net, lets give
> us the few more days needed to catch up from our side.
Actually the mlx4 specific portion of these patches are not really
fixes, they are enabling features. Specifically IPv6 checksum, TSOv6,
and TSO for VXLAN tunnels with outer checksums. It is patches 1 and 4
that contain the fix and it likely applies to more than just the mlx4
driver as I believe there is a qlogic driver with a similar feature
flag layout. If we want we could recommend those patches for stable
and they could probably be back ported into 4.6 after it is released
because I don't see the urgency to push a fix in for something that
has obviously been broken for quite some time now that likely nobody
is ever testing.
- Alex
^ permalink raw reply
* Re: [PATCH] net: Implement net_dbg_ratelimited() for CONFIG_DYNAMIC_DEBUG case
From: David Miller @ 2016-05-02 1:49 UTC (permalink / raw)
To: tbingham; +Cc: netdev, Jason
In-Reply-To: <1461951023-14311-1-git-send-email-tbingham@akamai.com>
From: Tim Bingham <tbingham@akamai.com>
Date: Fri, 29 Apr 2016 13:30:23 -0400
> Prior to commit d92cff89a0c8 ("net_dbg_ratelimited: turn into no-op
> when !DEBUG") the implementation of net_dbg_ratelimited() was buggy
> for both the DEBUG and CONFIG_DYNAMIC_DEBUG cases.
>
> The bug was that net_ratelimit() was being called and, despite
> returning true, nothing was being printed to the console. This
> resulted in messages like the following -
>
> "net_ratelimit: %d callbacks suppressed"
>
> with no other output nearby.
>
> After commit d92cff89a0c8 ("net_dbg_ratelimited: turn into no-op when
> !DEBUG") the bug is fixed for the DEBUG case. However, there's no
> output at all for CONFIG_DYNAMIC_DEBUG case.
>
> This patch restores debug output (if enabled) for the
> CONFIG_DYNAMIC_DEBUG case.
>
> Add a definition of net_dbg_ratelimited() for the CONFIG_DYNAMIC_DEBUG
> case. The implementation takes care to check that dynamic debugging is
> enabled before calling net_ratelimit().
>
> Fixes: d92cff89a0c8 ("net_dbg_ratelimited: turn into no-op when !DEBUG")
> Signed-off-by: Tim Bingham <tbingham@akamai.com>
Looks good, applied and queued up for -stable, thanks.
^ permalink raw reply
* Re: [PATCH] sctp: signal sk_data_ready earlier on data chunks reception
From: David Miller @ 2016-05-02 1:06 UTC (permalink / raw)
To: marcelo.leitner; +Cc: netdev, nhorman, vyasevich, linux-sctp
In-Reply-To: <271eaec3c8fad125a48b5acce192dd1080c26528.1461949899.git.marcelo.leitner@gmail.com>
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Date: Fri, 29 Apr 2016 14:17:08 -0300
> Dave Miller pointed out that fb586f25300f ("sctp: delay calls to
> sk_data_ready() as much as possible") may insert latency specially if
> the receiving application is running on another CPU and that it would be
> better if we signalled as early as possible.
>
> This patch thus basically inverts the logic on fb586f25300f and signals
> it as early as possible, similar to what we had before.
>
> Fixes: fb586f25300f ("sctp: delay calls to sk_data_ready() as much as possible")
> Reported-by: Dave Miller <davem@davemloft.net>
> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Applied, thanks Marcelo.
^ permalink raw reply
* Re: [PATCH net v2 1/1] tipc: only process unicast on intended node
From: David Miller @ 2016-05-02 1:04 UTC (permalink / raw)
To: jon.maloy
Cc: netdev, paul.gortmaker, parthasarathy.bhuvaragan, richard.alpe,
ying.xue, maloy, tipc-discussion, hamish.martin
In-Reply-To: <1461940824-20121-1-git-send-email-jon.maloy@ericsson.com>
From: Jon Maloy <jon.maloy@ericsson.com>
Date: Fri, 29 Apr 2016 10:40:24 -0400
> From: Hamish Martin <hamish.martin@alliedtelesis.co.nz>
>
> We have observed complete lock up of broadcast-link transmission due to
> unacknowledged packets never being removed from the 'transmq' queue. This
> is traced to nodes having their ack field set beyond the sequence number
> of packets that have actually been transmitted to them.
> Consider an example where node 1 has sent 10 packets to node 2 on a
> link and node 3 has sent 20 packets to node 2 on another link. We
> see examples of an ack from node 2 destined for node 3 being treated as
> an ack from node 2 at node 1. This leads to the ack on the node 1 to node
> 2 link being increased to 20 even though we have only sent 10 packets.
> When node 1 does get around to sending further packets, none of the
> packets with sequence numbers less than 21 are actually removed from the
> transmq.
> To resolve this we reinstate some code lost in commit d999297c3dbb ("tipc:
> reduce locking scope during packet reception") which ensures that only
> messages destined for the receiving node are processed by that node. This
> prevents the sequence numbers from getting out of sync and resolves the
> packet leakage, thereby resolving the broadcast-link transmission
> lock-ups we observed.
>
> While we are aware that this change only patches over a root problem that
> we still haven't identified, this is a sanity test that it is always
> legitimate to do. It will remain in the code even after we identify and
> fix the real problem.
>
> Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> Reviewed-by: John Thompson <john.thompson@alliedtelesis.co.nz>
> Signed-off-by: Hamish Martin <hamish.martin@alliedtelesis.co.nz>
> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Applied.
^ permalink raw reply
* Re: [PATCH net] cxgb3: fix out of bounds read
From: David Miller @ 2016-05-02 1:00 UTC (permalink / raw)
To: mschmidt; +Cc: netdev, santosh, jstancek
In-Reply-To: <1461920810-15228-1-git-send-email-mschmidt@redhat.com>
From: Michal Schmidt <mschmidt@redhat.com>
Date: Fri, 29 Apr 2016 11:06:50 +0200
> An out of bounds read of 2 bytes was discovered in cxgb3 with KASAN.
>
> t3_config_rss() expects both arrays it gets as parameters to have
> terminators. setup_rss(), the caller, forgets to add a terminator to
> one of the arrays. Thankfully the iteration in t3_config_rss() stops
> anyway, but in the last iteration the check for the terminator
> is an out of bounds read.
>
> Add the missing terminator to rspq_map[].
>
> Reported-by: Jan Stancek <jstancek@redhat.com>
> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Applied.
^ permalink raw reply
* Re: [PATCH] net/smscx5xx: use the device tree for mac address
From: David Miller @ 2016-05-02 0:58 UTC (permalink / raw)
To: lkundrak; +Cc: linux-kernel, linux-usb, netdev, steve.glendinning, arnd
In-Reply-To: <1461913559-15902-1-git-send-email-lkundrak@v3.sk>
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Fri, 29 Apr 2016 09:05:59 +0200
> From: Arnd Bergmann <arnd@arndb.de>
>
> This takes the MAC address for smsc75xx/smsc95xx USB network devices
> from a the device tree. This is required to get a usable persistent
> address on the popular beagleboard, whose hardware designers
> accidentally forgot that an ethernet device really requires an a
> MAC address to be functional.
>
> The Raspberry Pi also ships smsc9514 without a serial EEPROM, stores
> the MAC address in ROM accessible via VC4 firmware.
>
> The smsc75xx and smsc95xx drivers are just two copies of the
> same code, so better fix both.
>
> [lkundrak@v3.sk: updated to use of_get_property() as per suggestion from
> Arnd, reworded the message and comments a bit]
>
> Tested-by: Lubomir Rintel <lkundrak@v3.sk>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH V2] mdio_bus: Fix MDIO bus scanning in __mdiobus_register()
From: David Miller @ 2016-05-02 0:50 UTC (permalink / raw)
To: marex; +Cc: netdev, arnd, dinguyen, f.fainelli, sergei.shtylyov
In-Reply-To: <1462150051-6308-1-git-send-email-marex@denx.de>
From: Marek Vasut <marex@denx.de>
Date: Mon, 2 May 2016 02:47:31 +0200
> Since commit b74766a0a0fe ("phylib: don't return NULL
> from get_phy_device()") in linux-next, phy_get_device() will return
> ERR_PTR(-ENODEV) instead of NULL if the PHY device ID is all ones.
>
> This causes problem with stmmac driver and likely some other drivers
> which call mdiobus_register(). I triggered this bug on SoCFPGA MCVEVK
> board with linux-next 20160427 and 20160428. In case of the stmmac, if
> there is no PHY node specified in the DT for the stmmac block, the stmmac
> driver ( drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c function
> stmmac_mdio_register() ) will call mdiobus_register() , which will
> register the MDIO bus and probe for the PHY.
>
> The mdiobus_register() resp. __mdiobus_register() iterates over all of
> the addresses on the MDIO bus and calls mdiobus_scan() for each of them,
> which invokes get_phy_device(). Before the aforementioned patch, the
> mdiobus_scan() would return NULL if no PHY was found on a given address
> and mdiobus_register() would continue and try the next PHY address. Now,
> mdiobus_scan() returns ERR_PTR(-ENODEV), which is caught by the
> 'if (IS_ERR(phydev))' condition and the loop exits immediately if the
> PHY address does not contain PHY.
>
> Repair this by explicitly checking for the ERR_PTR(-ENODEV) and if this
> error comes around, continue with the next PHY address.
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] mdio_bus: Fix MDIO bus scanning in __mdiobus_register()
From: Marek Vasut @ 2016-05-02 0:48 UTC (permalink / raw)
To: David Miller; +Cc: netdev, arnd, dinguyen, f.fainelli, sergei.shtylyov
In-Reply-To: <20160501.194945.1926401275113473949.davem@davemloft.net>
On 05/02/2016 01:49 AM, David Miller wrote:
>
> Please respin this with the checkpatch errors fixed.
Done and sent.
> I don't have any opinion about the conditional parenthesis, so
> don't worry about that.
>
OK
Thanks!
--
Best regards,
Marek Vasut
^ permalink raw reply
* [PATCH V2] mdio_bus: Fix MDIO bus scanning in __mdiobus_register()
From: Marek Vasut @ 2016-05-02 0:47 UTC (permalink / raw)
To: netdev
Cc: Marek Vasut, Arnd Bergmann, David S . Miller, Dinh Nguyen,
Florian Fainelli, Sergei Shtylyov
Since commit b74766a0a0fe ("phylib: don't return NULL
from get_phy_device()") in linux-next, phy_get_device() will return
ERR_PTR(-ENODEV) instead of NULL if the PHY device ID is all ones.
This causes problem with stmmac driver and likely some other drivers
which call mdiobus_register(). I triggered this bug on SoCFPGA MCVEVK
board with linux-next 20160427 and 20160428. In case of the stmmac, if
there is no PHY node specified in the DT for the stmmac block, the stmmac
driver ( drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c function
stmmac_mdio_register() ) will call mdiobus_register() , which will
register the MDIO bus and probe for the PHY.
The mdiobus_register() resp. __mdiobus_register() iterates over all of
the addresses on the MDIO bus and calls mdiobus_scan() for each of them,
which invokes get_phy_device(). Before the aforementioned patch, the
mdiobus_scan() would return NULL if no PHY was found on a given address
and mdiobus_register() would continue and try the next PHY address. Now,
mdiobus_scan() returns ERR_PTR(-ENODEV), which is caught by the
'if (IS_ERR(phydev))' condition and the loop exits immediately if the
PHY address does not contain PHY.
Repair this by explicitly checking for the ERR_PTR(-ENODEV) and if this
error comes around, continue with the next PHY address.
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: David S. Miller <davem@davemloft.net>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
---
V2: Fixed checkpatch warning in the commit message
Added Ack from Florian
---
drivers/net/phy/mdio_bus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index 499003ee..388f992 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -333,7 +333,7 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner)
struct phy_device *phydev;
phydev = mdiobus_scan(bus, i);
- if (IS_ERR(phydev)) {
+ if (IS_ERR(phydev) && (PTR_ERR(phydev) != -ENODEV)) {
err = PTR_ERR(phydev);
goto error;
}
--
2.7.0
^ permalink raw reply related
* [net-next 15/15] i40e/i40evf: Add support for GSO partial with UDP_TUNNEL_CSUM and GRE_CSUM
From: Jeff Kirsher @ 2016-05-02 0:06 UTC (permalink / raw)
To: davem; +Cc: Alexander Duyck, netdev, nhorman, sassmann, jogreene,
Jeff Kirsher
In-Reply-To: <1462147581-135254-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Alexander Duyck <aduyck@mirantis.com>
This patch makes it so that i40e and i40evf can use GSO_PARTIAL to support
segmentation for frames with checksums enabled in outer headers. As a
result we can now send data over these types of tunnels at over 20Gb/s
versus the 12Gb/s that was previously possible on my system.
The advantage with the i40e parts is that this offload is mostly
transparent as the hardware still deals with the inner and/or outer IPv4
headers so the IP ID is still incrementing for both when this offload is
performed.
Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 10 ++++++++--
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 7 ++++++-
drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 7 ++++++-
drivers/net/ethernet/intel/i40evf/i40evf_main.c | 10 ++++++++--
4 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 19a2d30..8e6c0f2 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -9130,20 +9130,25 @@ static int i40e_config_netdev(struct i40e_vsi *vsi)
NETIF_F_TSO_ECN |
NETIF_F_TSO6 |
NETIF_F_GSO_GRE |
+ NETIF_F_GSO_GRE_CSUM |
NETIF_F_GSO_IPIP |
NETIF_F_GSO_SIT |
NETIF_F_GSO_UDP_TUNNEL |
NETIF_F_GSO_UDP_TUNNEL_CSUM |
+ NETIF_F_GSO_PARTIAL |
NETIF_F_SCTP_CRC |
NETIF_F_RXHASH |
NETIF_F_RXCSUM |
0;
if (!(pf->flags & I40E_FLAG_OUTER_UDP_CSUM_CAPABLE))
- netdev->hw_enc_features ^= NETIF_F_GSO_UDP_TUNNEL_CSUM;
+ netdev->gso_partial_features |= NETIF_F_GSO_UDP_TUNNEL_CSUM;
+
+ netdev->gso_partial_features |= NETIF_F_GSO_GRE_CSUM;
/* record features VLANs can make use of */
- netdev->vlan_features |= netdev->hw_enc_features;
+ netdev->vlan_features |= netdev->hw_enc_features |
+ NETIF_F_TSO_MANGLEID;
if (!(pf->flags & I40E_FLAG_MFP_ENABLED))
netdev->hw_features |= NETIF_F_NTUPLE;
@@ -9153,6 +9158,7 @@ static int i40e_config_netdev(struct i40e_vsi *vsi)
NETIF_F_HW_VLAN_CTAG_RX;
netdev->features |= netdev->hw_features | NETIF_F_HW_VLAN_CTAG_FILTER;
+ netdev->hw_enc_features |= NETIF_F_TSO_MANGLEID;
if (vsi->type == I40E_VSI_MAIN) {
SET_NETDEV_DEV(netdev, &pf->pdev->dev);
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 285efe9..2765d7e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -2301,11 +2301,15 @@ static int i40e_tso(struct sk_buff *skb, u8 *hdr_len, u64 *cd_type_cmd_tso_mss)
}
if (skb_shinfo(skb)->gso_type & (SKB_GSO_GRE |
+ SKB_GSO_GRE_CSUM |
SKB_GSO_IPIP |
SKB_GSO_SIT |
SKB_GSO_UDP_TUNNEL |
SKB_GSO_UDP_TUNNEL_CSUM)) {
- if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_TUNNEL_CSUM) {
+ if (!(skb_shinfo(skb)->gso_type & SKB_GSO_PARTIAL) &&
+ (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_TUNNEL_CSUM)) {
+ l4.udp->len = 0;
+
/* determine offset of outer transport header */
l4_offset = l4.hdr - skb->data;
@@ -2482,6 +2486,7 @@ static int i40e_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags,
/* indicate if we need to offload outer UDP header */
if ((*tx_flags & I40E_TX_FLAGS_TSO) &&
+ !(skb_shinfo(skb)->gso_type & SKB_GSO_PARTIAL) &&
(skb_shinfo(skb)->gso_type & SKB_GSO_UDP_TUNNEL_CSUM))
tunnel |= I40E_TXD_CTX_QW0_L4T_CS_MASK;
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
index 4633235..ede8dfc 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
@@ -1566,11 +1566,15 @@ static int i40e_tso(struct sk_buff *skb, u8 *hdr_len, u64 *cd_type_cmd_tso_mss)
}
if (skb_shinfo(skb)->gso_type & (SKB_GSO_GRE |
+ SKB_GSO_GRE_CSUM |
SKB_GSO_IPIP |
SKB_GSO_SIT |
SKB_GSO_UDP_TUNNEL |
SKB_GSO_UDP_TUNNEL_CSUM)) {
- if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_TUNNEL_CSUM) {
+ if (!(skb_shinfo(skb)->gso_type & SKB_GSO_PARTIAL) &&
+ (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_TUNNEL_CSUM)) {
+ l4.udp->len = 0;
+
/* determine offset of outer transport header */
l4_offset = l4.hdr - skb->data;
@@ -1705,6 +1709,7 @@ static int i40e_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags,
/* indicate if we need to offload outer UDP header */
if ((*tx_flags & I40E_TX_FLAGS_TSO) &&
+ !(skb_shinfo(skb)->gso_type & SKB_GSO_PARTIAL) &&
(skb_shinfo(skb)->gso_type & SKB_GSO_UDP_TUNNEL_CSUM))
tunnel |= I40E_TXD_CTX_QW0_L4T_CS_MASK;
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index b9b1dd8..9f0bd7a 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -2240,20 +2240,25 @@ int i40evf_process_config(struct i40evf_adapter *adapter)
NETIF_F_TSO_ECN |
NETIF_F_TSO6 |
NETIF_F_GSO_GRE |
+ NETIF_F_GSO_GRE_CSUM |
NETIF_F_GSO_IPIP |
NETIF_F_GSO_SIT |
NETIF_F_GSO_UDP_TUNNEL |
NETIF_F_GSO_UDP_TUNNEL_CSUM |
+ NETIF_F_GSO_PARTIAL |
NETIF_F_SCTP_CRC |
NETIF_F_RXHASH |
NETIF_F_RXCSUM |
0;
if (!(adapter->flags & I40EVF_FLAG_OUTER_UDP_CSUM_CAPABLE))
- netdev->hw_enc_features ^= NETIF_F_GSO_UDP_TUNNEL_CSUM;
+ netdev->gso_partial_features |= NETIF_F_GSO_UDP_TUNNEL_CSUM;
+
+ netdev->gso_partial_features |= NETIF_F_GSO_GRE_CSUM;
/* record features VLANs can make use of */
- netdev->vlan_features |= netdev->hw_enc_features;
+ netdev->vlan_features |= netdev->hw_enc_features |
+ NETIF_F_TSO_MANGLEID;
/* Write features and hw_features separately to avoid polluting
* with, or dropping, features that are set when we registgered.
@@ -2261,6 +2266,7 @@ int i40evf_process_config(struct i40evf_adapter *adapter)
netdev->hw_features |= netdev->hw_enc_features;
netdev->features |= netdev->hw_enc_features | I40EVF_VLAN_FEATURES;
+ netdev->hw_enc_features |= NETIF_F_TSO_MANGLEID;
/* disable VLAN features if not supported */
if (!(vfres->vf_offload_flags & I40E_VIRTCHNL_VF_OFFLOAD_VLAN))
--
2.5.5
^ permalink raw reply related
* [net-next 14/15] i40evf: make use of BIT() macro to avoid signed left shift
From: Jeff Kirsher @ 2016-05-02 0:06 UTC (permalink / raw)
To: davem; +Cc: Jacob Keller, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
In-Reply-To: <1462147581-135254-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
.../net/ethernet/intel/i40evf/i40e_adminq_cmd.h | 44 +++++++++++-----------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h b/drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h
index 180ae57..3114dcf 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h
+++ b/drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h
@@ -78,17 +78,17 @@ struct i40e_aq_desc {
#define I40E_AQ_FLAG_EI_SHIFT 14
#define I40E_AQ_FLAG_FE_SHIFT 15
-#define I40E_AQ_FLAG_DD (1 << I40E_AQ_FLAG_DD_SHIFT) /* 0x1 */
-#define I40E_AQ_FLAG_CMP (1 << I40E_AQ_FLAG_CMP_SHIFT) /* 0x2 */
-#define I40E_AQ_FLAG_ERR (1 << I40E_AQ_FLAG_ERR_SHIFT) /* 0x4 */
-#define I40E_AQ_FLAG_VFE (1 << I40E_AQ_FLAG_VFE_SHIFT) /* 0x8 */
-#define I40E_AQ_FLAG_LB (1 << I40E_AQ_FLAG_LB_SHIFT) /* 0x200 */
-#define I40E_AQ_FLAG_RD (1 << I40E_AQ_FLAG_RD_SHIFT) /* 0x400 */
-#define I40E_AQ_FLAG_VFC (1 << I40E_AQ_FLAG_VFC_SHIFT) /* 0x800 */
-#define I40E_AQ_FLAG_BUF (1 << I40E_AQ_FLAG_BUF_SHIFT) /* 0x1000 */
-#define I40E_AQ_FLAG_SI (1 << I40E_AQ_FLAG_SI_SHIFT) /* 0x2000 */
-#define I40E_AQ_FLAG_EI (1 << I40E_AQ_FLAG_EI_SHIFT) /* 0x4000 */
-#define I40E_AQ_FLAG_FE (1 << I40E_AQ_FLAG_FE_SHIFT) /* 0x8000 */
+#define I40E_AQ_FLAG_DD BIT(I40E_AQ_FLAG_DD_SHIFT) /* 0x1 */
+#define I40E_AQ_FLAG_CMP BIT(I40E_AQ_FLAG_CMP_SHIFT) /* 0x2 */
+#define I40E_AQ_FLAG_ERR BIT(I40E_AQ_FLAG_ERR_SHIFT) /* 0x4 */
+#define I40E_AQ_FLAG_VFE BIT(I40E_AQ_FLAG_VFE_SHIFT) /* 0x8 */
+#define I40E_AQ_FLAG_LB BIT(I40E_AQ_FLAG_LB_SHIFT) /* 0x200 */
+#define I40E_AQ_FLAG_RD BIT(I40E_AQ_FLAG_RD_SHIFT) /* 0x400 */
+#define I40E_AQ_FLAG_VFC BIT(I40E_AQ_FLAG_VFC_SHIFT) /* 0x800 */
+#define I40E_AQ_FLAG_BUF BIT(I40E_AQ_FLAG_BUF_SHIFT) /* 0x1000 */
+#define I40E_AQ_FLAG_SI BIT(I40E_AQ_FLAG_SI_SHIFT) /* 0x2000 */
+#define I40E_AQ_FLAG_EI BIT(I40E_AQ_FLAG_EI_SHIFT) /* 0x4000 */
+#define I40E_AQ_FLAG_FE BIT(I40E_AQ_FLAG_FE_SHIFT) /* 0x8000 */
/* error codes */
enum i40e_admin_queue_err {
@@ -1625,11 +1625,11 @@ enum i40e_aq_phy_type {
enum i40e_aq_link_speed {
I40E_LINK_SPEED_UNKNOWN = 0,
- I40E_LINK_SPEED_100MB = (1 << I40E_LINK_SPEED_100MB_SHIFT),
- I40E_LINK_SPEED_1GB = (1 << I40E_LINK_SPEED_1000MB_SHIFT),
- I40E_LINK_SPEED_10GB = (1 << I40E_LINK_SPEED_10GB_SHIFT),
- I40E_LINK_SPEED_40GB = (1 << I40E_LINK_SPEED_40GB_SHIFT),
- I40E_LINK_SPEED_20GB = (1 << I40E_LINK_SPEED_20GB_SHIFT)
+ I40E_LINK_SPEED_100MB = BIT(I40E_LINK_SPEED_100MB_SHIFT),
+ I40E_LINK_SPEED_1GB = BIT(I40E_LINK_SPEED_1000MB_SHIFT),
+ I40E_LINK_SPEED_10GB = BIT(I40E_LINK_SPEED_10GB_SHIFT),
+ I40E_LINK_SPEED_40GB = BIT(I40E_LINK_SPEED_40GB_SHIFT),
+ I40E_LINK_SPEED_20GB = BIT(I40E_LINK_SPEED_20GB_SHIFT)
};
struct i40e_aqc_module_desc {
@@ -1900,9 +1900,9 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_config_write);
/* Used for 0x0704 as well as for 0x0705 commands */
#define I40E_AQ_ANVM_FEATURE_OR_IMMEDIATE_SHIFT 1
#define I40E_AQ_ANVM_FEATURE_OR_IMMEDIATE_MASK \
- (1 << I40E_AQ_ANVM_FEATURE_OR_IMMEDIATE_SHIFT)
+ BIT(I40E_AQ_ANVM_FEATURE_OR_IMMEDIATE_SHIFT)
#define I40E_AQ_ANVM_FEATURE 0
-#define I40E_AQ_ANVM_IMMEDIATE_FIELD (1 << FEATURE_OR_IMMEDIATE_SHIFT)
+#define I40E_AQ_ANVM_IMMEDIATE_FIELD BIT(FEATURE_OR_IMMEDIATE_SHIFT)
struct i40e_aqc_nvm_config_data_feature {
__le16 feature_id;
#define I40E_AQ_ANVM_FEATURE_OPTION_OEM_ONLY 0x01
@@ -2171,7 +2171,7 @@ struct i40e_aqc_del_udp_tunnel_completion {
I40E_CHECK_CMD_LENGTH(i40e_aqc_del_udp_tunnel_completion);
struct i40e_aqc_get_set_rss_key {
-#define I40E_AQC_SET_RSS_KEY_VSI_VALID (0x1 << 15)
+#define I40E_AQC_SET_RSS_KEY_VSI_VALID BIT(15)
#define I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT 0
#define I40E_AQC_SET_RSS_KEY_VSI_ID_MASK (0x3FF << \
I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT)
@@ -2191,14 +2191,14 @@ struct i40e_aqc_get_set_rss_key_data {
I40E_CHECK_STRUCT_LEN(0x34, i40e_aqc_get_set_rss_key_data);
struct i40e_aqc_get_set_rss_lut {
-#define I40E_AQC_SET_RSS_LUT_VSI_VALID (0x1 << 15)
+#define I40E_AQC_SET_RSS_LUT_VSI_VALID BIT(15)
#define I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT 0
#define I40E_AQC_SET_RSS_LUT_VSI_ID_MASK (0x3FF << \
I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT)
__le16 vsi_id;
#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT 0
-#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK (0x1 << \
- I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT)
+#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK \
+ BIT(I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT)
#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_VSI 0
#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_PF 1
--
2.5.5
^ permalink raw reply related
* [net-next 13/15] i40e: make use of BIT() macro to prevent left shift of signed values
From: Jeff Kirsher @ 2016-05-02 0:06 UTC (permalink / raw)
To: davem; +Cc: Jacob Keller, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
In-Reply-To: <1462147581-135254-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 53 +++++++++++------------
1 file changed, 25 insertions(+), 28 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h
index 48c0c00..eacbe74 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h
@@ -78,17 +78,17 @@ struct i40e_aq_desc {
#define I40E_AQ_FLAG_EI_SHIFT 14
#define I40E_AQ_FLAG_FE_SHIFT 15
-#define I40E_AQ_FLAG_DD (1 << I40E_AQ_FLAG_DD_SHIFT) /* 0x1 */
-#define I40E_AQ_FLAG_CMP (1 << I40E_AQ_FLAG_CMP_SHIFT) /* 0x2 */
-#define I40E_AQ_FLAG_ERR (1 << I40E_AQ_FLAG_ERR_SHIFT) /* 0x4 */
-#define I40E_AQ_FLAG_VFE (1 << I40E_AQ_FLAG_VFE_SHIFT) /* 0x8 */
-#define I40E_AQ_FLAG_LB (1 << I40E_AQ_FLAG_LB_SHIFT) /* 0x200 */
-#define I40E_AQ_FLAG_RD (1 << I40E_AQ_FLAG_RD_SHIFT) /* 0x400 */
-#define I40E_AQ_FLAG_VFC (1 << I40E_AQ_FLAG_VFC_SHIFT) /* 0x800 */
-#define I40E_AQ_FLAG_BUF (1 << I40E_AQ_FLAG_BUF_SHIFT) /* 0x1000 */
-#define I40E_AQ_FLAG_SI (1 << I40E_AQ_FLAG_SI_SHIFT) /* 0x2000 */
-#define I40E_AQ_FLAG_EI (1 << I40E_AQ_FLAG_EI_SHIFT) /* 0x4000 */
-#define I40E_AQ_FLAG_FE (1 << I40E_AQ_FLAG_FE_SHIFT) /* 0x8000 */
+#define I40E_AQ_FLAG_DD BIT(I40E_AQ_FLAG_DD_SHIFT) /* 0x1 */
+#define I40E_AQ_FLAG_CMP BIT(I40E_AQ_FLAG_CMP_SHIFT) /* 0x2 */
+#define I40E_AQ_FLAG_ERR BIT(I40E_AQ_FLAG_ERR_SHIFT) /* 0x4 */
+#define I40E_AQ_FLAG_VFE BIT(I40E_AQ_FLAG_VFE_SHIFT) /* 0x8 */
+#define I40E_AQ_FLAG_LB BIT(I40E_AQ_FLAG_LB_SHIFT) /* 0x200 */
+#define I40E_AQ_FLAG_RD BIT(I40E_AQ_FLAG_RD_SHIFT) /* 0x400 */
+#define I40E_AQ_FLAG_VFC BIT(I40E_AQ_FLAG_VFC_SHIFT) /* 0x800 */
+#define I40E_AQ_FLAG_BUF BIT(I40E_AQ_FLAG_BUF_SHIFT) /* 0x1000 */
+#define I40E_AQ_FLAG_SI BIT(I40E_AQ_FLAG_SI_SHIFT) /* 0x2000 */
+#define I40E_AQ_FLAG_EI BIT(I40E_AQ_FLAG_EI_SHIFT) /* 0x4000 */
+#define I40E_AQ_FLAG_FE BIT(I40E_AQ_FLAG_FE_SHIFT) /* 0x8000 */
/* error codes */
enum i40e_admin_queue_err {
@@ -1628,11 +1628,11 @@ enum i40e_aq_phy_type {
enum i40e_aq_link_speed {
I40E_LINK_SPEED_UNKNOWN = 0,
- I40E_LINK_SPEED_100MB = (1 << I40E_LINK_SPEED_100MB_SHIFT),
- I40E_LINK_SPEED_1GB = (1 << I40E_LINK_SPEED_1000MB_SHIFT),
- I40E_LINK_SPEED_10GB = (1 << I40E_LINK_SPEED_10GB_SHIFT),
- I40E_LINK_SPEED_40GB = (1 << I40E_LINK_SPEED_40GB_SHIFT),
- I40E_LINK_SPEED_20GB = (1 << I40E_LINK_SPEED_20GB_SHIFT)
+ I40E_LINK_SPEED_100MB = BIT(I40E_LINK_SPEED_100MB_SHIFT),
+ I40E_LINK_SPEED_1GB = BIT(I40E_LINK_SPEED_1000MB_SHIFT),
+ I40E_LINK_SPEED_10GB = BIT(I40E_LINK_SPEED_10GB_SHIFT),
+ I40E_LINK_SPEED_40GB = BIT(I40E_LINK_SPEED_40GB_SHIFT),
+ I40E_LINK_SPEED_20GB = BIT(I40E_LINK_SPEED_20GB_SHIFT)
};
struct i40e_aqc_module_desc {
@@ -1903,9 +1903,9 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_config_write);
/* Used for 0x0704 as well as for 0x0705 commands */
#define I40E_AQ_ANVM_FEATURE_OR_IMMEDIATE_SHIFT 1
#define I40E_AQ_ANVM_FEATURE_OR_IMMEDIATE_MASK \
- (1 << I40E_AQ_ANVM_FEATURE_OR_IMMEDIATE_SHIFT)
+ BIT(I40E_AQ_ANVM_FEATURE_OR_IMMEDIATE_SHIFT)
#define I40E_AQ_ANVM_FEATURE 0
-#define I40E_AQ_ANVM_IMMEDIATE_FIELD (1 << FEATURE_OR_IMMEDIATE_SHIFT)
+#define I40E_AQ_ANVM_IMMEDIATE_FIELD BIT(FEATURE_OR_IMMEDIATE_SHIFT)
struct i40e_aqc_nvm_config_data_feature {
__le16 feature_id;
#define I40E_AQ_ANVM_FEATURE_OPTION_OEM_ONLY 0x01
@@ -2202,13 +2202,11 @@ I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_get_cee_dcb_cfg_resp);
*/
struct i40e_aqc_lldp_set_local_mib {
#define SET_LOCAL_MIB_AC_TYPE_DCBX_SHIFT 0
-#define SET_LOCAL_MIB_AC_TYPE_DCBX_MASK (1 << SET_LOCAL_MIB_AC_TYPE_DCBX_SHIFT)
-#define SET_LOCAL_MIB_AC_TYPE_DCBX_MASK (1 << \
- SET_LOCAL_MIB_AC_TYPE_DCBX_SHIFT)
+#define SET_LOCAL_MIB_AC_TYPE_DCBX_MASK BIT(SET_LOCAL_MIB_AC_TYPE_DCBX_SHIFT)
#define SET_LOCAL_MIB_AC_TYPE_LOCAL_MIB 0x0
#define SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS_SHIFT (1)
-#define SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS_MASK (1 << \
- SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS_SHIFT)
+#define SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS_MASK \
+ BIT(SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS_SHIFT)
#define SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS 0x1
u8 type;
u8 reserved0;
@@ -2226,7 +2224,7 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_set_local_mib);
struct i40e_aqc_lldp_stop_start_specific_agent {
#define I40E_AQC_START_SPECIFIC_AGENT_SHIFT 0
#define I40E_AQC_START_SPECIFIC_AGENT_MASK \
- (1 << I40E_AQC_START_SPECIFIC_AGENT_SHIFT)
+ BIT(I40E_AQC_START_SPECIFIC_AGENT_SHIFT)
u8 command;
u8 reserved[15];
};
@@ -2279,7 +2277,7 @@ struct i40e_aqc_del_udp_tunnel_completion {
I40E_CHECK_CMD_LENGTH(i40e_aqc_del_udp_tunnel_completion);
struct i40e_aqc_get_set_rss_key {
-#define I40E_AQC_SET_RSS_KEY_VSI_VALID (0x1 << 15)
+#define I40E_AQC_SET_RSS_KEY_VSI_VALID BIT(15)
#define I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT 0
#define I40E_AQC_SET_RSS_KEY_VSI_ID_MASK (0x3FF << \
I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT)
@@ -2299,14 +2297,13 @@ struct i40e_aqc_get_set_rss_key_data {
I40E_CHECK_STRUCT_LEN(0x34, i40e_aqc_get_set_rss_key_data);
struct i40e_aqc_get_set_rss_lut {
-#define I40E_AQC_SET_RSS_LUT_VSI_VALID (0x1 << 15)
+#define I40E_AQC_SET_RSS_LUT_VSI_VALID BIT(15)
#define I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT 0
#define I40E_AQC_SET_RSS_LUT_VSI_ID_MASK (0x3FF << \
I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT)
__le16 vsi_id;
#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT 0
-#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK (0x1 << \
- I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT)
+#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK BIT(I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT)
#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_VSI 0
#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_PF 1
--
2.5.5
^ permalink raw reply related
* [net-next 12/15] i40e/i40evf: fix I40E_MASK signed shift overflow warnings
From: Jeff Kirsher @ 2016-05-02 0:06 UTC (permalink / raw)
To: davem; +Cc: Jacob Keller, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
In-Reply-To: <1462147581-135254-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jacob Keller <jacob.e.keller@intel.com>
GCC 6 has a new warning which will display when you attempt to left
shift a signed value beyond the storage size of the type. I40E_MASK
generates a mask value for 32bit registers. Properly typecast the mask
value and place the values in parenthesis to prevent macro expansion
issues.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_type.h | 2 +-
drivers/net/ethernet/intel/i40evf/i40e_type.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h
index 8aa14aa..bd5f13b 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_type.h
@@ -36,7 +36,7 @@
#include "i40e_devids.h"
/* I40E_MASK is a macro used on 32 bit registers */
-#define I40E_MASK(mask, shift) (mask << shift)
+#define I40E_MASK(mask, shift) ((u32)(mask) << (shift))
#define I40E_MAX_VSI_QP 16
#define I40E_MAX_VF_VSI 3
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_type.h b/drivers/net/ethernet/intel/i40evf/i40e_type.h
index bfc97c2..97f96e0 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40evf/i40e_type.h
@@ -36,7 +36,7 @@
#include "i40e_devids.h"
/* I40E_MASK is a macro used on 32 bit registers */
-#define I40E_MASK(mask, shift) (mask << shift)
+#define I40E_MASK(mask, shift) ((u32)(mask) << (shift))
#define I40E_MAX_VSI_QP 16
#define I40E_MAX_VF_VSI 3
--
2.5.5
^ 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