Skip to content

Commit

Permalink
Revert "net: core: introduce netif_skb_dev_features"
Browse files Browse the repository at this point in the history
This reverts commit d206940,
there are no more callers.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Florian Westphal authored and David S. Miller committed May 7, 2014
1 parent c7ba65d commit c1e756b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 18 deletions.
7 changes: 1 addition & 6 deletions include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -3180,12 +3180,7 @@ void netdev_change_features(struct net_device *dev);
void netif_stacked_transfer_operstate(const struct net_device *rootdev,
struct net_device *dev);

netdev_features_t netif_skb_dev_features(struct sk_buff *skb,
const struct net_device *dev);
static inline netdev_features_t netif_skb_features(struct sk_buff *skb)
{
return netif_skb_dev_features(skb, skb->dev);
}
netdev_features_t netif_skb_features(struct sk_buff *skb);

static inline bool net_gso_ok(netdev_features_t features, int gso_type)
{
Expand Down
22 changes: 10 additions & 12 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2418,7 +2418,7 @@ EXPORT_SYMBOL(netdev_rx_csum_fault);
* 2. No high memory really exists on this machine.
*/

static int illegal_highdma(const struct net_device *dev, struct sk_buff *skb)
static int illegal_highdma(struct net_device *dev, struct sk_buff *skb)
{
#ifdef CONFIG_HIGHMEM
int i;
Expand Down Expand Up @@ -2493,48 +2493,46 @@ static int dev_gso_segment(struct sk_buff *skb, netdev_features_t features)
}

static netdev_features_t harmonize_features(struct sk_buff *skb,
const struct net_device *dev,
netdev_features_t features)
netdev_features_t features)
{
int tmp;

if (skb->ip_summed != CHECKSUM_NONE &&
!can_checksum_protocol(features, skb_network_protocol(skb, &tmp))) {
features &= ~NETIF_F_ALL_CSUM;
} else if (illegal_highdma(dev, skb)) {
} else if (illegal_highdma(skb->dev, skb)) {
features &= ~NETIF_F_SG;
}

return features;
}

netdev_features_t netif_skb_dev_features(struct sk_buff *skb,
const struct net_device *dev)
netdev_features_t netif_skb_features(struct sk_buff *skb)
{
__be16 protocol = skb->protocol;
netdev_features_t features = dev->features;
netdev_features_t features = skb->dev->features;

if (skb_shinfo(skb)->gso_segs > dev->gso_max_segs)
if (skb_shinfo(skb)->gso_segs > skb->dev->gso_max_segs)
features &= ~NETIF_F_GSO_MASK;

if (protocol == htons(ETH_P_8021Q) || protocol == htons(ETH_P_8021AD)) {
struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data;
protocol = veh->h_vlan_encapsulated_proto;
} else if (!vlan_tx_tag_present(skb)) {
return harmonize_features(skb, dev, features);
return harmonize_features(skb, features);
}

features &= (dev->vlan_features | NETIF_F_HW_VLAN_CTAG_TX |
features &= (skb->dev->vlan_features | NETIF_F_HW_VLAN_CTAG_TX |
NETIF_F_HW_VLAN_STAG_TX);

if (protocol == htons(ETH_P_8021Q) || protocol == htons(ETH_P_8021AD))
features &= NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST |
NETIF_F_GEN_CSUM | NETIF_F_HW_VLAN_CTAG_TX |
NETIF_F_HW_VLAN_STAG_TX;

return harmonize_features(skb, dev, features);
return harmonize_features(skb, features);
}
EXPORT_SYMBOL(netif_skb_dev_features);
EXPORT_SYMBOL(netif_skb_features);

int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
struct netdev_queue *txq)
Expand Down

0 comments on commit c1e756b

Please sign in to comment.