/* * netsniff-ng - the packet sniffing beast * Subject to the GPL, version 2. */ #include "protos.h" #include "pcap_io.h" #include "pkt_buff.h" #include "dissector.h" #include "dissector_sll.h" #include "dissector_eth.h" #include "lookup.h" static char *pkt_type2str(uint8_t pkttype) { switch (pkttype) { case PACKET_HOST: return "host"; case PACKET_BROADCAST: return "broadcast"; case PACKET_MULTICAST: return "multicast"; case PACKET_OTHERHOST: return "other host"; case PACKET_OUTGOING: return "outgoing"; case PACKET_USER: return "user"; case PACKET_KERNEL: return "kernel"; } return "Unknown"; } static void sll_print_full(struct pkt_buff *pkt) { struct sockaddr_ll *sll = pkt->sll; char addr_str[40] = {}; tprintf(" [ Linux \"cooked\""); tprintf(" Pkt Type %d (%s)", sll->sll_pkttype, pkt_type2str(sll->sll_pkttype)); tprintf(", If Type %d (%s)", sll->sll_hatype, device_type2str(sll->sll_hatype)); tprintf(", Addr Len %d", sll->sll_halen); tprintf(", Src (%s)", device_addr2str(sll->sll_addr, sll->sll_halen, sll->sll_hatype, addr_str, sizeof(addr_str))); tprintf(", Proto 0x%x", ntohs(sll->sll_protocol)); tprintf(" ]\n"); switch (pcap_devtype_to_linktype(sll->sll_hatype)) { case LINKTYPE_EN10MB: case ___constant_swab32(LINKTYPE_EN10MB): pkt_set_dissector(pkt, ð_lay2, ntohs(sll->sll_protocol)); break; case LINKTYPE_NETLINK: case ___constant_swab32(LINKTYPE_NETLINK): pkt->dissector = &nlmsg_ops; break; default: tprintf(" [ Unknown protocol ]\n"); } } static void sll_print_less(struct pkt_buff *pkt) { struct sockaddr_ll *sll = pkt->sll; char addr_str[40] = {}; tprintf(" Pkt Type %d (%s)", sll->sll_pkttype, pkt_type2str(sll->sll_pkttype)); tprintf(", If Type %d (%s)", sll->sll_hatype, device_type2str(sll->sll_hatype)); tprintf(", Addr Len %d", sll->sll_halen); tprintf(", Src (%s)", device_addr2str(sll->sll_addr, sll->sll_halen, sll->sll_hatype, addr_str, sizeof(addr_str))); tprintf(", Proto 0x%x", ntohs(sll->sll_protocol)); } struct protocol sll_ops = { .key = 0, .print_full = sll_print_full, .print_less = sll_print_less, }; struct protocol *dissector_get_sll_entry_point(void) { return &sll_ops; } struct protocol *dissector_get_sll_exit_point(void) { return &none_ops; } void dissector_init_sll(int fnttype) { dissector_set_print_type(&sll_ops, fnttype); dissector_set_print_type(&none_ops, fnttype); lookup_init(LT_OUI); } void dissector_cleanup_sll(void) { lookup_cleanup(LT_OUI); } e='nds-private-remove'/>
path: root/Documentation/hwmon/tmp401
diff options
context:
space:
mode:
authorValentin Rothberg <valentinrothberg@gmail.com>2016-10-05 07:57:26 +0200
committerMichael Ellerman <mpe@ellerman.id.au>2016-10-27 21:52:59 +1100
commit39715bf972ed4fee18fe5409609a971fb16b1771 (patch)
tree1d423c94bc8d3199a42f16b6296c9d96e929982b /Documentation/hwmon/tmp401
parent09b7e37b18eecc1e347f4b1a3bc863f32801f634 (diff)
powerpc/process: Fix CONFIG_ALIVEC typo in restore_tm_state()
It should be ALTIVEC, not ALIVEC. Cyril explains: If a thread performs a transaction with altivec and then gets preempted for whatever reason, this bug may cause the kernel to not re-enable altivec when that thread runs again. This will result in an altivec unavailable fault, when that fault happens inside a user transaction the kernel has no choice but to enable altivec and doom the transaction. The result is that transactions using altivec may get aborted more often than they should. The difficulty in catching this with a selftest is my deliberate use of the word may above. Optimisations to avoid FPU/altivec/VSX faults mean that the kernel will always leave them on for 255 switches. This code prevents the kernel turning it off if it got to the 256th switch (and userspace was transactional). Fixes: dc16b553c949 ("powerpc: Always restore FPU/VEC/VSX if hardware transactional memory in use") Reviewed-by: Cyril Bur <cyrilbur@gmail.com> Signed-off-by: Valentin Rothberg <valentinrothberg@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'Documentation/hwmon/tmp401')