Skip to content

Commit bff5527

Browse files
Alexander Duyckdavem330
authored andcommitted
v2 ethtool: remove support for ETHTOOL_GRXNTUPLE
This change is meant to remove all support for displaying an ntuple as strings via ETHTOOL_GRXNTUPLE. The reason for this change is due to the fact that multiple issues have been found including: - Multiple buffer overruns for strings being displayed. - Incorrect filters displayed, cleared filters with ring of -2 are displayed - Setting get_rx_ntuple displays no rules if defined. - Endianess wrong on displayed values. - Hard limit of 1024 filters makes display functionality extremely limited The only driver that had supported this interface was ixgbe. Since it no longer uses the interface and due to the issues mentioned above I am submitting this patch to remove it. v2: Updated based on comments from Ben Hutchings - Left ETH_SS_NTUPLE_FILTERS in code but commented on it being deprecated - Removed ethtool_rx_ntuple_list and ethtool_rx_ntuple_flow_spec_container - Left ETHTOOL_GRXNTUPLE but commented it as deprecated Also cleaned up set_rx_ntuple since there is no flow spec container to maintain we can drop all the code for the alloc and free of it and just return ops->set_rx_ntuple(). Signed-off-by: Alexander Duyck <[email protected]> Acked-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c0c33ad commit bff5527

File tree

4 files changed

+3
-333
lines changed

4 files changed

+3
-333
lines changed

include/linux/ethtool.h

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ enum ethtool_stringset {
287287
ETH_SS_TEST = 0,
288288
ETH_SS_STATS,
289289
ETH_SS_PRIV_FLAGS,
290-
ETH_SS_NTUPLE_FILTERS,
290+
ETH_SS_NTUPLE_FILTERS, /* Do not use, GRXNTUPLE is now deprecated */
291291
ETH_SS_FEATURES,
292292
};
293293

@@ -714,18 +714,6 @@ enum ethtool_sfeatures_retval_bits {
714714
/* needed by dev_disable_lro() */
715715
extern int __ethtool_set_flags(struct net_device *dev, u32 flags);
716716

717-
struct ethtool_rx_ntuple_flow_spec_container {
718-
struct ethtool_rx_ntuple_flow_spec fs;
719-
struct list_head list;
720-
};
721-
722-
struct ethtool_rx_ntuple_list {
723-
#define ETHTOOL_MAX_NTUPLE_LIST_ENTRY 1024
724-
#define ETHTOOL_MAX_NTUPLE_STRING_PER_ENTRY 14
725-
struct list_head list;
726-
unsigned int count;
727-
};
728-
729717
/**
730718
* enum ethtool_phys_id_state - indicator state for physical identification
731719
* @ETHTOOL_ID_INACTIVE: Physical ID indicator should be deactivated
@@ -758,7 +746,6 @@ u32 ethtool_op_get_ufo(struct net_device *dev);
758746
int ethtool_op_set_ufo(struct net_device *dev, u32 data);
759747
u32 ethtool_op_get_flags(struct net_device *dev);
760748
int ethtool_op_set_flags(struct net_device *dev, u32 data, u32 supported);
761-
void ethtool_ntuple_flush(struct net_device *dev);
762749
bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported);
763750

764751
/**
@@ -865,7 +852,6 @@ bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported);
865852
* error code or zero.
866853
* @set_rx_ntuple: Set an RX n-tuple rule. Returns a negative error code
867854
* or zero.
868-
* @get_rx_ntuple: Deprecated.
869855
* @get_rxfh_indir: Get the contents of the RX flow hash indirection table.
870856
* Returns a negative error code or zero.
871857
* @set_rxfh_indir: Set the contents of the RX flow hash indirection table.
@@ -944,7 +930,6 @@ struct ethtool_ops {
944930
int (*reset)(struct net_device *, u32 *);
945931
int (*set_rx_ntuple)(struct net_device *,
946932
struct ethtool_rx_ntuple *);
947-
int (*get_rx_ntuple)(struct net_device *, u32 stringset, void *);
948933
int (*get_rxfh_indir)(struct net_device *,
949934
struct ethtool_rxfh_indir *);
950935
int (*set_rxfh_indir)(struct net_device *,
@@ -1017,7 +1002,7 @@ struct ethtool_ops {
10171002
#define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */
10181003
#define ETHTOOL_RESET 0x00000034 /* Reset hardware */
10191004
#define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */
1020-
#define ETHTOOL_GRXNTUPLE 0x00000036 /* Get n-tuple filters from device */
1005+
#define ETHTOOL_GRXNTUPLE 0x00000036 /* deprecated */
10211006
#define ETHTOOL_GSSET_INFO 0x00000037 /* Get string set info */
10221007
#define ETHTOOL_GRXFHINDIR 0x00000038 /* Get RX flow hash indir'n table */
10231008
#define ETHTOOL_SRXFHINDIR 0x00000039 /* Set RX flow hash indir'n table */

include/linux/netdevice.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,9 +1348,6 @@ struct net_device {
13481348
/* max exchange id for FCoE LRO by ddp */
13491349
unsigned int fcoe_ddp_xid;
13501350
#endif
1351-
/* n-tuple filter list attached to this device */
1352-
struct ethtool_rx_ntuple_list ethtool_ntuple_list;
1353-
13541351
/* phy device may attach itself for hardware timestamping */
13551352
struct phy_device *phydev;
13561353

net/core/dev.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5867,8 +5867,6 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
58675867

58685868
dev->gso_max_size = GSO_MAX_SIZE;
58695869

5870-
INIT_LIST_HEAD(&dev->ethtool_ntuple_list.list);
5871-
dev->ethtool_ntuple_list.count = 0;
58725870
INIT_LIST_HEAD(&dev->napi_list);
58735871
INIT_LIST_HEAD(&dev->unreg_list);
58745872
INIT_LIST_HEAD(&dev->link_watch_list);
@@ -5932,9 +5930,6 @@ void free_netdev(struct net_device *dev)
59325930
/* Flush device addresses */
59335931
dev_addr_flush(dev);
59345932

5935-
/* Clear ethtool n-tuple list */
5936-
ethtool_ntuple_flush(dev);
5937-
59385933
list_for_each_entry_safe(p, n, &dev->napi_list, dev_list)
59395934
netif_napi_del(p);
59405935

0 commit comments

Comments
 (0)