Thread (5 messages) flat view 5 messages, 2 authors, 2021-06-10

Re: [PATCH net-next v4 2/3] net/xfrm: Add inner_ipproto into sec_path

From: Steffen Klassert <steffen.klassert@secunet.com>
Date: 2021-06-10 10:37:04

On Mon, Jun 07, 2021 at 09:00:45PM +0300, Huy Nguyen wrote:
 
+/* For partial checksum offload, the outer header checksum is calculated
+ * by software and the inner header checksum is calculated by hardware.
+ * This requires hardware to know the inner packet type to calculate
+ * the inner header checksum. Save inner ip protocol here to avoid
+ * traversing the packet in the vendor's xmit code.
+ * If the encap type is IPIP, just save skb->inner_ipproto. Otherwise,
+ * get the ip protocol from the IP header.
+ */
+static void xfrm_get_inner_ipproto(struct sk_buff *skb)
+{
+	struct xfrm_offload *xo = xfrm_offload(skb);
+	const struct ethhdr *eth;
+
+	xo = xfrm_offload(skb);
You fetched the xo pointer already above.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help