From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: davem@davemloft.net, Tony Nguyen <anthony.l.nguyen@intel.com>,
netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
jogreene@redhat.com
Subject: Re: [net-next 1/6] ixgbe: Do not allow LRO or MTU change with XDP
Date: Thu, 26 Jul 2018 14:47:10 -0700 [thread overview]
Message-ID: <20180726144710.0124aee2@cakuba.netronome.com> (raw)
In-Reply-To: <20180726142108.158b69a1@cakuba.netronome.com>
On Thu, 26 Jul 2018 14:21:08 -0700, Jakub Kicinski wrote:
> On Thu, 26 Jul 2018 10:40:45 -0700, Jeff Kirsher wrote:
> > From: Tony Nguyen <anthony.l.nguyen@intel.com>
> >
> > XDP does not support jumbo frames or LRO. These checks are being made
> > outside the driver when an XDP program is loaded, however, there is
> > nothing preventing these from changing after an XDP program is loaded.
> > Add the checks so that while an XDP program is loaded, do not allow MTU
> > to be changed or LRO to be enabled.
> >
> > Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
> > Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
> > Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> > ---
> > drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 10 ++++++++++
> > 1 file changed, 10 insertions(+)
> >
> > diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> > index 5a6600f7b382..c42256e91997 100644
> > --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> > +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> > @@ -6469,6 +6469,11 @@ static int ixgbe_change_mtu(struct net_device *netdev, int new_mtu)
> > {
> > struct ixgbe_adapter *adapter = netdev_priv(netdev);
> >
> > + if (adapter->xdp_prog) {
> > + e_warn(probe, "MTU cannot be changed while XDP program is loaded\n");
> > + return -EPERM;
>
> EPERM looks wrong, EINVAL is common. Also most drivers will just check
> the bounds like you do in ixgbe_xdp_setup(), allowing the change if new
> MTU still fits constraints.
>
> FWIW are the IXGBE_FLAG_SRIOV_ENABLED and IXGBE_FLAG_DCB_ENABLED flag
> changes also covered while xdp is enabled? Quick grep doesn't reveal
> them being checked against xdp_prog other than in ixgbe_xdp_setup().
Ah, I didn't make the review in time :) Could you follow up?
next prev parent reply other threads:[~2018-07-26 23:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-26 17:40 [net-next 0/6][pull request] 10GbE Intel Wired LAN Driver Updates 2018-07-26 Jeff Kirsher
2018-07-26 17:40 ` [net-next 1/6] ixgbe: Do not allow LRO or MTU change with XDP Jeff Kirsher
2018-07-26 21:21 ` Jakub Kicinski
2018-07-26 21:47 ` Jakub Kicinski [this message]
2018-07-26 21:51 ` Nguyen, Anthony L
2018-07-26 17:40 ` [net-next 2/6] ixgbe: add ipsec security registers into ethtool register dump Jeff Kirsher
2018-07-26 17:40 ` [net-next 3/6] igb: Remove superfluous reset to PHY and page 0 selection Jeff Kirsher
2018-07-26 17:40 ` [net-next 4/6] igb: Use dma_wmb() instead of wmb() before doorbell writes Jeff Kirsher
2018-07-26 17:40 ` [net-next 5/6] ixgbe: Reorder Tx/Rx shutdown to reduce time needed to stop device Jeff Kirsher
2018-07-26 21:16 ` [net-next 0/6][pull request] 10GbE Intel Wired LAN Driver Updates 2018-07-26 David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180726144710.0124aee2@cakuba.netronome.com \
--to=jakub.kicinski@netronome.com \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=jeffrey.t.kirsher@intel.com \
--cc=jogreene@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@redhat.com \
--cc=sassmann@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).