Skip to content

Commit 6cfb5e7

Browse files
Ben Hutchingsdavem330
authored andcommitted
ethtool: Remove ethtool_ops::set_rx_ntuple operation
All implementations have been converted to implement set_rxnfc instead. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 8db182f commit 6cfb5e7

2 files changed

Lines changed: 0 additions & 59 deletions

File tree

‎include/linux/ethtool.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -859,8 +859,6 @@ static inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings)
859859
* @reset: Reset (part of) the device, as specified by a bitmask of
860860
* flags from &enum ethtool_reset_flags. Returns a negative
861861
* error code or zero.
862-
* @set_rx_ntuple: Set an RX n-tuple rule. Returns a negative error code
863-
* or zero.
864862
* @get_rxfh_indir_size: Get the size of the RX flow hash indirection table.
865863
* Returns zero if not supported for this specific device.
866864
* @get_rxfh_indir: Get the contents of the RX flow hash indirection table.
@@ -929,8 +927,6 @@ struct ethtool_ops {
929927
int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *);
930928
int (*flash_device)(struct net_device *, struct ethtool_flash *);
931929
int (*reset)(struct net_device *, u32 *);
932-
int (*set_rx_ntuple)(struct net_device *,
933-
struct ethtool_rx_ntuple *);
934930
u32 (*get_rxfh_indir_size)(struct net_device *);
935931
int (*get_rxfh_indir)(struct net_device *, u32 *);
936932
int (*set_rxfh_indir)(struct net_device *, const u32 *);

‎net/core/ethtool.c‎

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -631,58 +631,6 @@ static noinline_for_stack int ethtool_set_rxfh_indir(struct net_device *dev,
631631
return ret;
632632
}
633633

634-
/*
635-
* ethtool does not (or did not) set masks for flow parameters that are
636-
* not specified, so if both value and mask are 0 then this must be
637-
* treated as equivalent to a mask with all bits set. Implement that
638-
* here rather than in drivers.
639-
*/
640-
static void rx_ntuple_fix_masks(struct ethtool_rx_ntuple_flow_spec *fs)
641-
{
642-
struct ethtool_tcpip4_spec *entry = &fs->h_u.tcp_ip4_spec;
643-
struct ethtool_tcpip4_spec *mask = &fs->m_u.tcp_ip4_spec;
644-
645-
if (fs->flow_type != TCP_V4_FLOW &&
646-
fs->flow_type != UDP_V4_FLOW &&
647-
fs->flow_type != SCTP_V4_FLOW)
648-
return;
649-
650-
if (!(entry->ip4src | mask->ip4src))
651-
mask->ip4src = htonl(0xffffffff);
652-
if (!(entry->ip4dst | mask->ip4dst))
653-
mask->ip4dst = htonl(0xffffffff);
654-
if (!(entry->psrc | mask->psrc))
655-
mask->psrc = htons(0xffff);
656-
if (!(entry->pdst | mask->pdst))
657-
mask->pdst = htons(0xffff);
658-
if (!(entry->tos | mask->tos))
659-
mask->tos = 0xff;
660-
if (!(fs->vlan_tag | fs->vlan_tag_mask))
661-
fs->vlan_tag_mask = 0xffff;
662-
if (!(fs->data | fs->data_mask))
663-
fs->data_mask = 0xffffffffffffffffULL;
664-
}
665-
666-
static noinline_for_stack int ethtool_set_rx_ntuple(struct net_device *dev,
667-
void __user *useraddr)
668-
{
669-
struct ethtool_rx_ntuple cmd;
670-
const struct ethtool_ops *ops = dev->ethtool_ops;
671-
672-
if (!ops->set_rx_ntuple)
673-
return -EOPNOTSUPP;
674-
675-
if (!(dev->features & NETIF_F_NTUPLE))
676-
return -EINVAL;
677-
678-
if (copy_from_user(&cmd, useraddr, sizeof(cmd)))
679-
return -EFAULT;
680-
681-
rx_ntuple_fix_masks(&cmd.fs);
682-
683-
return ops->set_rx_ntuple(dev, &cmd);
684-
}
685-
686634
static int ethtool_get_regs(struct net_device *dev, char __user *useraddr)
687635
{
688636
struct ethtool_regs regs;
@@ -1495,9 +1443,6 @@ int dev_ethtool(struct net *net, struct ifreq *ifr)
14951443
case ETHTOOL_RESET:
14961444
rc = ethtool_reset(dev, useraddr);
14971445
break;
1498-
case ETHTOOL_SRXNTUPLE:
1499-
rc = ethtool_set_rx_ntuple(dev, useraddr);
1500-
break;
15011446
case ETHTOOL_GSSET_INFO:
15021447
rc = ethtool_get_sset_info(dev, useraddr);
15031448
break;

0 commit comments

Comments
 (0)