benet: use __vlan_hwaccel helpers
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
3e2ed0c257
commit
c4062f89c5
|
@ -1049,30 +1049,35 @@ static struct sk_buff *be_insert_vlan_in_pkt(struct be_adapter *adapter,
|
||||||
struct be_wrb_params
|
struct be_wrb_params
|
||||||
*wrb_params)
|
*wrb_params)
|
||||||
{
|
{
|
||||||
|
bool insert_vlan = false;
|
||||||
u16 vlan_tag = 0;
|
u16 vlan_tag = 0;
|
||||||
|
|
||||||
skb = skb_share_check(skb, GFP_ATOMIC);
|
skb = skb_share_check(skb, GFP_ATOMIC);
|
||||||
if (unlikely(!skb))
|
if (unlikely(!skb))
|
||||||
return skb;
|
return skb;
|
||||||
|
|
||||||
if (skb_vlan_tag_present(skb))
|
if (skb_vlan_tag_present(skb)) {
|
||||||
vlan_tag = be_get_tx_vlan_tag(adapter, skb);
|
vlan_tag = be_get_tx_vlan_tag(adapter, skb);
|
||||||
|
insert_vlan = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (qnq_async_evt_rcvd(adapter) && adapter->pvid) {
|
if (qnq_async_evt_rcvd(adapter) && adapter->pvid) {
|
||||||
if (!vlan_tag)
|
if (!insert_vlan) {
|
||||||
vlan_tag = adapter->pvid;
|
vlan_tag = adapter->pvid;
|
||||||
|
insert_vlan = true;
|
||||||
|
}
|
||||||
/* f/w workaround to set skip_hw_vlan = 1, informs the F/W to
|
/* f/w workaround to set skip_hw_vlan = 1, informs the F/W to
|
||||||
* skip VLAN insertion
|
* skip VLAN insertion
|
||||||
*/
|
*/
|
||||||
BE_WRB_F_SET(wrb_params->features, VLAN_SKIP_HW, 1);
|
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),
|
skb = vlan_insert_tag_set_proto(skb, htons(ETH_P_8021Q),
|
||||||
vlan_tag);
|
vlan_tag);
|
||||||
if (unlikely(!skb))
|
if (unlikely(!skb))
|
||||||
return skb;
|
return skb;
|
||||||
skb->vlan_tci = 0;
|
__vlan_hwaccel_clear_tag(skb);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Insert the outer VLAN, if any */
|
/* Insert the outer VLAN, if any */
|
||||||
|
|
Loading…
Reference in New Issue