* Re: [net-next 13/17] i40evf: refactor ethtool RSS handling
From: Ben Hutchings @ 2014-11-23 3:44 UTC (permalink / raw)
To: Jeff Kirsher; +Cc: davem, Mitch Williams, netdev, nhorman, sassmann, jogreene
In-Reply-To: <1416635708-4765-15-git-send-email-jeffrey.t.kirsher@intel.com>
[-- Attachment #1: Type: text/plain, Size: 2977 bytes --]
On Fri, 2014-11-21 at 21:55 -0800, Jeff Kirsher wrote:
> From: Mitch Williams <mitch.a.williams@intel.com>
>
> Add support for setting the RSS key as it is now implemented.
>
> Change-ID: I9290ae3ea99d0e46053540650f95e24a24e453f1
> Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
> Tested-by: Jim Young <jamesx.m.young@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> ---
> drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c | 66 ++++++++++++++++------
> 1 file changed, 50 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
> index 69a269b..ed0e4dc 100644
> --- a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
> +++ b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
> @@ -608,6 +608,19 @@ static void i40evf_get_channels(struct net_device *netdev,
> ch->combined_count = adapter->num_active_queues;
> }
>
> +#define I40EVF_HLUT_ARRAY_SIZE ((I40E_VFQF_HLUT_MAX_INDEX + 1) * 4)
> +#define I40EVF_HKEY_ARRAY_SIZE ((I40E_VFQF_HKEY_MAX_INDEX * 1) * 4)
The '* 1' should be '+ 1' as on the previous line?
[...]
> @@ -631,19 +644,28 @@ static int i40evf_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key)
> {
> struct i40evf_adapter *adapter = netdev_priv(netdev);
> struct i40e_hw *hw = &adapter->hw;
> - u32 hlut_val;
> + u32 reg_val;
> int i, j;
> for (i = 0, j = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++) {
> - hlut_val = rd32(hw, I40E_VFQF_HLUT(i));
> - indir[j++] = hlut_val & 0xff;
> - indir[j++] = (hlut_val >> 8) & 0xff;
> - indir[j++] = (hlut_val >> 16) & 0xff;
> - indir[j++] = (hlut_val >> 24) & 0xff;
> + reg_val = rd32(hw, I40E_VFQF_HLUT(i));
> + indir[j++] = reg_val & 0xff;
> + indir[j++] = (reg_val >> 8) & 0xff;
> + indir[j++] = (reg_val >> 16) & 0xff;
> + indir[j++] = (reg_val >> 24) & 0xff;
> + }
You need an 'if (indir)' around that block now.
> + if (key) {
> + for (i = 0, j = 0; i <= I40E_VFQF_HKEY_MAX_INDEX; i++) {
> + reg_val = rd32(hw, I40E_VFQF_HKEY(i));
> + key[j++] = (u8)(reg_val & 0xff);
> + key[j++] = (u8)((reg_val >> 8) & 0xff);
> + key[j++] = (u8)((reg_val >> 16) & 0xff);
> + key[j++] = (u8)((reg_val >> 24) & 0xff);
> + }
> }
> return 0;
> }
> -
You should keep the blank line between functions.
[...]
> @@ -687,10 +719,12 @@ static const struct ethtool_ops i40evf_ethtool_ops = {
> .set_coalesce = i40evf_set_coalesce,
> .get_rxnfc = i40evf_get_rxnfc,
> .set_rxnfc = i40evf_set_rxnfc,
> + .get_rxfh_key_size = i40evf_get_rxfh_key_size,
> .get_rxfh_indir_size = i40evf_get_rxfh_indir_size,
> .get_rxfh = i40evf_get_rxfh,
> .set_rxfh = i40evf_set_rxfh,
> .get_channels = i40evf_get_channels,
> +
But you don't need a blank line here.
Ben.
> };
>
> /**
--
Ben Hutchings
Never put off till tomorrow what you can avoid all together.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]
^ permalink raw reply
* Re: Potential bugs found in ne2k-pci+8390
From: Ben Hutchings @ 2014-11-23 3:21 UTC (permalink / raw)
To: Jia-Ju Bai; +Cc: netdev
In-Reply-To: <000001d00607$90e5ee70$b2b1cb50$@163.com>
[-- Attachment #1: Type: text/plain, Size: 1579 bytes --]
On Sat, 2014-11-22 at 11:51 +0800, Jia-Ju Bai wrote:
> Dear Sir,
> I'm very sorry to trouble you.
> Recently I test 15 linux device drivers and find some potential bugs both in
> Linux 3.8.6 and Linux 3.17.2.
>
> The target file is drivers/net/ethernet/8390/ne2k-pci.c, which is used to
> build ne2k-pci.ko. I hope you can help me check my findings:
> [1] The function request_region is called by ne2k_pci_init_one when
> initializing the ethernet card driver. But when request_region is failed,
> which means that it returns the error value, ne2k_pci_init_one returns
> immediately to halt the process. However, because pci_enable_device has been
> called before request_region in ne2k_pci_init_one, pci_disable_device should
> be called before exiting. When the driver works normally, pci_enable_device
> and pci_disable_device are called in pairs in ne2k_pci_init_one and
> ne2k_pci_remove_one. Moreover, other ethernet card drivers call
> pci_enable_device and pci_disable_device in pairs in error handling paths,
> such as r8169 and sky2.
> [2] The similar problem to [1] occurs when alloc_ei_netdev is failed in
> ne2k_pci_init_one.
> [3] The similar problem to [1] occurs when register_netdev is failed in
> ne2k_pci_init_one.
>
> Could you help me check these findings? Thank you very much, and I'm looking
> forward to your reply.
I agree this is a real bug (or bugs). You should send a patch to fix
this - see Documentation/SubmittingPatches.
Ben.
--
Ben Hutchings
Never put off till tomorrow what you can avoid all together.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]
^ permalink raw reply
* Re: [PATCH net-next] vlan: Pass ethtool get_ts_info queries to real device.
From: Ben Hutchings @ 2014-11-23 3:15 UTC (permalink / raw)
To: Richard Cochran; +Cc: netdev, David Miller, Stefan Sørensen
In-Reply-To: <1416575780-19132-1-git-send-email-richardcochran@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1156 bytes --]
On Fri, 2014-11-21 at 14:16 +0100, Richard Cochran wrote:
> Commit a6111d3c "vlan: Pass SIOC[SG]HWTSTAMP ioctls to real device"
> intended to enable hardware time stamping on VLAN interfaces, but
> passing SIOCSHWTSTAMP is only half of the story. This patch adds
> the second half, by letting user space find out the time stamping
> capabilities of the device backing a VLAN interface.
[...]
This assumes that the same PTP capabilities apply to VLAN-tagged frames.
I don't think it's at all safe to assume that RX filter modes other than
HWTSTAMP_FILTER_ALL will include VLAN-tagged frames. I think it is
necessary to define additional modes that explicitly include VLAN-tagged
frames.
I also disagree in general that reconfiguring a VLAN device should make
changes to the underlying device that affect more than just that VLAN,
i.e. SIOCSHWTSTAMP should not be passed through. SIOCGHWTSTAMP could be
passed through, but rx_filter would need adjustment (VLAN-tagged modes
on the underlying devices become untagged modes on the VLAN device).
Ben.
--
Ben Hutchings
Never put off till tomorrow what you can avoid all together.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]
^ permalink raw reply
* Re: [PATCH 1/2] 8139too: Allow setting MTU larger than 1500
From: Ben Hutchings @ 2014-11-23 2:42 UTC (permalink / raw)
To: Alban
Cc: linux-kernel, netdev, Bjorn Helgaas, Benoit Taine,
Eric W. Biederman, David S. Miller
In-Reply-To: <20141121195738.038d2cc2@tock>
[-- Attachment #1: Type: text/plain, Size: 2222 bytes --]
On Fri, 2014-11-21 at 19:57 +0100, Alban wrote:
> On Fri, 21 Nov 2014 18:51:51 +0000
> Ben Hutchings <ben@decadent.org.uk> wrote:
>
> > On Fri, 2014-11-21 at 14:58 +0100, Alban wrote:
> > > On Fri, 21 Nov 2014 00:34:34 +0000
> > > Ben Hutchings <ben@decadent.org.uk> wrote:
> > >
> > > > On Sat, 2014-11-08 at 12:48 +0100, Alban Bedel wrote:
> > > > > Replace the default ndo_change_mtu callback with one that allow
> > > > > setting MTU that the driver can handle.
> > > > >
> > > > > Signed-off-by: Alban Bedel <albeu@free.fr>
> > > > > ---
> > > > > drivers/net/ethernet/realtek/8139too.c | 13 ++++++++++++-
> > > > > 1 file changed, 12 insertions(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/drivers/net/ethernet/realtek/8139too.c
> > > > > b/drivers/net/ethernet/realtek/8139too.c index 007b38c..8387de9
> > > > > 100644 --- a/drivers/net/ethernet/realtek/8139too.c
> > > > > +++ b/drivers/net/ethernet/realtek/8139too.c
> > > > > @@ -185,6 +185,9 @@ static int debug = -1;
> > > > > /* max supported ethernet frame size -- must be at least
> > > > > (dev->mtu+14+4).*/ #define MAX_ETH_FRAME_SIZE 1536
> > > > >
> > > > > +/* max supported payload size */
> > > > > +#define MAX_ETH_DATA_SIZE (MAX_ETH_FRAME_SIZE -
> > > > > ETH_HLEN - ETH_FCS_LEN)
> > > > [...]
> > > >
> > > > Does this maximum still allow for VLAN tags, or should it use
> > > > VLAN_ETH_HLEN instead of ETH_HLEN?
> > >
> > > That might well be as the VLAN code seems to assume that the
> > > physical device can handle frames of MTU + VLAN_HLEN bytes. I can
> > > fix it, but to me it seems like the VLAN code should be fixed to
> > > respect the physical device MTU.
> >
> > Drivers that support VLANs have to allow for at least one VLAN tag
> > when validating the MTU. This is obviously broken for multiple
> > layers of VLAN tags, but those are the semantics we're stuck with.
>
> Ok, I see. Should a I send a fix patch or redo a new version of this
> patch?
As your previous patches have already been applied, you'll need to send
a fix patch (if the answer to my question was no).
Ben.
--
Ben Hutchings
Never put off till tomorrow what you can avoid all together.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]
^ permalink raw reply
* Low Interest Rate!
From: Ocean Finance And Bussiness Co @ 2014-11-22 19:36 UTC (permalink / raw)
To: Recipients
Do You Need A Loan?Apply Now For More Details.
^ permalink raw reply
* Re: net: Hyper-V: Deletion of an unnecessary check before the function call "vfree"
From: Eric Dumazet @ 2014-11-23 1:27 UTC (permalink / raw)
To: SF Markus Elfring
Cc: netdev, Haiyang Zhang, kernel-janitors, linux-kernel,
Julia Lawall, devel, David Miller
In-Reply-To: <54712F8C.10206@users.sourceforge.net>
On Sun, 2014-11-23 at 01:51 +0100, SF Markus Elfring wrote:
> > This has nothing to do with me asking you to frame your patches
> > against the correct tree.
>
> I imagine than someone other can also pick up this update suggestion
> (a simple change of two lines) quicker before I might try another
> software build again from a different commit as a base.
I have no idea why someone would do that.
If you don't bother resubmit, nobody will.
^ permalink raw reply
* [PATCH net-next] mlx4: fix mlx4_en_set_rxfh()
From: Eric Dumazet @ 2014-11-23 1:24 UTC (permalink / raw)
To: Ben Hutchings; +Cc: David S. Miller, netdev, Amir Vadai
In-Reply-To: <1416700690.20938.34.camel@edumazet-glaptop2.roam.corp.google.com>
From: Eric Dumazet <edumazet@google.com>
mlx4_en_set_rxfh() can crash if no RSS indir table is provided.
While we are at it, allow RSS key to be changed with ethtool -X
Tested:
myhost:~# cat /proc/sys/net/core/netdev_rss_key
b6:89:91:f3:b2:c3:c2:90:11:e8:ce:45:e8:a9:9d:1c:f2:f6:d4:53:61:8b:26:3a:b3:9a:57:97:c3:b6:79:4d:2e:d9:66:5c:72:ed:b6:8e:c5:5d:4d:8c:22:67:30:ab:8a:6e:c3:6a
myhost:~# ethtool -x eth0
RX flow hash indirection table for eth0 with 8 RX ring(s):
0: 0 1 2 3 4 5 6 7
RSS hash key:
b6:89:91:f3:b2:c3:c2:90:11:e8:ce:45:e8:a9:9d:1c:f2:f6:d4:53:61:8b:26:3a:b3:9a:57:97:c3:b6:79:4d:2e:d9:66:5c:72:ed:b6:8e
myhost:~# ethtool -X eth0 hkey \
03:0e:e2:43:fa:82:0e:73:14:2d:c0:68:21:9e:82:99:b9:84:d0:22:e2:b3:64:9f:4a:af:00:fa:cc:05:b4:4a:17:05:14:73:76:58:bd:2f
myhost:~# ethtool -x eth0
RX flow hash indirection table for eth0 with 8 RX ring(s):
0: 0 1 2 3 4 5 6 7
RSS hash key:
03:0e:e2:43:fa:82:0e:73:14:2d:c0:68:21:9e:82:99:b9:84:d0:22:e2:b3:64:9f:4a:af:00:fa:cc:05:b4:4a:17:05:14:73:76:58:bd:2f
Reported-by: Ben Hutchings <ben@decadent.org.uk>
Fixes: b9d1ab7eb42e ("mlx4: use netdev_rss_key_fill() helper")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Amir Vadai <amirv@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 10 +++++++---
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 1 +
drivers/net/ethernet/mellanox/mlx4/en_rx.c | 3 +--
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 1 +
4 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
index bdff834a2a7e..c45e06abc073 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
@@ -994,7 +994,7 @@ static int mlx4_en_get_rxfh(struct net_device *dev, u32 *ring_index, u8 *key)
rss_map->base_qpn;
}
if (key)
- netdev_rss_key_fill(key, MLX4_EN_RSS_KEY_SIZE);
+ memcpy(key, priv->rss_key, MLX4_EN_RSS_KEY_SIZE);
return err;
}
@@ -1012,6 +1012,8 @@ static int mlx4_en_set_rxfh(struct net_device *dev, const u32 *ring_index,
* between rings
*/
for (i = 0; i < priv->rx_ring_num; i++) {
+ if (!ring_index)
+ continue;
if (i > 0 && !ring_index[i] && !rss_rings)
rss_rings = i;
@@ -1032,8 +1034,10 @@ static int mlx4_en_set_rxfh(struct net_device *dev, const u32 *ring_index,
mlx4_en_stop_port(dev, 1);
}
- priv->prof->rss_rings = rss_rings;
-
+ if (ring_index)
+ priv->prof->rss_rings = rss_rings;
+ if (key)
+ memcpy(priv->rss_key, key, MLX4_EN_RSS_KEY_SIZE);
if (port_up) {
err = mlx4_en_start_port(dev);
if (err)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index 89440cb25ad8..b7c99780aef3 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -2493,6 +2493,7 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
priv->num_tx_rings_p_up = mdev->profile.num_tx_rings_p_up;
priv->tx_ring_num = prof->tx_ring_num;
priv->tx_work_limit = MLX4_EN_DEFAULT_TX_WORK;
+ netdev_rss_key_fill(priv->rss_key, sizeof(priv->rss_key));
priv->tx_ring = kzalloc(sizeof(struct mlx4_en_tx_ring *) * MAX_TX_RINGS,
GFP_KERNEL);
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
index b7bda8956011..946d35280abc 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -1223,8 +1223,7 @@ int mlx4_en_config_rss_steer(struct mlx4_en_priv *priv)
rss_context->flags = rss_mask;
rss_context->hash_fn = MLX4_RSS_HASH_TOP;
- netdev_rss_key_fill(rss_context->rss_key, MLX4_EN_RSS_KEY_SIZE);
-
+ memcpy(rss_context->rss_key, priv->rss_key, MLX4_EN_RSS_KEY_SIZE);
err = mlx4_qp_to_ready(mdev->dev, &priv->res.mtt, &context,
&rss_map->indir_qp, &rss_map->indir_state);
if (err)
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
index de456749ffae..aaa7efbb9664 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
@@ -618,6 +618,7 @@ struct mlx4_en_priv {
__be16 vxlan_port;
u32 pflags;
+ u8 rss_key[MLX4_EN_RSS_KEY_SIZE];
};
enum mlx4_en_wol {
^ permalink raw reply related
* Re: net: Hyper-V: Deletion of an unnecessary check before the function call "vfree"
From: SF Markus Elfring @ 2014-11-23 0:51 UTC (permalink / raw)
To: David Miller
Cc: netdev, Haiyang Zhang, kernel-janitors, linux-kernel,
Julia Lawall, devel
In-Reply-To: <20141121.172705.540279259389643572.davem@davemloft.net>
> This has nothing to do with me asking you to frame your patches
> against the correct tree.
I imagine than someone other can also pick up this update suggestion
(a simple change of two lines) quicker before I might try another
software build again from a different commit as a base.
Regards,
Markus
^ permalink raw reply
* Re: [PATCH net-next 12/14] mlx4: use netdev_rss_key_fill() helper
From: Eric Dumazet @ 2014-11-22 23:58 UTC (permalink / raw)
To: Ben Hutchings
Cc: Eric Dumazet, David S. Miller, netdev, Thomas Lendacky,
Ariel Elior, Michael Chan, Prashant Sreedharan, Rasesh Mody,
Sathya Perla, Subbu Seetharaman, Ajit Khaparde, Jesse Brandeburg,
Jeff Kirsher, Amir Vadai, Shradha Shah, Shreyas Bhatewara
In-Reply-To: <1416692961.7215.31.camel@decadent.org.uk>
On Sat, 2014-11-22 at 21:49 +0000, Ben Hutchings wrote:
> On Sun, 2014-11-16 at 06:23 -0800, Eric Dumazet wrote:
> > Use of well known RSS key increases attack surface.
> > Switch to a random one, using generic helper so that all
> > ports share a common key.
> >
> > Also provide ethtool -x support to fetch RSS key
> [...]
> > @@ -1799,6 +1805,7 @@ const struct ethtool_ops mlx4_en_ethtool_ops = {
> > .get_rxnfc = mlx4_en_get_rxnfc,
> > .set_rxnfc = mlx4_en_set_rxnfc,
> > .get_rxfh_indir_size = mlx4_en_get_rxfh_indir_size,
> > + .get_rxfh_key_size = mlx4_en_get_rxfh_key_size,
> > .get_rxfh = mlx4_en_get_rxfh,
> > .set_rxfh = mlx4_en_set_rxfh,
> [...]
>
> A driver that implements get_rxfh_key_size() and set_rxfh() is assumed
> to support setting the RSS key (and only the key). However,
> mlx4_en_set_rxfh() will currently crash if a new indirection table is
> not provided.
Hi Ben.
Is this a net-next only concern, or is it an existing problem in net
tree ?
Thanks !
^ permalink raw reply
* Re: [PATCH 5/6] net/core: support compiling out splice
From: Josh Triplett @ 2014-11-22 23:07 UTC (permalink / raw)
To: Pieter Smith
Cc: Willem de Bruijn, Alexander Duyck, Thomas Graf,
open list:NETWORKING [GENERAL], Miklos Szeredi,
Michael S. Tsirkin, Daniel Borkmann, Jan Beulich, open list,
Paul Durrant, Eric Dumazet, David S. Miller, Tom Herbert
In-Reply-To: <CAPho-_+GV+2sVVxGsPSjvE3heEoGa4chbqrmnxLAr_p7RU=TDQ@mail.gmail.com>
[Please don't top-post.]
On Sat, Nov 22, 2014 at 11:50:51PM +0100, Pieter Smith wrote:
> splice exports a structure that is used by skbuf. Mocking out a function is
> straightforward. To my knowledge there is no elegant way of mocking out a
> splice_operations struct. I directly modified the code to prevent linking
> against the struct. Do you know of a better technique to get the same
> result?
No, I don't. The approach you took seems fine; I'm just saying that you
need to explain the need for it in the commit message.
- JosH Triplett
^ permalink raw reply
* Re: [RFC PATCH 1/4] rtnetlink: new flag NLM_F_HW_OFFLOAD to indicate kernel object offload to hardware
From: Vincent JARDIN @ 2014-11-22 22:03 UTC (permalink / raw)
To: Roopa Prabhu
Cc: Thomas Graf, jiri, sfeldma, jhs, bcrl, john.fastabend, stephen,
linville, nhorman, nicolas.dichtel, vyasevic, f.fainelli, buytenh,
aviadr, netdev, davem, Shrijeet Mukherjee, gospo
In-Reply-To: <5470E5E0.9070005@cumulusnetworks.com>
On 22/11/2014 20:37, Roopa Prabhu wrote:
> struct ifinfomsg -> ifi_flags
> struct ndmsg ->ndm_flags
> struct rtmsg -> rtm_flags
>
> If this is preferred .., I can repost the series with these changes.
Yes, it would be my preferred too.
Thank you,
Vincent
^ permalink raw reply
* Re: [PATCH net-next 0/5] RDMA/cxgb4,cxgb4vf,csiostor: Cleanup macros
From: David Miller @ 2014-11-22 21:58 UTC (permalink / raw)
To: hariprasad-ut6Up61K2wZBDgjK7y7TUQ
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
linux-scsi-u79uwXL29TY76Z2rM5mHXA, roland-BHEL68pLQRGGvPXPguhicg,
JBottomley-bzQdu9zFT3WakBO8gow8eQ, hch-wEGCiKHe2LqWVfeAwA7xHQ,
swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW,
leedom-ut6Up61K2wZBDgjK7y7TUQ, anish-ut6Up61K2wZBDgjK7y7TUQ,
nirranjan-ut6Up61K2wZBDgjK7y7TUQ, kumaras-ut6Up61K2wZBDgjK7y7TUQ,
praveen-ut6Up61K2wZBDgjK7y7TUQ, varun-ut6Up61K2wZBDgjK7y7TUQ
In-Reply-To: <1416554525-11844-1-git-send-email-hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
From: Hariprasad Shenai <hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
Date: Fri, 21 Nov 2014 12:52:00 +0530
> This series continues to cleanup all the macros/register defines related to
> filter, port, VI, queue, RSS, LDST, firmware, etc that are defined in t4fw_api.h
> and the affected files.
>
> Will post few more series so that we can cover all the macros so that they all
> follow the same style to be consistent.
>
> The patches series is created against 'net-next' tree.
> And includes patches on cxgb4, cxgb4vf, iw_cxgb4 and csiostor driver.
>
> We have included all the maintainers of respective drivers. Kindly review the
> change and let us know in case of any review comments.
Series applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [net-next] i40e: enable fdb add code, remove unused code
From: David Miller @ 2014-11-22 21:56 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: jesse.brandeburg, netdev, nhorman, sassmann, jogreene
In-Reply-To: <1416529802-16055-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 20 Nov 2014 16:30:02 -0800
> From: Jesse Brandeburg <jesse.brandeburg@intel.com>
>
> The original FDB code submission wasn't correct and the code
> wasn't enabled. This removes some dead code (can use the common kernel
> code for fdb_del and fdb_dump) and correctly enables the fdb_add
> function pointer.
>
> The fdb_add functionality is important to i40e because it is needed
> for a workaround to allow bridges to work correctly on the i40e
> hardware.
>
> Reported-by: Jiri Pirko <jiri@resnulli.us>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Acked-by: Greg Rose <gregory.v.rose@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied, thanks Jeff.
^ permalink raw reply
* Re: [PATCH net-next V1 1/2] ethtool: Support for configurable RSS hash function
From: David Miller @ 2014-11-22 21:54 UTC (permalink / raw)
To: amirv
Cc: netdev, ben, ogerlitz, yevgenyp, eyalpe, thomas.lendacky,
ariel.elior, prashant, mchan, hariprasad, sathya.perla,
subbu.seetharaman, ajit.khaparde, jeffrey.t.kirsher,
jesse.brandeburg, bruce.w.allan, carolyn.wyborny,
donald.c.skidmore, gregory.v.rose, matthew.vick, john.ronciak,
mitch.a.williams, linux-net-drivers, sshah, sbhatewara,
pv-drivers
In-Reply-To: <1416493610-8966-2-git-send-email-amirv@mellanox.com>
From: Amir Vadai <amirv@mellanox.com>
Date: Thu, 20 Nov 2014 16:26:49 +0200
> + /* We require at least one supported parameter to be changed and no
> + * change in any of the unsupported parameters
> + */
> + if ((!indir && !key) || hfunc != ETH_RSS_HASH_NO_CHANGE)
> + return -EOPNOTSUPP;
> +
I know it will make more work for you, but all of these driver
implementations of this hook should:
1) Accept hfunc of whatever hash function the chip is using,
not just ETH_RSS_HASH_NO_CHANGE.
2) Provide an accurate hfunc value in the ->get() call.
^ permalink raw reply
* Re: [PATCH net-next 12/14] mlx4: use netdev_rss_key_fill() helper
From: Ben Hutchings @ 2014-11-22 21:49 UTC (permalink / raw)
To: Eric Dumazet
Cc: David S. Miller, netdev, Thomas Lendacky, Ariel Elior,
Michael Chan, Prashant Sreedharan, Rasesh Mody, Sathya Perla,
Subbu Seetharaman, Ajit Khaparde, Jesse Brandeburg, Jeff Kirsher,
Amir Vadai, Shradha Shah, Shreyas Bhatewara
In-Reply-To: <1416147798-16561-13-git-send-email-edumazet@google.com>
[-- Attachment #1: Type: text/plain, Size: 906 bytes --]
On Sun, 2014-11-16 at 06:23 -0800, Eric Dumazet wrote:
> Use of well known RSS key increases attack surface.
> Switch to a random one, using generic helper so that all
> ports share a common key.
>
> Also provide ethtool -x support to fetch RSS key
[...]
> @@ -1799,6 +1805,7 @@ const struct ethtool_ops mlx4_en_ethtool_ops = {
> .get_rxnfc = mlx4_en_get_rxnfc,
> .set_rxnfc = mlx4_en_set_rxnfc,
> .get_rxfh_indir_size = mlx4_en_get_rxfh_indir_size,
> + .get_rxfh_key_size = mlx4_en_get_rxfh_key_size,
> .get_rxfh = mlx4_en_get_rxfh,
> .set_rxfh = mlx4_en_set_rxfh,
[...]
A driver that implements get_rxfh_key_size() and set_rxfh() is assumed
to support setting the RSS key (and only the key). However,
mlx4_en_set_rxfh() will currently crash if a new indirection table is
not provided.
Ben.
--
Ben Hutchings
Logic doesn't apply to the real world. - Marvin Minsky
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]
^ permalink raw reply
* Re: [PATCH 5/6] net/core: support compiling out splice
From: Josh Triplett @ 2014-11-22 21:48 UTC (permalink / raw)
To: Pieter Smith
Cc: David S. Miller, Tom Herbert, Eric Dumazet, Daniel Borkmann,
Willem de Bruijn, Michael S. Tsirkin, Alexander Duyck,
Paul Durrant, Thomas Graf, Jan Beulich, Miklos Szeredi, open list,
open list:NETWORKING [GENERAL]
In-Reply-To: <1416690001-20817-6-git-send-email-pieter@boesman.nl>
On Sat, Nov 22, 2014 at 10:00:00PM +0100, Pieter Smith wrote:
> Compile out splice support from networking core when the splice-family of
> syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is
> undefined).
Please explain in the commit message why this particular bit of splice
support needs compiling out when most other bits do not.
Also, a couple of style comments below.
> Signed-off-by: Pieter Smith <pieter@boesman.nl>
> ---
> include/linux/skbuff.h | 9 +++++++++
> net/core/skbuff.c | 9 ++++++---
> 2 files changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> index a59d934..8c28524 100644
> --- a/include/linux/skbuff.h
> +++ b/include/linux/skbuff.h
> @@ -2640,9 +2640,18 @@ int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len);
> int skb_store_bits(struct sk_buff *skb, int offset, const void *from, int len);
> __wsum skb_copy_and_csum_bits(const struct sk_buff *skb, int offset, u8 *to,
> int len, __wsum csum);
> +#ifdef CONFIG_SYSCALL_SPLICE
> int skb_splice_bits(struct sk_buff *skb, unsigned int offset,
> struct pipe_inode_info *pipe, unsigned int len,
> unsigned int flags);
> +#else /* #ifdef CONFIG_SYSCALL_SPLICE */
> +static inline int skb_splice_bits(struct sk_buff *skb, unsigned int offset,
> + struct pipe_inode_info *pipe, unsigned int len,
> + unsigned int flags)
> +{
> + return -EPERM;
> +}
> +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */
These comments, and the one added below in the corresponding .c file,
don't match the prevailing style. These are so short (fitting on one
screen) that they hardly seem worth the comments at all, but if you want
to include them, s/#ifdef// in the comment.
> void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to);
> unsigned int skb_zerocopy_headlen(const struct sk_buff *from);
> int skb_zerocopy(struct sk_buff *to, struct sk_buff *from,
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index 61059a0..74fad8a 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -1781,9 +1781,9 @@ static bool __splice_segment(struct page *page, unsigned int poff,
> * Map linear and fragment data from the skb to spd. It reports true if the
> * pipe is full or if we already spliced the requested length.
> */
> -static bool __skb_splice_bits(struct sk_buff *skb, struct pipe_inode_info *pipe,
> - unsigned int *offset, unsigned int *len,
> - struct splice_pipe_desc *spd, struct sock *sk)
> +static bool __maybe_unused __skb_splice_bits(struct sk_buff *skb, struct pipe_inode_info *pipe,
> + unsigned int *offset, unsigned int *len,
> + struct splice_pipe_desc *spd, struct sock *sk)
> {
> int seg;
>
> @@ -1821,6 +1821,7 @@ static bool __skb_splice_bits(struct sk_buff *skb, struct pipe_inode_info *pipe,
> * the frag list, if such a thing exists. We'd probably need to recurse to
> * handle that cleanly.
> */
> +#ifdef CONFIG_SYSCALL_SPLICE
> int skb_splice_bits(struct sk_buff *skb, unsigned int offset,
> struct pipe_inode_info *pipe, unsigned int tlen,
> unsigned int flags)
> @@ -1876,6 +1877,8 @@ done:
>
> return ret;
> }
> +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */
> +
This extra blank line shouldn't be here.
> /**
> * skb_store_bits - store bits from kernel buffer to skb
> --
> 1.9.1
>
^ permalink raw reply
* [PATCH 5/6] net/core: support compiling out splice
From: Pieter Smith @ 2014-11-22 21:00 UTC (permalink / raw)
To: pieter
Cc: Josh Triplett, David S. Miller, Tom Herbert, Eric Dumazet,
Daniel Borkmann, Willem de Bruijn, Michael S. Tsirkin,
Alexander Duyck, Paul Durrant, Thomas Graf, Jan Beulich,
Miklos Szeredi, open list, open list:NETWORKING [GENERAL]
In-Reply-To: <1416690001-20817-1-git-send-email-pieter@boesman.nl>
Compile out splice support from networking core when the splice-family of
syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is
undefined).
Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
include/linux/skbuff.h | 9 +++++++++
net/core/skbuff.c | 9 ++++++---
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index a59d934..8c28524 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2640,9 +2640,18 @@ int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len);
int skb_store_bits(struct sk_buff *skb, int offset, const void *from, int len);
__wsum skb_copy_and_csum_bits(const struct sk_buff *skb, int offset, u8 *to,
int len, __wsum csum);
+#ifdef CONFIG_SYSCALL_SPLICE
int skb_splice_bits(struct sk_buff *skb, unsigned int offset,
struct pipe_inode_info *pipe, unsigned int len,
unsigned int flags);
+#else /* #ifdef CONFIG_SYSCALL_SPLICE */
+static inline int skb_splice_bits(struct sk_buff *skb, unsigned int offset,
+ struct pipe_inode_info *pipe, unsigned int len,
+ unsigned int flags)
+{
+ return -EPERM;
+}
+#endif /* #ifdef CONFIG_SYSCALL_SPLICE */
void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to);
unsigned int skb_zerocopy_headlen(const struct sk_buff *from);
int skb_zerocopy(struct sk_buff *to, struct sk_buff *from,
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 61059a0..74fad8a 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1781,9 +1781,9 @@ static bool __splice_segment(struct page *page, unsigned int poff,
* Map linear and fragment data from the skb to spd. It reports true if the
* pipe is full or if we already spliced the requested length.
*/
-static bool __skb_splice_bits(struct sk_buff *skb, struct pipe_inode_info *pipe,
- unsigned int *offset, unsigned int *len,
- struct splice_pipe_desc *spd, struct sock *sk)
+static bool __maybe_unused __skb_splice_bits(struct sk_buff *skb, struct pipe_inode_info *pipe,
+ unsigned int *offset, unsigned int *len,
+ struct splice_pipe_desc *spd, struct sock *sk)
{
int seg;
@@ -1821,6 +1821,7 @@ static bool __skb_splice_bits(struct sk_buff *skb, struct pipe_inode_info *pipe,
* the frag list, if such a thing exists. We'd probably need to recurse to
* handle that cleanly.
*/
+#ifdef CONFIG_SYSCALL_SPLICE
int skb_splice_bits(struct sk_buff *skb, unsigned int offset,
struct pipe_inode_info *pipe, unsigned int tlen,
unsigned int flags)
@@ -1876,6 +1877,8 @@ done:
return ret;
}
+#endif /* #ifdef CONFIG_SYSCALL_SPLICE */
+
/**
* skb_store_bits - store bits from kernel buffer to skb
--
1.9.1
^ permalink raw reply related
* Re: [RFC PATCH 1/4] rtnetlink: new flag NLM_F_HW_OFFLOAD to indicate kernel object offload to hardware
From: Sergei Shtylyov @ 2014-11-22 20:08 UTC (permalink / raw)
To: roopa, jiri, sfeldma, jhs, bcrl, tgraf, john.fastabend, stephen,
linville, nhorman, nicolas.dichtel, vyasevic, f.fainelli, buytenh,
aviadr
Cc: netdev, davem, shrijeet, gospo
In-Reply-To: <1416610170-21224-2-git-send-email-roopa@cumulusnetworks.com>
Hello.
On 11/22/2014 1:49 AM, roopa@cumulusnetworks.com wrote:
> From: Roopa Prabhu <roopa@cumulusnetworks.com>
> This patch adds new flags in netlink header nlmsg_flags to signal if the
> message is for the kernel, hw or both.
> This can be used to indicate hw offload for all kind of objects
> routes, fdb entries, neighs, link objects like bonds, bridges, vxlan.
> Adding it in the header makes it possible to use it accross all objects and
> across all messages (sets/gets/deletes).
> Other alternative to this is a per kernel object netlink attribute/flag.
> But that leads to duplicating the attribute in different subsystems.
> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
> ---
> include/uapi/linux/netlink.h | 2 ++
> 1 file changed, 2 insertions(+)
> diff --git a/include/uapi/linux/netlink.h b/include/uapi/linux/netlink.h
> index 1a85940..f78522d 100644
> --- a/include/uapi/linux/netlink.h
> +++ b/include/uapi/linux/netlink.h
> @@ -54,6 +54,8 @@ struct nlmsghdr {
> #define NLM_F_ACK 4 /* Reply with ack, with zero or error code */
> #define NLM_F_ECHO 8 /* Echo this request */
> #define NLM_F_DUMP_INTR 16 /* Dump was inconsistent due to sequence change */
> ++#define NLM_F_KERNEL 32 /* This msg is only for the kernel */
I don't think you really meant double '+'.
> +#define NLM_F_HW_OFFLOAD 64 /* offload this msg to hw */
[...]
WBR, Sergei
^ permalink raw reply
* [PATCH net-next 2/2] enic: use spin_lock(wq_lock) instead of spin_lock_irqsave(wq_lock)
From: Govindarajulu Varadarajan @ 2014-11-22 19:52 UTC (permalink / raw)
To: davem, netdev; +Cc: ssujith, benve, Govindarajulu Varadarajan
In-Reply-To: <1416685972-1368-1-git-send-email-_govind@gmx.com>
All the access to wq has been moved out of hardirq context. We no longer need to
use spin_lock_irqsave.
Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com>
---
drivers/net/ethernet/cisco/enic/enic_main.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
index b42a480..4664740 100644
--- a/drivers/net/ethernet/cisco/enic/enic_main.c
+++ b/drivers/net/ethernet/cisco/enic/enic_main.c
@@ -529,7 +529,6 @@ static netdev_tx_t enic_hard_start_xmit(struct sk_buff *skb,
{
struct enic *enic = netdev_priv(netdev);
struct vnic_wq *wq;
- unsigned long flags;
unsigned int txq_map;
struct netdev_queue *txq;
@@ -554,14 +553,14 @@ static netdev_tx_t enic_hard_start_xmit(struct sk_buff *skb,
return NETDEV_TX_OK;
}
- spin_lock_irqsave(&enic->wq_lock[txq_map], flags);
+ spin_lock(&enic->wq_lock[txq_map]);
if (vnic_wq_desc_avail(wq) <
skb_shinfo(skb)->nr_frags + ENIC_DESC_MAX_SPLITS) {
netif_tx_stop_queue(txq);
/* This is a hard error, log it */
netdev_err(netdev, "BUG! Tx ring full when queue awake!\n");
- spin_unlock_irqrestore(&enic->wq_lock[txq_map], flags);
+ spin_unlock(&enic->wq_lock[txq_map]);
return NETDEV_TX_BUSY;
}
@@ -572,7 +571,7 @@ static netdev_tx_t enic_hard_start_xmit(struct sk_buff *skb,
if (!skb->xmit_more || netif_xmit_stopped(txq))
vnic_wq_doorbell(wq);
- spin_unlock_irqrestore(&enic->wq_lock[txq_map], flags);
+ spin_unlock(&enic->wq_lock[txq_map]);
return NETDEV_TX_OK;
}
--
2.1.0
^ permalink raw reply related
* [PATCH net-next 1/2] enic: use napi_schedule_irqoff()
From: Govindarajulu Varadarajan @ 2014-11-22 19:52 UTC (permalink / raw)
To: davem, netdev; +Cc: ssujith, benve, Govindarajulu Varadarajan
enic_isr_legacy(), enic_isr_msix() & enic_isr_msi() run from hard
interrupt context.
They can use napi_schedule_irqoff() instead of napi_schedule()
Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com>
---
drivers/net/ethernet/cisco/enic/enic_main.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
index b9cda2f..b42a480 100644
--- a/drivers/net/ethernet/cisco/enic/enic_main.c
+++ b/drivers/net/ethernet/cisco/enic/enic_main.c
@@ -283,12 +283,10 @@ static irqreturn_t enic_isr_legacy(int irq, void *data)
return IRQ_HANDLED;
}
- if (ENIC_TEST_INTR(pba, io_intr)) {
- if (napi_schedule_prep(&enic->napi[0]))
- __napi_schedule(&enic->napi[0]);
- } else {
+ if (ENIC_TEST_INTR(pba, io_intr))
+ napi_schedule_irqoff(&enic->napi[0]);
+ else
vnic_intr_unmask(&enic->intr[io_intr]);
- }
return IRQ_HANDLED;
}
@@ -313,7 +311,7 @@ static irqreturn_t enic_isr_msi(int irq, void *data)
* writes).
*/
- napi_schedule(&enic->napi[0]);
+ napi_schedule_irqoff(&enic->napi[0]);
return IRQ_HANDLED;
}
@@ -322,7 +320,7 @@ static irqreturn_t enic_isr_msix(int irq, void *data)
{
struct napi_struct *napi = data;
- napi_schedule(napi);
+ napi_schedule_irqoff(napi);
return IRQ_HANDLED;
}
--
2.1.0
^ permalink raw reply related
* Re: [RFC PATCH 1/4] rtnetlink: new flag NLM_F_HW_OFFLOAD to indicate kernel object offload to hardware
From: Roopa Prabhu @ 2014-11-22 19:37 UTC (permalink / raw)
To: Thomas Graf
Cc: jiri, sfeldma, jhs, bcrl, john.fastabend, stephen, linville,
nhorman, nicolas.dichtel, vyasevic, f.fainelli, buytenh, aviadr,
netdev, davem, Shrijeet Mukherjee, gospo
In-Reply-To: <20141122122936.GD20810@casper.infradead.org>
On 11/22/14, 4:29 AM, Thomas Graf wrote:
> On 11/21/14 at 04:10pm, Roopa Prabhu wrote:
>> On 11/21/14, 3:12 PM, Thomas Graf wrote:
>>> On 11/21/14 at 02:49pm, roopa@cumulusnetworks.com wrote:
>>>> diff --git a/include/uapi/linux/netlink.h b/include/uapi/linux/netlink.h
>>>> index 1a85940..f78522d 100644
>>>> --- a/include/uapi/linux/netlink.h
>>>> +++ b/include/uapi/linux/netlink.h
>>>> @@ -54,6 +54,8 @@ struct nlmsghdr {
>>>> #define NLM_F_ACK 4 /* Reply with ack, with zero or error code */
>>>> #define NLM_F_ECHO 8 /* Echo this request */
>>>> #define NLM_F_DUMP_INTR 16 /* Dump was inconsistent due to sequence change */
>>>> ++#define NLM_F_KERNEL 32 /* This msg is only for the kernel */
>>>> +#define NLM_F_HW_OFFLOAD 64 /* offload this msg to hw */
>>>> /* Modifiers to GET request */
>>>> #define NLM_F_ROOT 0x100 /* specify tree root */
>>> The NLM_F_ flag space applies to all Netlink messages including non
>>> networking bits and is reserved for flags vital to the functioning
>>> of the Netlink protocol itself. I suggest you move this to a
>>> RTNETLINK specific flags space.
>> I did try to add it at a layer lower than the netlink header. But, nothing
>> else fits so well as this :).
>> I did not find a place where i could make it a global flag for just
>> networking objects. As I mention in my patch description,
>> If not here it will be a per subsystem flag/attribute. I can post a patch
>> showing that approach as well.
> Global variables have their appeal ;-) The issue I see with this
> besides polluting a wide namespace is that it is not extendable.
> We get a single bit and if a single bit is not enough we'll start
> adding things in lower layers anyway (as you already do).
>
> I think this should really be an IFF_ flag for net_device so its
> state is exposed to user space as well.
I did start with a IFF_HW_OFFLOAD flag. This is going exactly in the
direction i was thinking it will go. :). I had to start at the top,
hence started with the netlink header first.
Now, going one step lower, It can be a flag or a netlink attribute.
Going with the flag,
Doing a quick survey of all the rtnetlink handlers..(keeping future in
mind)....for the top objects in the current context (link, route, fdb
and neigh)
we can add it in the below flags.
struct ifinfomsg -> ifi_flags
struct ndmsg ->ndm_flags
struct rtmsg -> rtm_flags
If this is preferred .., I can repost the series with these changes.
Thanks,
Roopa
^ permalink raw reply
* Re: [patch -next] bpf: null dereference allocating large arrays
From: Alexei Starovoitov @ 2014-11-22 18:45 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Alexei Starovoitov, netdev@vger.kernel.org, kernel-janitors
In-Reply-To: <20141122183059.GC6994@mwanda>
On Sat, Nov 22, 2014 at 10:30 AM, Dan Carpenter
<dan.carpenter@oracle.com> wrote:
> There is a typo here, "array" is null so we can't dereference it and
> also the size calculation should match the kzalloc() on the lines
> before.
Not sure what tree you're looking at...
it was more than typo, but it was fixed 4 days ago.
See commit daaf427c6ab39 ("bpf: fix arraymap NULL deref and missing
overflow and zero size checks")
^ permalink raw reply
* [patch -next] bpf: null dereference allocating large arrays
From: Dan Carpenter @ 2014-11-22 18:30 UTC (permalink / raw)
To: Alexei Starovoitov; +Cc: netdev, kernel-janitors
There is a typo here, "array" is null so we can't dereference it and
also the size calculation should match the kzalloc() on the lines
before.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c
index 58b80c1..662a412 100644
--- a/kernel/bpf/arraymap.c
+++ b/kernel/bpf/arraymap.c
@@ -38,7 +38,7 @@ static struct bpf_map *array_map_alloc(union bpf_attr *attr)
array = kzalloc(sizeof(*array) + attr->max_entries * elem_size,
GFP_USER | __GFP_NOWARN);
if (!array) {
- array = vzalloc(array->map.max_entries * array->elem_size);
+ array = vzalloc(sizeof(*array) + attr->max_entries * elem_size);
if (!array)
return ERR_PTR(-ENOMEM);
}
^ permalink raw reply related
* Re: [net-next 14/17] i40e: implement ethtool RSS config
From: Eric Dumazet @ 2014-11-22 18:22 UTC (permalink / raw)
To: Jeff Kirsher; +Cc: davem, Mitch Williams, netdev, nhorman, sassmann, jogreene
In-Reply-To: <1416635708-4765-16-git-send-email-jeffrey.t.kirsher@intel.com>
On Fri, 2014-11-21 at 21:55 -0800, Jeff Kirsher wrote:
> From: Mitch Williams <mitch.a.williams@intel.com>
>
> Support ethtool methods for getting and setting the RSS look-up table.
>
> Change-ID: I52707fb371fc11fe9fd4c287e08542cde38f79d4
> Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
> Tested-by: Jim Young <jamesx.m.young@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> ---
> drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 104 +++++++++++++++++++++++++
> 1 file changed, 104 insertions(+)
>
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> index fcd815d..f9f68ea 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> @@ -2237,6 +2237,106 @@ static int i40e_set_channels(struct net_device *dev,
> return -EINVAL;
> }
>
> +#define I40E_HLUT_ARRAY_SIZE ((I40E_PFQF_HLUT_MAX_INDEX + 1) * 4)
> +#define I40E_HKEY_ARRAY_SIZE ((I40E_PFQF_HKEY_MAX_INDEX * 1) * 4)
> +/**
> + * i40e_get_rxfh_key_size - get the RSS hash key size
> + * @netdev: network interface device structure
> + *
> + * Returns the table size.
> + **/
> +static u32 i40e_get_rxfh_key_size(struct net_device *netdev)
> +{
> + return I40E_HKEY_ARRAY_SIZE;
> +}
> +
> +/**
> + * i40e_get_rxfh_indir_size - get the rx flow hash indirection table size
> + * @netdev: network interface device structure
> + *
> + * Returns the table size.
> + **/
> +static u32 i40e_get_rxfh_indir_size(struct net_device *netdev)
> +{
> + return I40E_HLUT_ARRAY_SIZE;
> +}
> +
> +/**
> + * i40e_get_rxfh - get the rx flow hash indirection table
> + * @netdev: network interface device structure
> + * @indir: indirection table
> + * @key: hash key
> + *
> + * Reads the indirection table directly from the hardware. Always returns 0.
> + **/
> +static int i40e_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key)
> +{
> + struct i40e_netdev_priv *np = netdev_priv(netdev);
> + struct i40e_vsi *vsi = np->vsi;
> + struct i40e_pf *pf = vsi->back;
> + struct i40e_hw *hw = &pf->hw;
> + u32 reg_val;
> + int i, j;
> +
> + for (i = 0, j = 0; i <= I40E_PFQF_HLUT_MAX_INDEX; i++) {
> + reg_val = rd32(hw, I40E_PFQF_HLUT(i));
> + indir[j++] = reg_val & 0xff;
> + indir[j++] = (reg_val >> 8) & 0xff;
> + indir[j++] = (reg_val >> 16) & 0xff;
> + indir[j++] = (reg_val >> 24) & 0xff;
> + }
> + if (key) {
> + for (i = 0, j = 0; i <= I40E_PFQF_HKEY_MAX_INDEX; i++) {
> + reg_val = rd32(hw, I40E_PFQF_HKEY(i));
> + key[j++] = (u8)(reg_val & 0xff);
> + key[j++] = (u8)((reg_val >> 8) & 0xff);
> + key[j++] = (u8)((reg_val >> 16) & 0xff);
> + key[j++] = (u8)((reg_val >> 24) & 0xff);
Nit:
put_unaligned_le32(reg_val, key + i * 4);
> + }
> + }
> + return 0;
> +}
> +
> +/**
> + * i40e_set_rxfh - set the rx flow hash indirection table
> + * @netdev: network interface device structure
> + * @indir: indirection table
> + * @key: hash key
> + *
> + * Returns -EINVAL if the table specifies an inavlid queue id, otherwise
> + * returns 0 after programming the table.
> + **/
> +static int i40e_set_rxfh(struct net_device *netdev, const u32 *indir,
> + const u8 *key)
> +{
> + struct i40e_netdev_priv *np = netdev_priv(netdev);
> + struct i40e_vsi *vsi = np->vsi;
> + struct i40e_pf *pf = vsi->back;
> + struct i40e_hw *hw = &pf->hw;
> + u32 reg_val;
> + int i, j;
> +
> + if (indir) {
> + for (i = 0, j = 0; i <= I40E_PFQF_HLUT_MAX_INDEX; i++) {
> + reg_val = indir[j++];
Shouldn't you check the indir[X] values are in correct range ?
( seems to be between 0 and [pf->rss_size_max - 1] )
> + reg_val |= indir[j++] << 8;
> + reg_val |= indir[j++] << 16;
> + reg_val |= indir[j++] << 24;
> + wr32(hw, I40E_PFQF_HLUT(i), reg_val);
> + }
> + }
> + if (key) {
> + for (i = 0, j = 0; i <= I40E_PFQF_HKEY_MAX_INDEX; i++) {
> + reg_val = key[j++];
> + reg_val |= key[j++] << 8;
> + reg_val |= key[j++] << 16;
> + reg_val |= key[j++] << 24;
Nit:
reg_val = get_unaligned_le32(key + i * 4);
> + wr32(hw, I40E_PFQF_HKEY(i), reg_val);
> + }
> + }
^ permalink raw reply
* Re: Problem about Setting TCP Congestion Window to a Small Constant
From: Eric Dumazet @ 2014-11-22 17:50 UTC (permalink / raw)
To: wc8348; +Cc: netdev
In-Reply-To: <a7b958c622a1f1ebed77d4ce44109ceb.squirrel@webmail.cs.utexas.edu>
On Sat, 2014-11-22 at 10:29 -0600, wc8348@cs.utexas.edu wrote:
> Hi all,
> My name is Wenzhi Cui, a graduate student working on TCP congestion
> control in Linux Kernel. I have a problem about congestion control in
> linux kernel.
>
> Recently I am playing with TCP Congestion Control Protocol by setting
> the congestion window size to a constant, say 1, and measure the TCP
> flow throughput to see the relationship between cwnd size and
> transmission rate (on a stable environment).
>
> The problem is, when I am setting the snd_cwnd to 1, the real
> transmission rate is around 25MBps. However, since I am testing TCP
> on our department network with 1Gbps (which is 125MBps) bandwidth and
> 300 micro seconds Round trip time (measured by analyzing tcpdump
> trace). So the theoretical sending rate should be
> CWND * MSS / RTT = 1 * 1460 Byte / 300 us = around 5 MBps
> which is far less than the observed 25 MBps bandwidth. I have taken a look
> at tcp_cong.c, tcp_input output.c, etc. but I still cannot find the
> problem.
>
> Can somebody help me figure out what is missing, maybe what may
> affect the real TCP transmission other than CWND or what will happen
> when CWND is set to a very small constant?
You probably did something wrong ?
tcpdump will probably show that your cwnd must be bigger than 1.
(or rtt is way smaller than 300 usec, which sounds quite big to me)
^ 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