Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Linux/drivers/net/ethernet/netronome/nfp/nfd3/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 944 B image not shown  

Quelle  ipsec.c   Sprache: C

 
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
/* Copyright (C) 2018 Netronome Systems, Inc */
/* Copyright (C) 2021 Corigine, Inc */

#include <net/xfrm.h>

#include "../nfp_net.h"
#include "nfd3.h"

void nfp_nfd3_ipsec_tx(struct nfp_nfd3_tx_desc *txd, struct sk_buff *skb)
{
 struct xfrm_state *x = xfrm_input_state(skb);
 struct xfrm_offload *xo = xfrm_offload(skb);
 struct iphdr *iph = ip_hdr(skb);
 int l4_proto;

 if (x->xso.dev && (x->xso.dev->features & NETIF_F_HW_ESP_TX_CSUM)) {
  txd->flags |= NFD3_DESC_TX_CSUM;

  if (iph->version == 4)
   txd->flags |= NFD3_DESC_TX_IP4_CSUM;

  if (x->props.mode == XFRM_MODE_TRANSPORT)
   l4_proto = xo->proto;
  else if (x->props.mode == XFRM_MODE_TUNNEL)
   l4_proto = xo->inner_ipproto;
  else
   return;

  switch (l4_proto) {
  case IPPROTO_UDP:
   txd->flags |= NFD3_DESC_TX_UDP_CSUM;
   return;
  case IPPROTO_TCP:
   txd->flags |= NFD3_DESC_TX_TCP_CSUM;
   return;
  }
 }
}

Messung V0.5
C=92 H=100 G=95

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.