Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dd00e06d authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'net-Use-__vlan_hwaccel_-helpers'



Michał Mirosław says:

====================
net: Use __vlan_hwaccel_*() helpers

This series removes from networking core and driver code an assumption
about how VLAN tag presence is stored in an skb. This will allow to free
up overloading of VLAN.CFI bit to incidate tag's presence.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 49f8e832 3149a271
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3944,7 +3944,7 @@ static int rx_pkt(struct c4iw_dev *dev, struct sk_buff *skb)
	} else {
		vlan_eh = (struct vlan_ethhdr *)(req + 1);
		iph = (struct iphdr *)(vlan_eh + 1);
		skb->vlan_tci = ntohs(cpl->vlan);
		__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), ntohs(cpl->vlan));
	}

	if (iph->version != 0x4)
+9 −4
Original line number Diff line number Diff line
@@ -1049,30 +1049,35 @@ static struct sk_buff *be_insert_vlan_in_pkt(struct be_adapter *adapter,
					     struct be_wrb_params
					     *wrb_params)
{
	bool insert_vlan = false;
	u16 vlan_tag = 0;

	skb = skb_share_check(skb, GFP_ATOMIC);
	if (unlikely(!skb))
		return skb;

	if (skb_vlan_tag_present(skb))
	if (skb_vlan_tag_present(skb)) {
		vlan_tag = be_get_tx_vlan_tag(adapter, skb);
		insert_vlan = true;
	}

	if (qnq_async_evt_rcvd(adapter) && adapter->pvid) {
		if (!vlan_tag)
		if (!insert_vlan) {
			vlan_tag = adapter->pvid;
			insert_vlan = true;
		}
		/* f/w workaround to set skip_hw_vlan = 1, informs the F/W to
		 * skip VLAN insertion
		 */
		BE_WRB_F_SET(wrb_params->features, VLAN_SKIP_HW, 1);
	}

	if (vlan_tag) {
	if (insert_vlan) {
		skb = vlan_insert_tag_set_proto(skb, htons(ETH_P_8021Q),
						vlan_tag);
		if (unlikely(!skb))
			return skb;
		skb->vlan_tci = 0;
		__vlan_hwaccel_clear_tag(skb);
	}

	/* Insert the outer VLAN, if any */
+2 −4
Original line number Diff line number Diff line
@@ -2485,13 +2485,11 @@ static struct sk_buff *receive_copy(struct sky2_port *sky2,
		skb->ip_summed = re->skb->ip_summed;
		skb->csum = re->skb->csum;
		skb_copy_hash(skb, re->skb);
		skb->vlan_proto = re->skb->vlan_proto;
		skb->vlan_tci = re->skb->vlan_tci;
		__vlan_hwaccel_copy_tag(skb, re->skb);

		pci_dma_sync_single_for_device(sky2->hw->pdev, re->data_addr,
					       length, PCI_DMA_FROMDEVICE);
		re->skb->vlan_proto = 0;
		re->skb->vlan_tci = 0;
		__vlan_hwaccel_clear_tag(re->skb);
		skb_clear_hash(re->skb);
		re->skb->ip_summed = CHECKSUM_NONE;
		skb_put(skb, length);
+1 −1
Original line number Diff line number Diff line
@@ -875,7 +875,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
			skb->data_len = length;
			napi_gro_frags(&cq->napi);
		} else {
			skb->vlan_tci = 0;
			__vlan_hwaccel_clear_tag(skb);
			skb_clear_hash(skb);
		}
next:
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ bool vlan_do_receive(struct sk_buff **skbp)
	}

	skb->priority = vlan_get_ingress_priority(vlan_dev, skb->vlan_tci);
	skb->vlan_tci = 0;
	__vlan_hwaccel_clear_tag(skb);

	rx_stats = this_cpu_ptr(vlan_dev_priv(vlan_dev)->vlan_pcpu_stats);

Loading