* Re: [PATCH 3.2 085/115] veth: don’t modify ip_summed; doing so treats packets with bad checksums as good.
From: Vijay Pandurangan @ 2016-04-30 22:01 UTC (permalink / raw)
To: Ben Greear
Cc: Tom Herbert, Ben Hutchings, Sabrina Dubroca, Hannes Frederic Sowa,
LKML, stable, akpm, David S. Miller, Cong Wang,
Linux Kernel Network Developers, Evan Jones, Nicolas Dichtel,
Phil Sutter, Toshiaki Makita, Cong Wang
In-Reply-To: <57252918.7070302@candelatech.com>
On Sat, Apr 30, 2016 at 5:52 PM, Ben Greear <greearb@candelatech.com> wrote:
>>
>> Good point, so if you had:
>>
>> eth0 <-> raw <-> user space-bridge <-> raw <-> vethA <-> veth B <->
>> userspace-stub <->eth1
>>
>> and user-space hub enabled this elide flag, things would work, right?
>> Then, it seems like what we need is a way to tell the kernel
>> router/bridge logic to follow elide signals in packets coming from
>> veth. I'm not sure what the best way to do this is because I'm less
>> familiar with conventions in that part of the kernel, but assuming
>> there's a way to do this, would it be acceptable?
>
>
> You cannot receive on one veth without transmitting on the other, so
> I think the elide csum logic can go on the raw-socket, and apply to packets
> in the transmit-from-user-space direction. Just allowing the socket to make
> the veth behave like it used to before this patch in question should be good
> enough, since that worked for us for years. So, just an option to modify
> the
> ip_summed for pkts sent on a socket is probably sufficient.
I don't think this is right. Consider:
- App A sends out corrupt packets 50% of the time and discards inbound data.
- App B doesn't care about corrupt packets and is happy to receive
them and has some way of dealing with them (special case)
- App C is a regular app, say nc or something.
In your world, where A decides what happens to data it transmits,
then
A<--veth-->B and A<---wire-->B will have the same behaviour
but
A<-- veth --> C and A<-- wire --> C will have _different_ behaviour: C
will behave incorrectly if it's connected over veth but correctly if
connected with a wire. That is a bug.
Since A cannot know what the app it's talking to will desire, I argue
that both sides of a message must be opted in to this optimization.
>
>>> There may be no sockets on the vethB port. And reader/writer is not
>>> a good way to look at it since I am implementing a bi-directional bridge
>>> in
>>> user-space and each packet-socket is for both rx and tx.
>>
>>
>> Sure, but we could model a bidrectional connection as two
>> unidirectional sockets for our discussions here, right?
>
>
> Best not to I think, you want to make sure that one socket can
> correctly handle tx and rx. As long as that works, then using
> uni-directional sockets should work too.
>
>
> Thanks,
> Ben
>
> --
> Ben Greear <greearb@candelatech.com>
> Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* Re: [PATCH 3.2 085/115] veth: don’t modify ip_summed; doing so treats packets with bad checksums as good.
From: Tom Herbert @ 2016-04-30 22:42 UTC (permalink / raw)
To: Ben Greear
Cc: Ben Hutchings, Sabrina Dubroca, Hannes Frederic Sowa, LKML,
stable, akpm, David S. Miller, Vijay Pandurangan, Cong Wang,
Linux Kernel Network Developers, Evan Jones, Nicolas Dichtel,
Phil Sutter, Toshiaki Makita, Cong Wang
In-Reply-To: <57251CB3.1040504@candelatech.com>
On Sat, Apr 30, 2016 at 1:59 PM, Ben Greear <greearb@candelatech.com> wrote:
>
> On 04/30/2016 12:54 PM, Tom Herbert wrote:
>>
>> We've put considerable effort into cleaning up the checksum interface
>> to make it as unambiguous as possible, please be very careful to
>> follow it. Broken checksum processing is really hard to detect and
>> debug.
>>
>> CHECKSUM_UNNECESSARY means that some number of _specific_ checksums
>> (indicated by csum_level) have been verified to be correct in a
>> packet. Blindly promoting CHECKSUM_NONE to CHECKSUM_UNNECESSARY is
>> never right. If CHECKSUM_UNNECESSARY is set in such a manner but the
>> checksum it would refer to has not been verified and is incorrect this
>> is a major bug.
>
>
> Suppose I know that the packet received on a packet-socket has
> already been verified by a NIC that supports hardware checksumming.
>
> Then, I want to transmit it on a veth interface using a second
> packet socket. I do not want veth to recalculate the checksum on
> transmit, nor to validate it on the peer veth on receive, because I do
> not want to waste the CPU cycles. I am assuming that my app is not
> accidentally corrupting frames, so the checksum can never be bad.
>
> How should the checksumming be configured for the packets going into
> the packet-socket from user-space?
>
Checksum unnecessary conversion to checksum complete should be done
and then the computed value can be sent to user space. If you want to
take advantage of the value on transmit then we would to change the
interface. But I'm not sure why recalculating the the checksum in the
host is even a problem. With all the advances in checksum offload,
LCO, RCO it seems like that shouldn't be a common case anyway.
> Also, I might want to send raw frames that do have
> broken checksums (lets assume a real NIC, not veth), and I want them
> to hit the wire with those bad checksums.
>
> How do I configure the checksumming in this case?
Just send raw packets with bad checksums (no checksum offload).
Tom
>
>
> Thanks,
> Ben
>
>
>
>>
>> Tom
>>
>> On Sat, Apr 30, 2016 at 12:40 PM, Ben Greear <greearb@candelatech.com>
>> wrote:
>>>
>>>
>>>
>>> On 04/30/2016 11:33 AM, Ben Hutchings wrote:
>>>>
>>>>
>>>> On Thu, 2016-04-28 at 12:29 +0200, Sabrina Dubroca wrote:
>>>>>
>>>>>
>>>>> Hello,
>>>
>>>
>>>
>>>>>>
>>>>>>
>>>>>> http://dmz2.candelatech.com/?p=linux-4.4.dev.y/.git;a=commitdiff;h=8153e983c0e5eba1aafe1fc296248ed2a553f1ac;hp=454b07405d694dad52e7f41af5816eed0190da8a
>>>>>
>>>>>
>>>>> Actually, no, this is not really a regression.
>>>>
>>>>
>>>> [...]
>>>>
>>>> It really is. Even though the old behaviour was a bug (raw packets
>>>> should not be changed), if there are real applications that depend on
>>>> that then we have to keep those applications working somehow.
>>>
>>>
>>>
>>> To be honest, I fail to see why the old behaviour is a bug when sending
>>> raw packets from user-space. If raw packets should not be changed, then
>>> we need some way to specify what the checksum setting is to begin with,
>>> otherwise, user-space has not enough control.
>>>
>>> A socket option for new programs, and sysctl configurable defaults for
>>> raw
>>> sockets
>>> for old binary programs would be sufficient I think.
>>>
>>>
>>> Thanks,
>>> Ben
>>>
>>> --
>>> Ben Greear <greearb@candelatech.com>
>>> Candela Technologies Inc http://www.candelatech.com
>>
>>
>
> --
> Ben Greear <greearb@candelatech.com>
> Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* Re: [PATCH 3.2 085/115] veth: don’t modify ip_summed; doing so treats packets with bad checksums as good.
From: Ben Greear @ 2016-04-30 22:43 UTC (permalink / raw)
To: Vijay Pandurangan
Cc: Tom Herbert, Ben Hutchings, Sabrina Dubroca, Hannes Frederic Sowa,
LKML, stable, akpm, David S. Miller, Cong Wang,
Linux Kernel Network Developers, Evan Jones, Nicolas Dichtel,
Phil Sutter, Toshiaki Makita, Cong Wang
In-Reply-To: <CAKUBDd8S2=YcJ5wtM24D6-vw+bMud=Om9TBykMvSYcJ4X5tryw@mail.gmail.com>
On 04/30/2016 03:01 PM, Vijay Pandurangan wrote:
> On Sat, Apr 30, 2016 at 5:52 PM, Ben Greear <greearb@candelatech.com> wrote:
>>>
>>> Good point, so if you had:
>>>
>>> eth0 <-> raw <-> user space-bridge <-> raw <-> vethA <-> veth B <->
>>> userspace-stub <->eth1
>>>
>>> and user-space hub enabled this elide flag, things would work, right?
>>> Then, it seems like what we need is a way to tell the kernel
>>> router/bridge logic to follow elide signals in packets coming from
>>> veth. I'm not sure what the best way to do this is because I'm less
>>> familiar with conventions in that part of the kernel, but assuming
>>> there's a way to do this, would it be acceptable?
>>
>>
>> You cannot receive on one veth without transmitting on the other, so
>> I think the elide csum logic can go on the raw-socket, and apply to packets
>> in the transmit-from-user-space direction. Just allowing the socket to make
>> the veth behave like it used to before this patch in question should be good
>> enough, since that worked for us for years. So, just an option to modify
>> the
>> ip_summed for pkts sent on a socket is probably sufficient.
>
> I don't think this is right. Consider:
>
> - App A sends out corrupt packets 50% of the time and discards inbound data.
> - App B doesn't care about corrupt packets and is happy to receive
> them and has some way of dealing with them (special case)
> - App C is a regular app, say nc or something.
>
> In your world, where A decides what happens to data it transmits,
> then
> A<--veth-->B and A<---wire-->B will have the same behaviour
>
> but
>
> A<-- veth --> C and A<-- wire --> C will have _different_ behaviour: C
> will behave incorrectly if it's connected over veth but correctly if
> connected with a wire. That is a bug.
>
> Since A cannot know what the app it's talking to will desire, I argue
> that both sides of a message must be opted in to this optimization.
How can you make a generic app C know how to do this? The path could be,
for instance:
eth0 <-> user-space-A <-> vethA <-> vethB <-> { kernel routing logic } <-> vethC <-> vethD <-> appC
There are no sockets on vethB, but it does need to have special behaviour to elide
csums. Even if appC is hacked to know how to twiddle some thing on it's veth port,
mucking with vethD will have no effect on vethB.
With regard to your example above, why would A corrupt packets? My guess:
1) It has bugs (so, fix the bugs, it could equally create incorrect data with proper checksums,
so just enabling checksumming adds no useful protection.)
2) It means to corrupt frames. In that case, someone must expect that C should receive incorrect
frames, otherwise why bother making App-A corrupt them in the first place?
3) You are explicitly trying to test the kernel checksum logic, so you want the kernel to
detect the bad checksum and throw away the packet. In this case, just don't set the socket
option in appA to elide checksums and the packet will be thrown away.
Any other cases you can think of?
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* [PATCH] macb: fix mdiobus_scan() error check
From: Sergei Shtylyov @ 2016-04-30 22:47 UTC (permalink / raw)
To: netdev, nicolas.ferre
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>
---
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;
}
^ permalink raw reply
* Re: [PATCH net-next 10/12] net/mlx5e: Create aRFS flow tables
From: Alexei Starovoitov @ 2016-05-01 2:18 UTC (permalink / raw)
To: Saeed Mahameed
Cc: David S. Miller, netdev, Or Gerlitz, Tal Alon, Eran Ben Elisha,
Maor Gottlieb
In-Reply-To: <1461883002-8912-11-git-send-email-saeedm@mellanox.com>
On Fri, Apr 29, 2016 at 01:36:40AM +0300, Saeed Mahameed wrote:
> From: Maor Gottlieb <maorg@mellanox.com>
>
> Create the following four flow tables for aRFS usage:
> 1. IPv4 TCP - filtering 4-tuple of IPv4 TCP packets.
> 2. IPv6 TCP - filtering 4-tuple of IPv6 TCP packets.
> 3. IPv4 UDP - filtering 4-tuple of IPv4 UDP packets.
> 4. IPv6 UDP - filtering 4-tuple of IPv6 UDP packets.
>
> Each flow table has two flow groups: one for the 4-tuple
> filtering (full match) and the other contains * rule for miss rule.
>
> Full match rule means a hit for aRFS and packet will be forwarded
> to the dedicated RQ/Core, miss rule packets will be forwarded to
> default RSS hashing.
>
> Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/Makefile | 1 +
> drivers/net/ethernet/mellanox/mlx5/core/en.h | 41 ++++
> drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c | 251 +++++++++++++++++++++
> drivers/net/ethernet/mellanox/mlx5/core/en_fs.c | 23 +-
> drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 8 +-
> drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 3 +-
> 6 files changed, 313 insertions(+), 14 deletions(-)
> create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/Makefile b/drivers/net/ethernet/mellanox/mlx5/core/Makefile
> index 4fc45ee..679e18f 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/Makefile
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/Makefile
> @@ -9,3 +9,4 @@ mlx5_core-$(CONFIG_MLX5_CORE_EN) += wq.o eswitch.o \
> en_txrx.o en_clock.o vxlan.o en_tc.o
>
> mlx5_core-$(CONFIG_MLX5_CORE_EN_DCB) += en_dcbnl.o
> +mlx5_core-$(CONFIG_RFS_ACCEL) += en_arfs.o
this line breaks the build when RFS is on
and CONFIG_MLX5_CORE_EN is off.
^ permalink raw reply
* Re: sfc: Please add rss_cpus=hyperthreads support
From: Andy Lutomirski @ 2016-05-01 2:27 UTC (permalink / raw)
To: Robert Stonehouse
Cc: Shradha Shah, Edward Cree, Network Development,
Solarflare linux maintainers
In-Reply-To: <5548CA3D.7010408@solarflare.com>
On Tue, May 5, 2015 at 6:48 AM, Robert Stonehouse
<rstonehouse@solarflare.com> wrote:
> On 02/05/15 01:03, Andy Lutomirski wrote:
>>
>> Can you please port the rss_cpus=hyperthreads feature from the
>> OpenOnload driver to the upstream driver? The fact that sticking:
>>
>> options sfc rss_cpus=hyperthreads
>>
>> into modprobe.conf causes sfc to fail to load when OpenOnload isn't
>> installed is incredibly annoying, and the option is genuinely useful.
>
>
> Sure; I will make sure that happens soon.
> I can see how that would be annoying.
Ping?
Thanks,
Andy
^ permalink raw reply
* Re: [PATCH 3.2 085/115] veth: don???t modify ip_summed; doing so treats packets with bad checksums as good.
From: Willy Tarreau @ 2016-05-01 5:30 UTC (permalink / raw)
To: Ben Greear
Cc: Vijay Pandurangan, Tom Herbert, Ben Hutchings, Sabrina Dubroca,
Hannes Frederic Sowa, LKML, stable, akpm, David S. Miller,
Cong Wang, Linux Kernel Network Developers, Evan Jones,
Nicolas Dichtel, Phil Sutter, Toshiaki Makita, Cong Wang
In-Reply-To: <57253527.7010009@candelatech.com>
On Sat, Apr 30, 2016 at 03:43:51PM -0700, Ben Greear wrote:
> On 04/30/2016 03:01 PM, Vijay Pandurangan wrote:
> > Consider:
> >
> > - App A sends out corrupt packets 50% of the time and discards inbound data.
(...)
> How can you make a generic app C know how to do this? The path could be,
> for instance:
>
> eth0 <-> user-space-A <-> vethA <-> vethB <-> { kernel routing logic } <-> vethC <-> vethD <-> appC
>
> There are no sockets on vethB, but it does need to have special behaviour to elide
> csums. Even if appC is hacked to know how to twiddle some thing on it's veth port,
> mucking with vethD will have no effect on vethB.
>
> With regard to your example above, why would A corrupt packets? My guess:
>
> 1) It has bugs (so, fix the bugs, it could equally create incorrect data with proper checksums,
> so just enabling checksumming adds no useful protection.)
I agree with Ben here, what he needs is the ability for userspace to be
trusted when *forwarding* a packet. Ideally you'd only want to receive
the csum status per packet on the packet socket and pass the same value
on the vethA interface, with this status being kept when the packet
reaches vethB.
If A purposely corrupts packet, it's A's problem. It's similar to designing
a NIC which intentionally corrupts packets and reports "checksum good".
The real issue is that in order to do things right, the userspace bridge
(here, "A") would really need to pass this status. In Ben's case as he
says, bad checksum packets are dropped before reaching A, so that
simplifies the process quite a bit and that might be what causes some
confusion, but ideally we'd rather have recvmsg() and sendmsg() with
these flags.
I faced the exact same issue 3 years ago when playing with netmap, it was
slow as hell because it would lose all checksum information when packets
were passing through userland, resulting in GRO/GSO etc being disabled,
and had to modify it to let userland preserve it. That's especially
important when you have to deal with possibly corrupted packets not yet
detected in the chain because the NIC did not validate their checksums.
Willy
^ permalink raw reply
* Re: [PATCH net-next 10/12] net/mlx5e: Create aRFS flow tables
From: Saeed Mahameed @ 2016-05-01 8:12 UTC (permalink / raw)
To: Alexei Starovoitov
Cc: Saeed Mahameed, David S. Miller, Linux Netdev List, Or Gerlitz,
Tal Alon, Eran Ben Elisha, Maor Gottlieb
In-Reply-To: <20160501021845.GA10348@ast-mbp.thefacebook.com>
On Sun, May 1, 2016 at 5:18 AM, Alexei Starovoitov
<alexei.starovoitov@gmail.com> wrote:
> On Fri, Apr 29, 2016 at 01:36:40AM +0300, Saeed Mahameed wrote:
>> From: Maor Gottlieb <maorg@mellanox.com>
>> mlx5_core-$(CONFIG_MLX5_CORE_EN_DCB) += en_dcbnl.o
>> +mlx5_core-$(CONFIG_RFS_ACCEL) += en_arfs.o
>
> this line breaks the build when RFS is on
> and CONFIG_MLX5_CORE_EN is off.
>
Will Fix.
Thank you Alexei.
^ permalink raw reply
* [PATCH] i40e: constify i40e_client_ops structure
From: Julia Lawall @ 2016-05-01 12:07 UTC (permalink / raw)
To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: 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
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>
---
drivers/infiniband/hw/i40iw/i40iw_main.c | 2 +-
drivers/net/ethernet/intel/i40e/i40e_client.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/i40iw/i40iw_main.c b/drivers/infiniband/hw/i40iw/i40iw_main.c
index 90e5af2..e41fae24 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_main.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_main.c
@@ -1863,7 +1863,7 @@ static enum i40iw_status_code i40iw_virtchnl_send(struct i40iw_sc_dev *dev,
}
/* client interface functions */
-static struct i40e_client_ops i40e_ops = {
+static const struct i40e_client_ops i40e_ops = {
.open = i40iw_open,
.close = i40iw_close,
.l2_param_change = i40iw_l2param_change,
diff --git a/drivers/net/ethernet/intel/i40e/i40e_client.h b/drivers/net/ethernet/intel/i40e/i40e_client.h
index bf6b453..a4601d9 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_client.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_client.h
@@ -217,7 +217,7 @@ struct i40e_client {
#define I40E_CLIENT_FLAGS_LAUNCH_ON_PROBE BIT(0)
#define I40E_TX_FLAGS_NOTIFY_OTHER_EVENTS BIT(2)
enum i40e_client_type type;
- struct i40e_client_ops *ops; /* client ops provided by the client */
+ const struct i40e_client_ops *ops; /* client ops provided by the client */
};
static inline bool i40e_client_is_registered(struct i40e_client *client)
--
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 related
* [PATCH] drivers: net: xgene: constify xgene_cle_ops structure
From: Julia Lawall @ 2016-05-01 12:36 UTC (permalink / raw)
To: Iyappan Subramanian; +Cc: kernel-janitors, Keyur Chudgar, netdev, linux-kernel
The xgene_cle_ops structure is never modified, so declare it as const.
Done with the help of Coccinelle.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/net/ethernet/apm/xgene/xgene_enet_cle.c | 2 +-
drivers/net/ethernet/apm/xgene/xgene_enet_cle.h | 2 +-
drivers/net/ethernet/apm/xgene/xgene_enet_main.h | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_cle.c b/drivers/net/ethernet/apm/xgene/xgene_enet_cle.c
index b2124886..6479288 100644
--- a/drivers/net/ethernet/apm/xgene/xgene_enet_cle.c
+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_cle.c
@@ -729,6 +729,6 @@ static int xgene_enet_cle_init(struct xgene_enet_pdata *pdata)
return xgene_cle_setup_ptree(pdata, enet_cle);
}
-struct xgene_cle_ops xgene_cle3in_ops = {
+const struct xgene_cle_ops xgene_cle3in_ops = {
.cle_init = xgene_enet_cle_init,
};
diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_cle.h b/drivers/net/ethernet/apm/xgene/xgene_enet_cle.h
index 29a17ab..13e829a 100644
--- a/drivers/net/ethernet/apm/xgene/xgene_enet_cle.h
+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_cle.h
@@ -290,6 +290,6 @@ struct xgene_enet_cle {
u32 jump_bytes;
};
-extern struct xgene_cle_ops xgene_cle3in_ops;
+extern const struct xgene_cle_ops xgene_cle3in_ops;
#endif /* __XGENE_ENET_CLE_H__ */
diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.h b/drivers/net/ethernet/apm/xgene/xgene_enet_main.h
index 175d188..0a2887b 100644
--- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.h
+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.h
@@ -191,7 +191,7 @@ struct xgene_enet_pdata {
const struct xgene_mac_ops *mac_ops;
const struct xgene_port_ops *port_ops;
struct xgene_ring_ops *ring_ops;
- struct xgene_cle_ops *cle_ops;
+ const struct xgene_cle_ops *cle_ops;
struct delayed_work link_work;
u32 port_id;
u8 cpu_bufnum;
^ permalink raw reply related
* [PATCH] VSOCK: constify vsock_transport structure
From: Julia Lawall @ 2016-05-01 12:49 UTC (permalink / raw)
To: David S. Miller
Cc: kernel-janitors, Ray Jui, Scott Branden, Jon Mason, netdev,
linux-arm-kernel, bcm-kernel-feedback-list, linux-kernel
The vsock_transport structure is never modified, so declare it as const.
Done with the help of Coccinelle.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
net/vmw_vsock/vmci_transport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c
index 5621473..4120b7a 100644
--- a/net/vmw_vsock/vmci_transport.c
+++ b/net/vmw_vsock/vmci_transport.c
@@ -2051,7 +2051,7 @@ static u32 vmci_transport_get_local_cid(void)
return vmci_get_context_id();
}
-static struct vsock_transport vmci_transport = {
+static const struct vsock_transport vmci_transport = {
.init = vmci_transport_socket_init,
.destruct = vmci_transport_destruct,
.release = vmci_transport_release,
^ permalink raw reply related
* Q: How to disable vlan strip in Intel igb driver ?
From: Ran Shalit @ 2016-05-01 13:13 UTC (permalink / raw)
To: netdev
Hello,
I am using intel igb driver in Linux.
The driver strip the packet from vlan inofmation. But we need this
information in the packet.
We tried to change build flag, or see if there is any feature with
ethtool that can disable this feature, but nothing helps.
Is there any way to achive this ?
Regards,
Ran
^ permalink raw reply
* [Question] Should `CAP_NET_ADMIN` be needed when opening `/dev/ppp`?
From: Wang Shanker @ 2016-05-01 13:38 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
Hi, all.
I’ve recently met some problems when trying to create a pppoe network link
inside a unprivileged container. There is a uid namespace which maps root
inside to a normal user outside. There is also a separate net namespace in the
container. I create a dev node inside the container and set right
permission.
However, `/dev/ppp` cannot get opened since the mapped normal user does not
have `CAP_NET_ADMIN`. The related code is in `drivers/net/ppp/ppp_generic.c`:
`int ppp_open()`
```
static int ppp_open(struct inode *inode, struct file *file)
{
/*
* This could (should?) be enforced by the permissions on /dev/ppp.
*/
if (!capable(CAP_NET_ADMIN))
return -EPERM;
return 0;
}
```
I wonder why CAP_NET_ADMIN is needed here, rather than leaving it to the
permission of the device node. If there is no need, I suggest that the
CAP_NET_ADMIN check be removed.
^ permalink raw reply
* Re: [PATCH net-next] ravb: Remove rx buffer ALIGN
From: Yoshihiro Kaneko @ 2016-05-01 14:29 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: netdev, David S. Miller, Simon Horman, Magnus Damm,
linux-renesas-soc
In-Reply-To: <571FBE21.4050908@cogentembedded.com>
Hi Sergei,
Sorry for the late reply.
2016-04-27 4:14 GMT+09:00 Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>:
> Hello.
>
> On 04/24/2016 07:16 PM, Yoshihiro Kaneko wrote:
>
>> From: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
>>
>> Aligning the reception data size is not required.
>
>
> OK, the gen 2/3 manuals indeed don't require this. I assume the patch has
> been tested...
>
>> Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
>> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
>
>
> I have a few comments though...
>
>> diff --git a/drivers/net/ethernet/renesas/ravb_main.c
>> b/drivers/net/ethernet/renesas/ravb_main.c
>> index 238b56f..66ed80c 100644
>> --- a/drivers/net/ethernet/renesas/ravb_main.c
>> +++ b/drivers/net/ethernet/renesas/ravb_main.c
>> @@ -246,10 +246,10 @@ static void ravb_ring_format(struct net_device
>> *ndev, int q)
>> for (i = 0; i < priv->num_rx_ring[q]; i++) {
>> /* RX descriptor */
>> rx_desc = &priv->rx_ring[q][i];
>> - /* The size of the buffer should be on 16-byte boundary.
>> */
>> - rx_desc->ds_cc = cpu_to_le16(ALIGN(PKT_BUF_SZ, 16));
>> - dma_addr = dma_map_single(ndev->dev.parent,
>> priv->rx_skb[q][i]->data,
>> - ALIGN(PKT_BUF_SZ, 16),
>> + rx_desc->ds_cc = cpu_to_le16(PKT_BUF_SZ);
>> + dma_addr = dma_map_single(ndev->dev.parent,
>> + priv->rx_skb[q][i]->data,
>
>
> Please don't reformat the lines above.
Got it.
>
>> + PKT_BUF_SZ,
>> DMA_FROM_DEVICE);
>> /* We just set the data size to 0 for a failed mapping
>> which
>> * should prevent DMA from happening...
>> @@ -557,8 +557,9 @@ static bool ravb_rx(struct net_device *ndev, int
>> *quota, int q)
>>
>> skb = priv->rx_skb[q][entry];
>> priv->rx_skb[q][entry] = NULL;
>> - dma_unmap_single(ndev->dev.parent,
>> le32_to_cpu(desc->dptr),
>> - ALIGN(PKT_BUF_SZ, 16),
>> + dma_unmap_single(ndev->dev.parent,
>> + le32_to_cpu(desc->dptr),
>
>
> Same here.
Likewise.
>
> [...]
>
> MBR, Sergei
>
Thanks,
kaneko
^ permalink raw reply
* Re: [PATCH net-next] ravb: Remove rx buffer ALIGN
From: Yoshihiro Kaneko @ 2016-05-01 14:34 UTC (permalink / raw)
To: Simon Horman
Cc: Sergei Shtylyov, netdev, David S. Miller, Magnus Damm,
linux-renesas-soc
In-Reply-To: <20160428233456.GC18128@verge.net.au>
Hi Simon-san,
Thank you for testing this patch!
Thanks,
kaneko
2016-04-29 8:34 GMT+09:00 Simon Horman <horms@verge.net.au>:
> Hi Sergei, Hi Kaneko-san,
>
> On Tue, Apr 26, 2016 at 10:14:41PM +0300, Sergei Shtylyov wrote:
>> Hello.
>>
>> On 04/24/2016 07:16 PM, Yoshihiro Kaneko wrote:
>>
>> >From: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
>> >
>> >Aligning the reception data size is not required.
>>
>> OK, the gen 2/3 manuals indeed don't require this. I assume the patch has
>> been tested...
>
> This morning I tested this patch applied on net-next using the
> r8a7795/salvator-x (Gen-3). My test was to boot to a user-space prompt
> using NFS root which was successful. I can run further tests on this setup
> if it would be useful.
>
> Unfortunately I do not have access to hardware to allow me to test this
> on Gen-2.
>
>> >Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
>> >Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
>
> Tested-by: Simon Horman <horms+renesas@verge.net.au>
>
>> I have a few comments though...
>
> [...]
^ permalink raw reply
* [PATCH 1/4] net: ethernet: gianfar: move to new ethtool api {get|set}_link_ksettings
From: Philippe Reynes @ 2016-05-01 15:08 UTC (permalink / raw)
To: pantelis.antoniou, vbordug, claudiu.manoil, leoli, treding, davem
Cc: netdev, linux-kernel, linuxppc-dev, Philippe Reynes
The ethtool api {get|set}_settings is deprecated.
We move the gianfar driver to new api {get|set}_link_ksettings.
Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
---
drivers/net/ethernet/freescale/gianfar_ethtool.c | 25 +++++++---------------
1 files changed, 8 insertions(+), 17 deletions(-)
diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c
index 4b0ee85..2c45c80 100644
--- a/drivers/net/ethernet/freescale/gianfar_ethtool.c
+++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c
@@ -185,7 +185,8 @@ static void gfar_gdrvinfo(struct net_device *dev,
}
-static int gfar_ssettings(struct net_device *dev, struct ethtool_cmd *cmd)
+static int gfar_set_ksettings(struct net_device *dev,
+ const struct ethtool_link_ksettings *cmd)
{
struct gfar_private *priv = netdev_priv(dev);
struct phy_device *phydev = priv->phydev;
@@ -193,29 +194,19 @@ static int gfar_ssettings(struct net_device *dev, struct ethtool_cmd *cmd)
if (NULL == phydev)
return -ENODEV;
- return phy_ethtool_sset(phydev, cmd);
+ return phy_ethtool_ksettings_set(phydev, cmd);
}
-
-/* Return the current settings in the ethtool_cmd structure */
-static int gfar_gsettings(struct net_device *dev, struct ethtool_cmd *cmd)
+static int gfar_get_ksettings(struct net_device *dev,
+ struct ethtool_link_ksettings *cmd)
{
struct gfar_private *priv = netdev_priv(dev);
struct phy_device *phydev = priv->phydev;
- struct gfar_priv_rx_q *rx_queue = NULL;
- struct gfar_priv_tx_q *tx_queue = NULL;
if (NULL == phydev)
return -ENODEV;
- tx_queue = priv->tx_queue[0];
- rx_queue = priv->rx_queue[0];
-
- /* etsec-1.7 and older versions have only one txic
- * and rxic regs although they support multiple queues */
- cmd->maxtxpkt = get_icft_value(tx_queue->txic);
- cmd->maxrxpkt = get_icft_value(rx_queue->rxic);
- return phy_ethtool_gset(phydev, cmd);
+ return phy_ethtool_ksettings_get(phydev, cmd);
}
/* Return the length of the register structure */
@@ -1565,8 +1556,6 @@ static int gfar_get_ts_info(struct net_device *dev,
}
const struct ethtool_ops gfar_ethtool_ops = {
- .get_settings = gfar_gsettings,
- .set_settings = gfar_ssettings,
.get_drvinfo = gfar_gdrvinfo,
.get_regs_len = gfar_reglen,
.get_regs = gfar_get_regs,
@@ -1589,4 +1578,6 @@ const struct ethtool_ops gfar_ethtool_ops = {
.set_rxnfc = gfar_set_nfc,
.get_rxnfc = gfar_get_nfc,
.get_ts_info = gfar_get_ts_info,
+ .get_link_ksettings = gfar_get_ksettings,
+ .set_link_ksettings = gfar_set_ksettings,
};
--
1.7.4.4
^ permalink raw reply related
* [PATCH 2/4] net: ethernet: ucc: move to new ethtool api {get|set}_link_ksettings
From: Philippe Reynes @ 2016-05-01 15:08 UTC (permalink / raw)
To: pantelis.antoniou, vbordug, claudiu.manoil, leoli, treding, davem
Cc: netdev, linux-kernel, linuxppc-dev, Philippe Reynes
In-Reply-To: <1462115291-11372-1-git-send-email-tremyfr@gmail.com>
The ethtool api {get|set}_settings is deprecated.
We move the ucc driver to new api {get|set}_link_ksettings.
Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
---
drivers/net/ethernet/freescale/ucc_geth_ethtool.c | 17 +++++++----------
1 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/freescale/ucc_geth_ethtool.c b/drivers/net/ethernet/freescale/ucc_geth_ethtool.c
index 89714f5..812a968 100644
--- a/drivers/net/ethernet/freescale/ucc_geth_ethtool.c
+++ b/drivers/net/ethernet/freescale/ucc_geth_ethtool.c
@@ -105,23 +105,20 @@ static const char rx_fw_stat_gstrings[][ETH_GSTRING_LEN] = {
#define UEC_RX_FW_STATS_LEN ARRAY_SIZE(rx_fw_stat_gstrings)
static int
-uec_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
+uec_get_ksettings(struct net_device *netdev, struct ethtool_link_ksettings *cmd)
{
struct ucc_geth_private *ugeth = netdev_priv(netdev);
struct phy_device *phydev = ugeth->phydev;
- struct ucc_geth_info *ug_info = ugeth->ug_info;
if (!phydev)
return -ENODEV;
- ecmd->maxtxpkt = 1;
- ecmd->maxrxpkt = ug_info->interruptcoalescingmaxvalue[0];
-
- return phy_ethtool_gset(phydev, ecmd);
+ return phy_ethtool_ksettings_get(phydev, cmd);
}
static int
-uec_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
+uec_set_ksettings(struct net_device *netdev,
+ const struct ethtool_link_ksettings *cmd)
{
struct ucc_geth_private *ugeth = netdev_priv(netdev);
struct phy_device *phydev = ugeth->phydev;
@@ -129,7 +126,7 @@ uec_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
if (!phydev)
return -ENODEV;
- return phy_ethtool_sset(phydev, ecmd);
+ return phy_ethtool_ksettings_set(phydev, cmd);
}
static void
@@ -392,8 +389,6 @@ static int uec_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
#endif /* CONFIG_PM */
static const struct ethtool_ops uec_ethtool_ops = {
- .get_settings = uec_get_settings,
- .set_settings = uec_set_settings,
.get_drvinfo = uec_get_drvinfo,
.get_regs_len = uec_get_regs_len,
.get_regs = uec_get_regs,
@@ -411,6 +406,8 @@ static const struct ethtool_ops uec_ethtool_ops = {
.get_wol = uec_get_wol,
.set_wol = uec_set_wol,
.get_ts_info = ethtool_op_get_ts_info,
+ .get_link_ksettings = uec_get_ksettings,
+ .set_link_ksettings = uec_set_ksettings,
};
void uec_set_ethtool_ops(struct net_device *netdev)
--
1.7.4.4
^ permalink raw reply related
* [PATCH 3/4] net: ethernet: fs-enet: move to new ethtool api {get|set}_link_ksettings
From: Philippe Reynes @ 2016-05-01 15:08 UTC (permalink / raw)
To: pantelis.antoniou, vbordug, claudiu.manoil, leoli, treding, davem
Cc: netdev, linux-kernel, linuxppc-dev, Philippe Reynes
In-Reply-To: <1462115291-11372-1-git-send-email-tremyfr@gmail.com>
The ethtool api {get|set}_settings is deprecated.
We move the fs-enet driver to new api {get|set}_link_ksettings.
Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
---
.../net/ethernet/freescale/fs_enet/fs_enet-main.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
index 48a9c17..da90b5a 100644
--- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
+++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
@@ -847,24 +847,28 @@ static void fs_get_regs(struct net_device *dev, struct ethtool_regs *regs,
regs->version = 0;
}
-static int fs_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+static int fs_get_ksettings(struct net_device *dev,
+ struct ethtool_link_ksettings *cmd)
{
struct fs_enet_private *fep = netdev_priv(dev);
+ struct phy_device *phydev = fep->phydev;
if (!fep->phydev)
return -ENODEV;
- return phy_ethtool_gset(fep->phydev, cmd);
+ return phy_ethtool_ksettings_get(phydev, cmd);
}
-static int fs_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+static int fs_set_ksettings(struct net_device *dev,
+ const struct ethtool_link_ksettings *cmd)
{
struct fs_enet_private *fep = netdev_priv(dev);
+ struct phy_device *phydev = fep->phydev;
if (!fep->phydev)
return -ENODEV;
- return phy_ethtool_sset(fep->phydev, cmd);
+ return phy_ethtool_ksettings_set(phydev, cmd);
}
static int fs_nway_reset(struct net_device *dev)
@@ -887,14 +891,14 @@ static void fs_set_msglevel(struct net_device *dev, u32 value)
static const struct ethtool_ops fs_ethtool_ops = {
.get_drvinfo = fs_get_drvinfo,
.get_regs_len = fs_get_regs_len,
- .get_settings = fs_get_settings,
- .set_settings = fs_set_settings,
.nway_reset = fs_nway_reset,
.get_link = ethtool_op_get_link,
.get_msglevel = fs_get_msglevel,
.set_msglevel = fs_set_msglevel,
.get_regs = fs_get_regs,
.get_ts_info = ethtool_op_get_ts_info,
+ .get_link_ksettings = fs_get_ksettings,
+ .set_link_ksettings = fs_set_ksettings,
};
static int fs_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
--
1.7.4.4
^ permalink raw reply related
* [PATCH 4/4] net: ethernet: fec_mpc52xx: move to new ethtool api {get|set}_link_ksettings
From: Philippe Reynes @ 2016-05-01 15:08 UTC (permalink / raw)
To: pantelis.antoniou, vbordug, claudiu.manoil, leoli, treding, davem
Cc: netdev, linux-kernel, linuxppc-dev, Philippe Reynes
In-Reply-To: <1462115291-11372-1-git-send-email-tremyfr@gmail.com>
The ethtool api {get|set}_settings is deprecated.
We move the fec_mpc52xx driver to new api {get|set}_link_ksettings.
Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
---
drivers/net/ethernet/freescale/fec_mpc52xx.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec_mpc52xx.c b/drivers/net/ethernet/freescale/fec_mpc52xx.c
index 25553ee..f444714 100644
--- a/drivers/net/ethernet/freescale/fec_mpc52xx.c
+++ b/drivers/net/ethernet/freescale/fec_mpc52xx.c
@@ -763,24 +763,28 @@ static void mpc52xx_fec_reset(struct net_device *dev)
/* ethtool interface */
-static int mpc52xx_fec_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+static int mpc52xx_fec_get_ksettings(struct net_device *dev,
+ struct ethtool_link_ksettings *cmd)
{
struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+ struct phy_device *phydev = priv->phydev;
if (!priv->phydev)
return -ENODEV;
- return phy_ethtool_gset(priv->phydev, cmd);
+ return phy_ethtool_ksettings_get(phydev, cmd);
}
-static int mpc52xx_fec_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+static int mpc52xx_fec_set_ksettings(struct net_device *dev,
+ const struct ethtool_link_ksettings *cmd)
{
struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+ struct phy_device *phydev = priv->phydev;
if (!priv->phydev)
return -ENODEV;
- return phy_ethtool_sset(priv->phydev, cmd);
+ return phy_ethtool_ksettings_set(phydev, cmd);
}
static u32 mpc52xx_fec_get_msglevel(struct net_device *dev)
@@ -796,12 +800,12 @@ static void mpc52xx_fec_set_msglevel(struct net_device *dev, u32 level)
}
static const struct ethtool_ops mpc52xx_fec_ethtool_ops = {
- .get_settings = mpc52xx_fec_get_settings,
- .set_settings = mpc52xx_fec_set_settings,
.get_link = ethtool_op_get_link,
.get_msglevel = mpc52xx_fec_get_msglevel,
.set_msglevel = mpc52xx_fec_set_msglevel,
.get_ts_info = ethtool_op_get_ts_info,
+ .get_link_ksettings = mpc52xx_fec_get_ksettings,
+ .set_link_ksettings = mpc52xx_fec_set_ksettings,
};
--
1.7.4.4
^ permalink raw reply related
* [PATCH net-next v2] ravb: Remove rx buffer ALIGN
From: Yoshihiro Kaneko @ 2016-05-01 15:19 UTC (permalink / raw)
To: netdev
Cc: David S. Miller, Sergei Shtylyov, Simon Horman, Magnus Damm,
linux-renesas-soc
From: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
Aligning the reception data size is not required.
Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Tested-by: Simon Horman <horms+renesas@verge.net.au>
---
This patch is based on the master branch of David Miller's next networking
tree.
v2 [Yoshihiro Kaneko]
* As suggested by Sergei Shtylyov
remove re-formattings which is not related to the subject of this patch.
drivers/net/ethernet/renesas/ravb_main.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index 238b56f..34066e0 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -246,10 +246,9 @@ static void ravb_ring_format(struct net_device *ndev, int q)
for (i = 0; i < priv->num_rx_ring[q]; i++) {
/* RX descriptor */
rx_desc = &priv->rx_ring[q][i];
- /* The size of the buffer should be on 16-byte boundary. */
- rx_desc->ds_cc = cpu_to_le16(ALIGN(PKT_BUF_SZ, 16));
+ rx_desc->ds_cc = cpu_to_le16(PKT_BUF_SZ);
dma_addr = dma_map_single(ndev->dev.parent, priv->rx_skb[q][i]->data,
- ALIGN(PKT_BUF_SZ, 16),
+ PKT_BUF_SZ,
DMA_FROM_DEVICE);
/* We just set the data size to 0 for a failed mapping which
* should prevent DMA from happening...
@@ -558,7 +557,7 @@ static bool ravb_rx(struct net_device *ndev, int *quota, int q)
skb = priv->rx_skb[q][entry];
priv->rx_skb[q][entry] = NULL;
dma_unmap_single(ndev->dev.parent, le32_to_cpu(desc->dptr),
- ALIGN(PKT_BUF_SZ, 16),
+ PKT_BUF_SZ,
DMA_FROM_DEVICE);
get_ts &= (q == RAVB_NC) ?
RAVB_RXTSTAMP_TYPE_V2_L2_EVENT :
@@ -588,8 +587,7 @@ static bool ravb_rx(struct net_device *ndev, int *quota, int q)
for (; priv->cur_rx[q] - priv->dirty_rx[q] > 0; priv->dirty_rx[q]++) {
entry = priv->dirty_rx[q] % priv->num_rx_ring[q];
desc = &priv->rx_ring[q][entry];
- /* The size of the buffer should be on 16-byte boundary. */
- desc->ds_cc = cpu_to_le16(ALIGN(PKT_BUF_SZ, 16));
+ desc->ds_cc = cpu_to_le16(PKT_BUF_SZ);
if (!priv->rx_skb[q][entry]) {
skb = netdev_alloc_skb(ndev,
--
1.9.1
^ permalink raw reply related
* Re: [PATCH net-next] drivers/net: add 6WIND SHULTI support
From: Jiri Pirko @ 2016-05-01 15:24 UTC (permalink / raw)
To: Nicolas Dichtel; +Cc: David Miller, fw, netdev
In-Reply-To: <5721FB26.6070305@6wind.com>
Thu, Apr 28, 2016 at 01:59:34PM CEST, nicolas.dichtel@6wind.com wrote:
>Le 27/04/2016 18:55, David Miller a écrit :
>> From: Jiri Pirko <jiri@resnulli.us>
>[snip]
>>> The difference is that it this tries to allow userspace crap to mirror
>>> setting user does for bridge/ovs. Basically this looks to me like an
>>> attempt to enable userspace SDKs and such.
>>
>> +1
>I don't think so because a userspace can receive all the bridge/ovs settings by
>mean of netlink mirror, without the need for this driver at all.
Okay, so what is the different is your words? I asked about purpose and
userspace for this "driver", but you didn't provide that.
I see what I see.
Also, if you say you don't need this driver at all, why are you pushing
it? Userspace apps can glean on netlink messages and act accordingly. In
fact, this is what people are doing (for example Cumulus).
I must be missing something there... (unfortunatelly, I'm pretty sure I'm not).
^ permalink raw reply
* Re: [PATCH net-next] drivers/net: add 6WIND SHULTI support
From: Jiri Pirko @ 2016-05-01 15:27 UTC (permalink / raw)
To: Nicolas Dichtel; +Cc: David Miller, fw, netdev
In-Reply-To: <57231FD1.2080907@6wind.com>
Fri, Apr 29, 2016 at 10:48:17AM CEST, nicolas.dichtel@6wind.com wrote:
>Le 28/04/2016 17:54, David Miller a écrit :
>[snip]
>> You can say whatever you want, but the facilities you are adding to
>> this driver enables proprietary userland SDK components.
>>
>> And this is precisely what we are trying to avoid by having a clean,
>> fully featured switch device model in the kernel.
>>
>> It is against your interestes of upstreaming your driver to continue
>> denying what your changes facilitate.
>Ok, I will rework this patch to remove the controversial parts and custom APIs.
I'm pretty sure that means removing the whole patch... Seriously, this
is wrong.
^ permalink raw reply
* Re: [PATCH v1 net] net/mlx4: Avoid wrong virtual mappings
From: Sinan Kaya @ 2016-05-01 15:43 UTC (permalink / raw)
To: Haggai Abramovsky, David S. Miller, Doug Ledford
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
Timur Tabi, Eli Cohen, Or Gerlitz, Eran Ben Elisha, Yishai Hadas,
Tal Alon, Saeed Mahameed
In-Reply-To: <1461740820-15386-1-git-send-email-hagaya-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
On 4/27/2016 3:07 AM, Haggai Abramovsky wrote:
> The dma_alloc_coherent() function returns a virtual address which can
> be used for coherent access to the underlying memory. On some
> architectures, like arm64, undefined behavior results if this memory is
> also accessed via virtual mappings that are not coherent. Because of
> their undefined nature, operations like virt_to_page() return garbage
> when passed virtual addresses obtained from dma_alloc_coherent(). Any
> subsequent mappings via vmap() of the garbage page values are unusable
> and result in bad things like bus errors (synchronous aborts in ARM64
> speak).
>
> The mlx4 driver contains code that does the equivalent of:
> vmap(virt_to_page(dma_alloc_coherent)), this results in an OOPs when the
> device is opened.
>
> Prevent Ethernet driver to run this problematic code by forcing it to
> allocate contiguous memory. As for the Infiniband driver, at first we
> are trying to allocate contiguous memory, but in case of failure roll
> back to work with fragmented memory.
>
> Signed-off-by: Haggai Abramovsky <hagaya-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Reported-by: David Daney <david.daney-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
> Tested-by: Sinan Kaya <okaya-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
> ---
> Changes from v0:
> Fix indentation error raised by LeonR
>
> drivers/infiniband/hw/mlx4/qp.c | 26 +++++--
> drivers/net/ethernet/mellanox/mlx4/alloc.c | 93 ++++++++++-------------
> drivers/net/ethernet/mellanox/mlx4/en_cq.c | 9 +--
> drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 2 +-
> drivers/net/ethernet/mellanox/mlx4/en_resources.c | 31 --------
> drivers/net/ethernet/mellanox/mlx4/en_rx.c | 11 +--
> drivers/net/ethernet/mellanox/mlx4/en_tx.c | 14 +---
> drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 2 -
> include/linux/mlx4/device.h | 4 +-
> 9 files changed, 67 insertions(+), 125 deletions(-)
>
> diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
> index fd97534..842a6da 100644
> --- a/drivers/infiniband/hw/mlx4/qp.c
> +++ b/drivers/infiniband/hw/mlx4/qp.c
> @@ -419,7 +419,8 @@ static int set_rq_size(struct mlx4_ib_dev *dev, struct ib_qp_cap *cap,
> }
>
> static int set_kernel_sq_size(struct mlx4_ib_dev *dev, struct ib_qp_cap *cap,
> - enum mlx4_ib_qp_type type, struct mlx4_ib_qp *qp)
> + enum mlx4_ib_qp_type type, struct mlx4_ib_qp *qp,
> + int shrink_wqe)
> {
> int s;
>
> @@ -477,7 +478,7 @@ static int set_kernel_sq_size(struct mlx4_ib_dev *dev, struct ib_qp_cap *cap,
> * We set WQE size to at least 64 bytes, this way stamping
> * invalidates each WQE.
> */
> - if (dev->dev->caps.fw_ver >= MLX4_FW_VER_WQE_CTRL_NEC &&
> + if (shrink_wqe && dev->dev->caps.fw_ver >= MLX4_FW_VER_WQE_CTRL_NEC &&
> qp->sq_signal_bits && BITS_PER_LONG == 64 &&
> type != MLX4_IB_QPT_SMI && type != MLX4_IB_QPT_GSI &&
> !(type & (MLX4_IB_QPT_PROXY_SMI_OWNER | MLX4_IB_QPT_PROXY_SMI |
> @@ -642,6 +643,7 @@ static int create_qp_common(struct mlx4_ib_dev *dev, struct ib_pd *pd,
> {
> int qpn;
> int err;
> + struct ib_qp_cap backup_cap;
> struct mlx4_ib_sqp *sqp;
> struct mlx4_ib_qp *qp;
> enum mlx4_ib_qp_type qp_type = (enum mlx4_ib_qp_type) init_attr->qp_type;
> @@ -775,7 +777,8 @@ static int create_qp_common(struct mlx4_ib_dev *dev, struct ib_pd *pd,
> goto err;
> }
>
> - err = set_kernel_sq_size(dev, &init_attr->cap, qp_type, qp);
> + memcpy(&backup_cap, &init_attr->cap, sizeof(backup_cap));
> + err = set_kernel_sq_size(dev, &init_attr->cap, qp_type, qp, 1);
> if (err)
> goto err;
>
> @@ -787,9 +790,20 @@ static int create_qp_common(struct mlx4_ib_dev *dev, struct ib_pd *pd,
> *qp->db.db = 0;
> }
>
> - if (mlx4_buf_alloc(dev->dev, qp->buf_size, PAGE_SIZE * 2, &qp->buf, gfp)) {
> - err = -ENOMEM;
> - goto err_db;
> + if (mlx4_buf_alloc(dev->dev, qp->buf_size, qp->buf_size,
> + &qp->buf, gfp)) {
> + memcpy(&init_attr->cap, &backup_cap,
> + sizeof(backup_cap));
> + err = set_kernel_sq_size(dev, &init_attr->cap, qp_type,
> + qp, 0);
> + if (err)
> + goto err_db;
> +
> + if (mlx4_buf_alloc(dev->dev, qp->buf_size,
> + PAGE_SIZE * 2, &qp->buf, gfp)) {
> + err = -ENOMEM;
> + goto err_db;
> + }
> }
>
> err = mlx4_mtt_init(dev->dev, qp->buf.npages, qp->buf.page_shift,
> diff --git a/drivers/net/ethernet/mellanox/mlx4/alloc.c b/drivers/net/ethernet/mellanox/mlx4/alloc.c
> index 0c51c69..249a458 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/alloc.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/alloc.c
> @@ -576,41 +576,48 @@ out:
>
> return res;
> }
> -/*
> - * Handling for queue buffers -- we allocate a bunch of memory and
> - * register it in a memory region at HCA virtual address 0. If the
> - * requested size is > max_direct, we split the allocation into
> - * multiple pages, so we don't require too much contiguous memory.
> - */
>
> -int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct,
> - struct mlx4_buf *buf, gfp_t gfp)
> +static int mlx4_buf_direct_alloc(struct mlx4_dev *dev, int size,
> + struct mlx4_buf *buf, gfp_t gfp)
> {
> dma_addr_t t;
>
> - if (size <= max_direct) {
> - buf->nbufs = 1;
> - buf->npages = 1;
> - buf->page_shift = get_order(size) + PAGE_SHIFT;
> - buf->direct.buf = dma_alloc_coherent(&dev->persist->pdev->dev,
> - size, &t, gfp);
> - if (!buf->direct.buf)
> - return -ENOMEM;
> + buf->nbufs = 1;
> + buf->npages = 1;
> + buf->page_shift = get_order(size) + PAGE_SHIFT;
> + buf->direct.buf =
> + dma_zalloc_coherent(&dev->persist->pdev->dev,
> + size, &t, gfp);
> + if (!buf->direct.buf)
> + return -ENOMEM;
>
> - buf->direct.map = t;
> + buf->direct.map = t;
>
> - while (t & ((1 << buf->page_shift) - 1)) {
> - --buf->page_shift;
> - buf->npages *= 2;
> - }
> + while (t & ((1 << buf->page_shift) - 1)) {
> + --buf->page_shift;
> + buf->npages *= 2;
> + }
>
> - memset(buf->direct.buf, 0, size);
> + return 0;
> +}
> +
> +/* Handling for queue buffers -- we allocate a bunch of memory and
> + * register it in a memory region at HCA virtual address 0. If the
> + * requested size is > max_direct, we split the allocation into
> + * multiple pages, so we don't require too much contiguous memory.
> + */
> +int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct,
> + struct mlx4_buf *buf, gfp_t gfp)
> +{
> + if (size <= max_direct) {
> + return mlx4_buf_direct_alloc(dev, size, buf, gfp);
> } else {
> + dma_addr_t t;
> int i;
>
> - buf->direct.buf = NULL;
> - buf->nbufs = (size + PAGE_SIZE - 1) / PAGE_SIZE;
> - buf->npages = buf->nbufs;
> + buf->direct.buf = NULL;
> + buf->nbufs = (size + PAGE_SIZE - 1) / PAGE_SIZE;
> + buf->npages = buf->nbufs;
> buf->page_shift = PAGE_SHIFT;
> buf->page_list = kcalloc(buf->nbufs, sizeof(*buf->page_list),
> gfp);
> @@ -619,28 +626,12 @@ int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct,
>
> for (i = 0; i < buf->nbufs; ++i) {
> buf->page_list[i].buf =
> - dma_alloc_coherent(&dev->persist->pdev->dev,
> - PAGE_SIZE,
> - &t, gfp);
> + dma_zalloc_coherent(&dev->persist->pdev->dev,
> + PAGE_SIZE, &t, gfp);
> if (!buf->page_list[i].buf)
> goto err_free;
>
> buf->page_list[i].map = t;
> -
> - memset(buf->page_list[i].buf, 0, PAGE_SIZE);
> - }
> -
> - if (BITS_PER_LONG == 64) {
> - struct page **pages;
> - pages = kmalloc(sizeof *pages * buf->nbufs, gfp);
> - if (!pages)
> - goto err_free;
> - for (i = 0; i < buf->nbufs; ++i)
> - pages[i] = virt_to_page(buf->page_list[i].buf);
> - buf->direct.buf = vmap(pages, buf->nbufs, VM_MAP, PAGE_KERNEL);
> - kfree(pages);
> - if (!buf->direct.buf)
> - goto err_free;
> }
> }
>
> @@ -655,15 +646,11 @@ EXPORT_SYMBOL_GPL(mlx4_buf_alloc);
>
> void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf)
> {
> - int i;
> -
> - if (buf->nbufs == 1)
> + if (buf->nbufs == 1) {
> dma_free_coherent(&dev->persist->pdev->dev, size,
> - buf->direct.buf,
> - buf->direct.map);
> - else {
> - if (BITS_PER_LONG == 64)
> - vunmap(buf->direct.buf);
> + buf->direct.buf, buf->direct.map);
> + } else {
> + int i;
>
> for (i = 0; i < buf->nbufs; ++i)
> if (buf->page_list[i].buf)
> @@ -789,7 +776,7 @@ void mlx4_db_free(struct mlx4_dev *dev, struct mlx4_db *db)
> EXPORT_SYMBOL_GPL(mlx4_db_free);
>
> int mlx4_alloc_hwq_res(struct mlx4_dev *dev, struct mlx4_hwq_resources *wqres,
> - int size, int max_direct)
> + int size)
> {
> int err;
>
> @@ -799,7 +786,7 @@ int mlx4_alloc_hwq_res(struct mlx4_dev *dev, struct mlx4_hwq_resources *wqres,
>
> *wqres->db.db = 0;
>
> - err = mlx4_buf_alloc(dev, size, max_direct, &wqres->buf, GFP_KERNEL);
> + err = mlx4_buf_direct_alloc(dev, size, &wqres->buf, GFP_KERNEL);
> if (err)
> goto err_db;
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_cq.c b/drivers/net/ethernet/mellanox/mlx4/en_cq.c
> index af975a2..132cea6 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_cq.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_cq.c
> @@ -73,22 +73,16 @@ int mlx4_en_create_cq(struct mlx4_en_priv *priv,
> */
> set_dev_node(&mdev->dev->persist->pdev->dev, node);
> err = mlx4_alloc_hwq_res(mdev->dev, &cq->wqres,
> - cq->buf_size, 2 * PAGE_SIZE);
> + cq->buf_size);
> set_dev_node(&mdev->dev->persist->pdev->dev, mdev->dev->numa_node);
> if (err)
> goto err_cq;
>
> - err = mlx4_en_map_buffer(&cq->wqres.buf);
> - if (err)
> - goto err_res;
> -
> cq->buf = (struct mlx4_cqe *)cq->wqres.buf.direct.buf;
> *pcq = cq;
>
> return 0;
>
> -err_res:
> - mlx4_free_hwq_res(mdev->dev, &cq->wqres, cq->buf_size);
> err_cq:
> kfree(cq);
> *pcq = NULL;
> @@ -177,7 +171,6 @@ void mlx4_en_destroy_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq **pcq)
> struct mlx4_en_dev *mdev = priv->mdev;
> struct mlx4_en_cq *cq = *pcq;
>
> - mlx4_en_unmap_buffer(&cq->wqres.buf);
> mlx4_free_hwq_res(mdev->dev, &cq->wqres, cq->buf_size);
> if (mlx4_is_eq_vector_valid(mdev->dev, priv->port, cq->vector) &&
> cq->is_tx == RX)
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> index b4b258c..5b19178 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> @@ -2907,7 +2907,7 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
>
> /* Allocate page for receive rings */
> err = mlx4_alloc_hwq_res(mdev->dev, &priv->res,
> - MLX4_EN_PAGE_SIZE, MLX4_EN_PAGE_SIZE);
> + MLX4_EN_PAGE_SIZE);
> if (err) {
> en_err(priv, "Failed to allocate page for rx qps\n");
> goto out;
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_resources.c b/drivers/net/ethernet/mellanox/mlx4/en_resources.c
> index 02e925d..a6b0db0 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_resources.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_resources.c
> @@ -107,37 +107,6 @@ int mlx4_en_change_mcast_lb(struct mlx4_en_priv *priv, struct mlx4_qp *qp,
> return ret;
> }
>
> -int mlx4_en_map_buffer(struct mlx4_buf *buf)
> -{
> - struct page **pages;
> - int i;
> -
> - if (BITS_PER_LONG == 64 || buf->nbufs == 1)
> - return 0;
> -
> - pages = kmalloc(sizeof *pages * buf->nbufs, GFP_KERNEL);
> - if (!pages)
> - return -ENOMEM;
> -
> - for (i = 0; i < buf->nbufs; ++i)
> - pages[i] = virt_to_page(buf->page_list[i].buf);
> -
> - buf->direct.buf = vmap(pages, buf->nbufs, VM_MAP, PAGE_KERNEL);
> - kfree(pages);
> - if (!buf->direct.buf)
> - return -ENOMEM;
> -
> - return 0;
> -}
> -
> -void mlx4_en_unmap_buffer(struct mlx4_buf *buf)
> -{
> - if (BITS_PER_LONG == 64 || buf->nbufs == 1)
> - return;
> -
> - vunmap(buf->direct.buf);
> -}
> -
> void mlx4_en_sqp_event(struct mlx4_qp *qp, enum mlx4_event event)
> {
> return;
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
> index 7d25bc9..89775bb 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
> @@ -394,17 +394,11 @@ int mlx4_en_create_rx_ring(struct mlx4_en_priv *priv,
>
> /* Allocate HW buffers on provided NUMA node */
> set_dev_node(&mdev->dev->persist->pdev->dev, node);
> - err = mlx4_alloc_hwq_res(mdev->dev, &ring->wqres,
> - ring->buf_size, 2 * PAGE_SIZE);
> + err = mlx4_alloc_hwq_res(mdev->dev, &ring->wqres, ring->buf_size);
> set_dev_node(&mdev->dev->persist->pdev->dev, mdev->dev->numa_node);
> if (err)
> goto err_info;
>
> - err = mlx4_en_map_buffer(&ring->wqres.buf);
> - if (err) {
> - en_err(priv, "Failed to map RX buffer\n");
> - goto err_hwq;
> - }
> ring->buf = ring->wqres.buf.direct.buf;
>
> ring->hwtstamp_rx_filter = priv->hwtstamp_config.rx_filter;
> @@ -412,8 +406,6 @@ int mlx4_en_create_rx_ring(struct mlx4_en_priv *priv,
> *pring = ring;
> return 0;
>
> -err_hwq:
> - mlx4_free_hwq_res(mdev->dev, &ring->wqres, ring->buf_size);
> err_info:
> vfree(ring->rx_info);
> ring->rx_info = NULL;
> @@ -517,7 +509,6 @@ void mlx4_en_destroy_rx_ring(struct mlx4_en_priv *priv,
> struct mlx4_en_dev *mdev = priv->mdev;
> struct mlx4_en_rx_ring *ring = *pring;
>
> - mlx4_en_unmap_buffer(&ring->wqres.buf);
> mlx4_free_hwq_res(mdev->dev, &ring->wqres, size * stride + TXBB_SIZE);
> vfree(ring->rx_info);
> ring->rx_info = NULL;
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> index c0d7b72..b9ab646 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> @@ -93,20 +93,13 @@ int mlx4_en_create_tx_ring(struct mlx4_en_priv *priv,
>
> /* Allocate HW buffers on provided NUMA node */
> set_dev_node(&mdev->dev->persist->pdev->dev, node);
> - err = mlx4_alloc_hwq_res(mdev->dev, &ring->wqres, ring->buf_size,
> - 2 * PAGE_SIZE);
> + err = mlx4_alloc_hwq_res(mdev->dev, &ring->wqres, ring->buf_size);
> set_dev_node(&mdev->dev->persist->pdev->dev, mdev->dev->numa_node);
> if (err) {
> en_err(priv, "Failed allocating hwq resources\n");
> goto err_bounce;
> }
>
> - err = mlx4_en_map_buffer(&ring->wqres.buf);
> - if (err) {
> - en_err(priv, "Failed to map TX buffer\n");
> - goto err_hwq_res;
> - }
> -
> ring->buf = ring->wqres.buf.direct.buf;
>
> en_dbg(DRV, priv, "Allocated TX ring (addr:%p) - buf:%p size:%d buf_size:%d dma:%llx\n",
> @@ -117,7 +110,7 @@ int mlx4_en_create_tx_ring(struct mlx4_en_priv *priv,
> MLX4_RESERVE_ETH_BF_QP);
> if (err) {
> en_err(priv, "failed reserving qp for TX ring\n");
> - goto err_map;
> + goto err_hwq_res;
> }
>
> err = mlx4_qp_alloc(mdev->dev, ring->qpn, &ring->qp, GFP_KERNEL);
> @@ -154,8 +147,6 @@ int mlx4_en_create_tx_ring(struct mlx4_en_priv *priv,
>
> err_reserve:
> mlx4_qp_release_range(mdev->dev, ring->qpn, 1);
> -err_map:
> - mlx4_en_unmap_buffer(&ring->wqres.buf);
> err_hwq_res:
> mlx4_free_hwq_res(mdev->dev, &ring->wqres, ring->buf_size);
> err_bounce:
> @@ -182,7 +173,6 @@ void mlx4_en_destroy_tx_ring(struct mlx4_en_priv *priv,
> mlx4_qp_remove(mdev->dev, &ring->qp);
> mlx4_qp_free(mdev->dev, &ring->qp);
> mlx4_qp_release_range(priv->mdev->dev, ring->qpn, 1);
> - mlx4_en_unmap_buffer(&ring->wqres.buf);
> mlx4_free_hwq_res(mdev->dev, &ring->wqres, ring->buf_size);
> kfree(ring->bounce_buf);
> ring->bounce_buf = NULL;
> diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
> index d12ab6a..a70e2d0 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
> +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
> @@ -671,8 +671,6 @@ void mlx4_en_fill_qp_context(struct mlx4_en_priv *priv, int size, int stride,
> int is_tx, int rss, int qpn, int cqn, int user_prio,
> struct mlx4_qp_context *context);
> void mlx4_en_sqp_event(struct mlx4_qp *qp, enum mlx4_event event);
> -int mlx4_en_map_buffer(struct mlx4_buf *buf);
> -void mlx4_en_unmap_buffer(struct mlx4_buf *buf);
> int mlx4_en_change_mcast_lb(struct mlx4_en_priv *priv, struct mlx4_qp *qp,
> int loopback);
> void mlx4_en_calc_rx_buf(struct net_device *dev);
> diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
> index 8541a91..72da65f 100644
> --- a/include/linux/mlx4/device.h
> +++ b/include/linux/mlx4/device.h
> @@ -1051,7 +1051,7 @@ int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct,
> void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf);
> static inline void *mlx4_buf_offset(struct mlx4_buf *buf, int offset)
> {
> - if (BITS_PER_LONG == 64 || buf->nbufs == 1)
> + if (buf->nbufs == 1)
> return buf->direct.buf + offset;
> else
> return buf->page_list[offset >> PAGE_SHIFT].buf +
> @@ -1091,7 +1091,7 @@ int mlx4_db_alloc(struct mlx4_dev *dev, struct mlx4_db *db, int order,
> void mlx4_db_free(struct mlx4_dev *dev, struct mlx4_db *db);
>
> int mlx4_alloc_hwq_res(struct mlx4_dev *dev, struct mlx4_hwq_resources *wqres,
> - int size, int max_direct);
> + int size);
> void mlx4_free_hwq_res(struct mlx4_dev *mdev, struct mlx4_hwq_resources *wqres,
> int size);
>
>
Can we get this queued for 4.7? Mellanox with arm64 has been broken over 1.5 years.
--
Sinan Kaya
Qualcomm Technologies, Inc. on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
--
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] macb: fix mdiobus_scan() error check
From: Florian Fainelli @ 2016-05-01 16:03 UTC (permalink / raw)
To: Sergei Shtylyov, netdev, nicolas.ferre
In-Reply-To: <2317306.aZN9iKAKYz@wasted.cogentembedded.com>
Le 30/04/2016 15: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>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
^ permalink raw reply
* Re: [PATCH] pxa168_eth: fix mdiobus_scan() error check
From: Florian Fainelli @ 2016-05-01 16:05 UTC (permalink / raw)
To: Sergei Shtylyov, netdev; +Cc: arnd
In-Reply-To: <6024241.YxM8l6DPJo@wasted.cogentembedded.com>
Le 30/04/2016 13:35, Sergei Shtylyov a écrit :
> Since mdiobus_scan() returns either an error code or NULL on error, the
> driver should check for both, not only for NULL, otherwise a crash is
> imminent...
>
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>
> ---
> The patch is against DaveM's 'net.git' repo.
>
> drivers/net/ethernet/marvell/pxa168_eth.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> Index: net/drivers/net/ethernet/marvell/pxa168_eth.c
> ===================================================================
> --- net.orig/drivers/net/ethernet/marvell/pxa168_eth.c
> +++ net/drivers/net/ethernet/marvell/pxa168_eth.c
> @@ -979,6 +979,8 @@ static int pxa168_init_phy(struct net_de
> return 0;
>
> pep->phy = mdiobus_scan(pep->smi_bus, pep->phy_addr);
> + if (IS_ERR(pep->phy))
> + return PTR_ERR(pep->phy);
> if (!pep->phy)
> return -ENODEV;
Should not this check be removed too and converted to a
PTR_ERR(pep->phy) != -ENODEV?
--
Florian
^ 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