Commit 60cafa03 authored by Ronak Doshi's avatar Ronak Doshi Committed by Paolo Abeni
Browse files

vmxnet3: use ext1 field to indicate encapsulated packet



Till vmxnet3 version 6, om field of transmit descriptor was used
to indicate encapsulated offload packet and msscof was used to
indirectly indicate TSO/CSO. From version 7 and later, ext1 field
will be used to indicate whether packet is encapsulated or not and
om fields will continue to indicate if the packet is TSO or CSO.

Signed-off-by: default avatarRonak Doshi <doshir@vmware.com>
Acked-by: default avatarGuolin Yang <gyang@vmware.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent d2857b99
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -148,17 +148,17 @@ struct Vmxnet3_TxDesc {

#ifdef __BIG_ENDIAN_BITFIELD
	u32 msscof:14;  /* MSS, checksum offset, flags */
	u32 ext1:1;
	u32 ext1:1;     /* set to 1 to indicate inner csum/tso, vmxnet3 v7 */
	u32 dtype:1;    /* descriptor type */
	u32 oco:1;
	u32 oco:1;      /* Outer csum offload */
	u32 gen:1;      /* generation bit */
	u32 len:14;
#else
	u32 len:14;
	u32 gen:1;      /* generation bit */
	u32 oco:1;
	u32 oco:1;      /* Outer csum offload */
	u32 dtype:1;    /* descriptor type */
	u32 ext1:1;
	u32 ext1:1;     /* set to 1 to indicate inner csum/tso, vmxnet3 v7 */
	u32 msscof:14;  /* MSS, checksum offset, flags */
#endif  /* __BIG_ENDIAN_BITFIELD */

@@ -262,11 +262,13 @@ struct Vmxnet3_RxCompDesc {
	u32		rqID:10;      /* rx queue/ring ID */
	u32		sop:1;        /* Start of Packet */
	u32		eop:1;        /* End of Packet */
	u32		ext1:2;
	u32		ext1:2;       /* bit 0: indicating v4/v6/.. is for inner header */
				      /* bit 1: indicating rssType is based on inner header */
	u32		rxdIdx:12;    /* Index of the RxDesc */
#else
	u32		rxdIdx:12;    /* Index of the RxDesc */
	u32		ext1:2;
	u32		ext1:2;       /* bit 0: indicating v4/v6/.. is for inner header */
				      /* bit 1: indicating rssType is based on inner header */
	u32		eop:1;        /* End of Packet */
	u32		sop:1;        /* Start of Packet */
	u32		rqID:10;      /* rx queue/ring ID */
+15 −3
Original line number Diff line number Diff line
@@ -1161,7 +1161,12 @@ vmxnet3_tq_xmit(struct sk_buff *skb, struct vmxnet3_tx_queue *tq,
	if (ctx.mss) {
		if (VMXNET3_VERSION_GE_4(adapter) && skb->encapsulation) {
			gdesc->txd.hlen = ctx.l4_offset + ctx.l4_hdr_size;
			if (VMXNET3_VERSION_GE_7(adapter)) {
				gdesc->txd.om = VMXNET3_OM_TSO;
				gdesc->txd.ext1 = 1;
			} else {
				gdesc->txd.om = VMXNET3_OM_ENCAP;
			}
			gdesc->txd.msscof = ctx.mss;

			if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_TUNNEL_CSUM)
@@ -1178,8 +1183,15 @@ vmxnet3_tq_xmit(struct sk_buff *skb, struct vmxnet3_tx_queue *tq,
			    skb->encapsulation) {
				gdesc->txd.hlen = ctx.l4_offset +
						  ctx.l4_hdr_size;
				if (VMXNET3_VERSION_GE_7(adapter)) {
					gdesc->txd.om = VMXNET3_OM_CSUM;
					gdesc->txd.msscof = ctx.l4_offset +
							    skb->csum_offset;
					gdesc->txd.ext1 = 1;
				} else {
					gdesc->txd.om = VMXNET3_OM_ENCAP;
					gdesc->txd.msscof = 0;		/* Reserved */
				}
			} else {
				gdesc->txd.hlen = ctx.l4_offset;
				gdesc->txd.om = VMXNET3_OM_CSUM;