Skip to content

Commit 4eb50ce

Browse files
tlfalcondavem330
authored andcommitted
ibmvnic: Include header descriptor support for ARP packets
In recent tests with new adapters, it was discovered that ARP packets were not being properly processed. This patch adds support for ARP packet headers to be passed to backing adapters, if necessary. Signed-off-by: Thomas Falcon <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 61afe07 commit 4eb50ce

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/net/ethernet/ibm/ibmvnic.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
#include <linux/mm.h>
6060
#include <linux/ethtool.h>
6161
#include <linux/proc_fs.h>
62+
#include <linux/if_arp.h>
6263
#include <linux/in.h>
6364
#include <linux/ip.h>
6465
#include <linux/ipv6.h>
@@ -1153,6 +1154,9 @@ static int build_hdr_data(u8 hdr_field, struct sk_buff *skb,
11531154
hdr_len[2] = tcp_hdrlen(skb);
11541155
else if (ipv6_hdr(skb)->nexthdr == IPPROTO_UDP)
11551156
hdr_len[2] = sizeof(struct udphdr);
1157+
} else if (skb->protocol == htons(ETH_P_ARP)) {
1158+
hdr_len[1] = arp_hdr_len(skb->dev);
1159+
hdr_len[2] = 0;
11561160
}
11571161

11581162
memset(hdr_data, 0, 120);
@@ -1386,7 +1390,8 @@ static int ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev)
13861390
/* determine if l2/3/4 headers are sent to firmware */
13871391
if ((*hdrs >> 7) & 1 &&
13881392
(skb->protocol == htons(ETH_P_IP) ||
1389-
skb->protocol == htons(ETH_P_IPV6))) {
1393+
skb->protocol == htons(ETH_P_IPV6) ||
1394+
skb->protocol == htons(ETH_P_ARP))) {
13901395
build_hdr_descs_arr(tx_buff, &num_entries, *hdrs);
13911396
tx_crq.v1.n_crq_elem = num_entries;
13921397
tx_buff->indir_arr[0] = tx_crq;

0 commit comments

Comments
 (0)